public void Add(CompProfileInfoDTO DTO) { using (var container = new InventoryContainer()) { InvenCompProfileInfo gur = new InvenCompProfileInfo(); container.InvenCompProfileInfoes.AddObject((InvenCompProfileInfo)DTOMapper.DTOObjectConverter(DTO, gur)); container.SaveChanges(); } }
public void Edit(CompProfileInfoDTO EduDTO) { using (var container = new InventoryContainer()) { var Comp = new InvenCompProfileInfo(); Comp = container.InvenCompProfileInfoes.FirstOrDefault(o => o.CompProId.Equals(EduDTO.CompProId)); Comp.CompAddress = EduDTO.CompAddress; Comp.CompDescription = EduDTO.CompDescription; Comp.CompEmail = EduDTO.CompEmail; Comp.CompMobile1 = EduDTO.CompMobile1; Comp.CompMobile2 = EduDTO.CompMobile2; Comp.CompPhone = EduDTO.CompPhone; Comp.CompProId = EduDTO.CompProId; Comp.CompProName = EduDTO.CompProName; Comp.CompWebsite = EduDTO.CompWebsite; Comp.UpdateBy = EduDTO.UpdateBy; Comp.UpdateDate = EduDTO.UpdateDate; Comp = (InvenCompProfileInfo)DTOMapper.DTOObjectConverter(EduDTO, Comp); container.SaveChanges(); } }