public WrapperBuildingSupplier CreateSingleBuildingSupplier(BuildingSupplierENT UserProfile) { WrapperBuildingSupplier data = new WrapperBuildingSupplier(); data.BuildingSupplier = new BuildingSupplierCRUD().CreateSingle(UserProfile); return(data); }
public BuildingSupplierENT SelectSingle(int Id) { NbkDbEntities dbcontext = new NbkDbEntities(); BuildingSupplierTemplate Obj = dbcontext.BuildingSupplierTemplate.Where(x => x.Id == Id).FirstOrDefault(); BuildingSupplierENT Data = new BuildingSupplierENT() { Id = Obj.Id, Title = Obj.Title }; return(Data); }
public BuildingSupplierENT CreateSingle(BuildingSupplierENT Obj) { NbkDbEntities dbcontext = new NbkDbEntities(); BuildingSupplierTemplate Data = new BuildingSupplierTemplate() { Title = Obj.Title }; dbcontext.BuildingSupplierTemplate.Add(Data); dbcontext.SaveChanges(); Obj.Id = Data.Id; return(Obj); }
public BuildingSupplierENT UpdateSelectSingle(BuildingSupplierENT Obj) { NbkDbEntities dbcontext = new NbkDbEntities(); BuildingSupplierTemplate Data = new BuildingSupplierTemplate() { Id = Obj.Id, Title = Obj.Title }; dbcontext.BuildingSupplierTemplate.Attach(Data); var update = dbcontext.Entry(Data); update.Property(x => x.Title).IsModified = true; dbcontext.SaveChanges(); return(Obj); }
public string EmailSubjectReplacements(EmailTemplateENT template, ProjectENT projectDetail, ContactENT customer, ContactENT contactPerson, BuildingSupplierENT buildingSupplier, Users user) { string content = ""; template.Title = template.Title.Replace("#CustomerName#", customer.Name); template.Title = template.Title.Replace("#Description#", projectDetail.Description); template.Title = template.Title.Replace("#Name#", user.FullName); template.Title = template.Title.Replace("#PhoneNumber#", user.ContactNo); template.Title = template.Title.Replace("#Email#", user.Email); template.Title = template.Title.Replace("#Designation#", user.Designation); if (contactPerson != null) { template.Title = template.Title.Replace("#ansvarlig#", contactPerson.Name); } else { template.Title = template.Title.Replace("#ansvarlig#", ""); } template.Title = template.Title.Replace("#Address#", projectDetail.Address); template.Title = template.Title.Replace("#ProjectTitle#", projectDetail.Title); template.Title = template.Title.Replace("#CustomerPhone#", customer.ContactNo); template.Title = template.Title.Replace("#BuildingSupplier#", buildingSupplier.Title); content = template.Title; return(content); }