Add project files.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.AdminLayoutComponents
|
||||
{
|
||||
public class _AdminLayoutFooterPartialComponent : ViewComponent
|
||||
{
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.AdminLayoutComponents
|
||||
{
|
||||
public class _AdminLayoutHeaderPartialComponent : ViewComponent
|
||||
{
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using ConstructorApp.DataAccessLayer.Concrete;
|
||||
using ConstructorApp.EntityLayer.Entities;
|
||||
using ConstructorAppUI.ViewModels;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.AdminLayoutComponents
|
||||
{
|
||||
public class _AdminLayoutNavbarPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly string _signalRHubBaseUrl;
|
||||
private readonly ConstructorContext _context;
|
||||
private readonly UserManager<AppUser> _userManager;
|
||||
|
||||
public _AdminLayoutNavbarPartialComponent(IConfiguration configuration, ConstructorContext context, UserManager<AppUser> userManager)
|
||||
{
|
||||
_signalRHubBaseUrl = configuration["SignalRHubSettings:BaseUrl"];
|
||||
_context = context;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
ViewBag.SignalRHubBaseUrl = _signalRHubBaseUrl;
|
||||
var user = await _userManager.GetUserAsync(HttpContext.User);
|
||||
var model = new UserProfileViewModel
|
||||
{
|
||||
UserName = user.UserName
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.AdminLayoutComponents
|
||||
{
|
||||
public class _AdminLayoutScriptPartialComponent : ViewComponent
|
||||
{
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.AdminLayoutComponents
|
||||
{
|
||||
public class _AdminLayoutSidebarPartialComponent : ViewComponent
|
||||
{
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ConstructorAppUI.Dtos.ServiceDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeAboutPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeAboutPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/Service");
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
var values = JsonConvert.DeserializeObject<List<ResultServiceDto>>(jsonData);
|
||||
return View(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using ConstructorAppUI.Dtos.HomeBannerDtos;
|
||||
using ConstructorAppUI.Dtos.SliderDtos;
|
||||
using ConstructorAppUI.ViewModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeBannerAndSliderPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeBannerAndSliderPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
|
||||
var homeBannerResponse = await client.GetAsync($"{_apiBaseUrl}/api/HomeBanner");
|
||||
var sliderResponse = await client.GetAsync($"{_apiBaseUrl}/api/Slider");
|
||||
|
||||
var viewModel = new HomeBannerAndSliderViewModel();
|
||||
|
||||
if (homeBannerResponse.IsSuccessStatusCode)
|
||||
{
|
||||
var bannerJson = await homeBannerResponse.Content.ReadAsStringAsync();
|
||||
viewModel.HomeBanners = JsonConvert.DeserializeObject<List<ResultHomeBannerDto>>(bannerJson);
|
||||
}
|
||||
|
||||
if (sliderResponse.IsSuccessStatusCode)
|
||||
{
|
||||
var sliderJson = await sliderResponse.Content.ReadAsStringAsync();
|
||||
viewModel.Sliders = JsonConvert.DeserializeObject<List<ResultSliderDto>>(sliderJson);
|
||||
}
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using ConstructorAppUI.Dtos.CompanyInfoDtos;
|
||||
using ConstructorAppUI.Dtos.CompanyInfoVideoDtos;
|
||||
using ConstructorAppUI.ViewModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeCompanyInfoPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeCompanyInfoPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var companyInfoResponse = await client.GetAsync($"{_apiBaseUrl}/api/CompanyInfo");
|
||||
var companyInfoVideoResponse = await client.GetAsync($"{_apiBaseUrl}/api/CompanyInfoVideo");
|
||||
|
||||
var viewModel = new HomeCompanyInfoAndVideoViewModel();
|
||||
|
||||
if (companyInfoResponse.IsSuccessStatusCode)
|
||||
{
|
||||
var companyInfoJson = await companyInfoResponse.Content.ReadAsStringAsync();
|
||||
viewModel.CompanyInfo = JsonConvert.DeserializeObject<List<ResultCompanyInfoDto>>(companyInfoJson);
|
||||
}
|
||||
|
||||
if (companyInfoVideoResponse.IsSuccessStatusCode)
|
||||
{
|
||||
var companyInfoVideoJson = await companyInfoVideoResponse.Content.ReadAsStringAsync();
|
||||
var companyInfoVideoList = JsonConvert.DeserializeObject<List<ResultCompanyInfoVideoDto>>(companyInfoVideoJson);
|
||||
viewModel.CompanyInfoVideo = companyInfoVideoList?.FirstOrDefault();
|
||||
}
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using ConstructorAppUI.Dtos.ContactUsDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeContactUsPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly string _apiBaseUrl;
|
||||
|
||||
public _HomeContactUsPartialComponent(IConfiguration configuration)
|
||||
{
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
// ViewBag ile API base URL'sini taşıyoruz
|
||||
ViewBag.ApiBaseUrl = _apiBaseUrl;
|
||||
|
||||
var model = new CreateContactUsDto(); // Formu boş model ile başlatıyoruz
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using ConstructorAppUI.Dtos.ProjectDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeProjectPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeProjectPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/Project");
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
var values = JsonConvert.DeserializeObject<List<ResultProjectDto>>(jsonData);
|
||||
return View(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ConstructorAppUI.Dtos.ReferenceDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeReferencePartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeReferencePartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/Reference");
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
var values = JsonConvert.DeserializeObject<List<ResultReferenceDto>>(jsonData);
|
||||
return View(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ConstructorAppUI.Dtos.TeamDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeTeamPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeTeamPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/Team");
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
var values = JsonConvert.DeserializeObject<List<ResultTeamDto>>(jsonData);
|
||||
return View(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ConstructorAppUI.Dtos.TestimonialDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeTestimonialPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeTestimonialPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/Testimonial");
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
var values = JsonConvert.DeserializeObject<List<ResultTestimonialDto>>(jsonData);
|
||||
return View(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using ConstructorAppUI.Dtos.WorkProcessDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeComponents
|
||||
{
|
||||
public class _HomeWorkProcessPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeWorkProcessPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/WorkProcess");
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
var values = JsonConvert.DeserializeObject<List<ResultWorkProcessDto>>(jsonData);
|
||||
return View(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using ConstructorAppUI.Dtos.FooterDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeLayoutComponents
|
||||
{
|
||||
public class _HomeLayoutFooterPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly string _apiBaseUrl;
|
||||
|
||||
public _HomeLayoutFooterPartialComponent(IHttpClientFactory httpClientFactory, IWebHostEnvironment webHostEnvironment, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/Footer");
|
||||
if (responseMessage.IsSuccessStatusCode)
|
||||
{
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
var values = JsonConvert.DeserializeObject<List<ResultFooterDto>>(jsonData);
|
||||
|
||||
// Sadece ilk öğeyi gönderecek şekilde güncelleyin
|
||||
return View(values.FirstOrDefault());
|
||||
}
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeLayoutComponents
|
||||
{
|
||||
public class _HomeLayoutHeaderPartialComponent : ViewComponent
|
||||
{
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using ConstructorAppUI.Dtos.FooterDtos;
|
||||
using ConstructorAppUI.Dtos.HomeBannerDtos;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeLayoutComponents
|
||||
{
|
||||
public class _HomeLayoutNavbarPartialComponent : ViewComponent
|
||||
{
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
private readonly string? _apiBaseUrl;
|
||||
|
||||
public _HomeLayoutNavbarPartialComponent(IHttpClientFactory httpClientFactory, IConfiguration configuration)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_apiBaseUrl = configuration["ApiSettings:BaseUrl"];
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient();
|
||||
|
||||
// HomeBanner verisi çekiliyor
|
||||
var responseMessage = await client.GetAsync($"{_apiBaseUrl}/api/HomeBanner");
|
||||
var values = new List<ResultHomeBannerDto>();
|
||||
|
||||
if (responseMessage.IsSuccessStatusCode)
|
||||
{
|
||||
var jsonData = await responseMessage.Content.ReadAsStringAsync();
|
||||
values = JsonConvert.DeserializeObject<List<ResultHomeBannerDto>>(jsonData);
|
||||
}
|
||||
|
||||
// Footer verisi çekiliyor (telefon numarası için)
|
||||
var footerResponse = await client.GetAsync($"{_apiBaseUrl}/api/Footer");
|
||||
if (footerResponse.IsSuccessStatusCode)
|
||||
{
|
||||
var jsonFooter = await footerResponse.Content.ReadAsStringAsync();
|
||||
var footerData = JsonConvert.DeserializeObject<List<ResultFooterDto>>(jsonFooter);
|
||||
var phone = footerData.FirstOrDefault()?.Phone;
|
||||
|
||||
ViewBag.FooterPhone = phone;
|
||||
}
|
||||
|
||||
return View(values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ConstructorAppUI.ViewComponents.HomeLayoutComponents
|
||||
{
|
||||
public class _HomeLayoutScriptPartialComponent : ViewComponent
|
||||
{
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user