Add project files.

This commit is contained in:
2025-05-01 15:18:30 +03:00
parent e058ab8015
commit 774d695414
3094 changed files with 1336814 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfCompanyInfoDal : GenericRepository<CompanyInfo>, ICompanyInfoDal
{
public EfCompanyInfoDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfCompanyInfoVideoDal : GenericRepository<CompanyInfoVideo>, ICompanyInfoVideoDal
{
public EfCompanyInfoVideoDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,34 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfContactUsDal : GenericRepository<ContactUs>, IContactUsDal
{
private readonly ConstructorContext context;
public EfContactUsDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.ContactUs.Count();
}
public int CountByStatusPending()
{
return context.ContactUs.Where(x => x.Status == false).Count();
}
public void MarkAsRead(int id)
{
var values = context.ContactUs.Find(id);
values.Status = true;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,21 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfFooterDal : GenericRepository<Footer>, IFooterDal
{
private readonly ConstructorContext _context;
public EfFooterDal(ConstructorContext context) : base(context)
{
_context = context;
}
public Footer GetFooterDetails()
{
return _context.Footer.FirstOrDefault();
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfHomeBannerDal : GenericRepository<HomeBanner>, IHomeBannerDal
{
public EfHomeBannerDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,48 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
using Microsoft.EntityFrameworkCore;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfProjectDal : GenericRepository<Project>, IProjectDal
{
private readonly ConstructorContext context;
public EfProjectDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.Projects.Count(x => x.IsActive == true);
}
public Project GetBySlug(string slug)
{
return context.Projects.FirstOrDefault(p => p.Slug == slug && p.IsActive);
}
public Project GetProjectWithImagesBySlug(string slug)
{
return context.Projects
.Include(p => p.ProjectGallery)
.FirstOrDefault(p => p.Slug == slug);
}
public void ProjectStatusActive(int id)
{
var values = context.Projects.Find(id);
values.IsActive = true;
context.SaveChanges();
}
public void rojectStatusPassive(int id)
{
var values = context.Projects.Find(id);
values.IsActive = false;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,23 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfProjectGalleryDal : GenericRepository<ProjectGallery>, IProjectGalleryDal
{
private readonly ConstructorContext context;
public EfProjectGalleryDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public List<ProjectGallery> GetImagesByProjectId(int projectId)
{
return context.ProjectGallery
.Where(x => x.ProjectID == projectId)
.ToList();
}
}
}

View File

@@ -0,0 +1,21 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfReferenceDal : GenericRepository<Reference>, IReferenceDal
{
private readonly ConstructorContext context;
public EfReferenceDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.References.Count();
}
}
}

View File

@@ -0,0 +1,30 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfServiceDal : GenericRepository<Service>, IServiceDal
{
private readonly ConstructorContext context;
public EfServiceDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public void ServiceStatusActive(int id)
{
var values = context.Services.Find(id);
values.IsActive = true;
context.SaveChanges();
}
public void ServiceStatusPassive(int id)
{
var values = context.Services.Find(id);
values.IsActive = false;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfSliderDal : GenericRepository<Slider>, ISliderDal
{
public EfSliderDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfTeamDal : GenericRepository<Team>, ITeamDal
{
public EfTeamDal(ConstructorContext context) : base(context)
{
}
}
}

View File

@@ -0,0 +1,35 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfTestimonialDal : GenericRepository<Testimonial>, ITestimonialDal
{
private readonly ConstructorContext context;
public EfTestimonialDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public int CountAll()
{
return context.Testimonials.Count(x => x.Status != TestimonialStatus.Cancelled);
}
public void TestimonialStatusActive(int id)
{
var values = context.Testimonials.Find(id);
values.Status = TestimonialStatus.Confirmed;
context.SaveChanges();
}
public void TestimonialStatusPassive(int id)
{
var values = context.Testimonials.Find(id);
values.Status = TestimonialStatus.Cancelled;
context.SaveChanges();
}
}
}

View File

@@ -0,0 +1,30 @@
using ConstructorApp.DataAccessLayer.Abstract;
using ConstructorApp.DataAccessLayer.Concrete;
using ConstructorApp.DataAccessLayer.Repositories;
using ConstructorApp.EntityLayer.Entities;
namespace ConstructorApp.DataAccessLayer.EntityFramework
{
public class EfWorkProcessDal : GenericRepository<WorkProcess>, IWorkProcessDal
{
private readonly ConstructorContext context;
public EfWorkProcessDal(ConstructorContext context) : base(context)
{
this.context = context;
}
public void ServiceStatusActive(int id)
{
var values = context.WorkProcess.Find(id);
values.IsActive = true;
context.SaveChanges();
}
public void ServiceStatusPassive(int id)
{
var values = context.WorkProcess.Find(id);
values.IsActive = false;
context.SaveChanges();
}
}
}