public void Add(IncomeStatementRptDTO DTO) { using (var container = new InventoryContainer()) { AccIncomeStatementRpt gur = new AccIncomeStatementRpt(); container.AccIncomeStatementRpts.AddObject((AccIncomeStatementRpt)DTOMapper.DTOObjectConverter(DTO, gur)); container.SaveChanges(); } }
public void Edit(IncomeStatementRptDTO DTO) { using (var container = new InventoryContainer()) { var Comp = new AccIncomeStatementRpt(); Comp = container.AccIncomeStatementRpts.FirstOrDefault(o => o.InStaRptId.Equals(DTO.InStaRptId)); Comp.InStaRptId = DTO.InStaRptId; Comp.MainHeadId = DTO.MainHeadId; Comp.SubCode1Id = DTO.SubCode1Id; Comp.UpdateDate = DTO.UpdateDate; Comp.Priority = DTO.Priority; Comp.ActiveStatus = DTO.ActiveStatus; Comp.UpdateBy = DTO.UpdateBy; Comp = (AccIncomeStatementRpt)DTOMapper.DTOObjectConverter(DTO, Comp); container.SaveChanges(); } }