public int SaveAffidavitDetails(AffidavitDetailsDTO affidavitdetail) { affidavitdetail affidavitdetailEntity = new affidavitdetail(); using (TransactionScope transactionScope = new TransactionScope()) { AutoMapper.Mapper.Map(affidavitdetail, affidavitdetailEntity); if (affidavitdetail.AffidavitDetailsId == 0) { ESalesUnityContainer.Container.Resolve<IGenericRepository<affidavitdetail>>().Save(affidavitdetailEntity); } transactionScope.Complete(); } return affidavitdetailEntity.AffidavitDetailsId; }
public int UpdateAffidavitDetails(AffidavitDetailsDTO AffidavitDetails) { affidavitdetail affidavitDetailsEntity = new affidavitdetail(); int affidavitDetailsId; using (TransactionScope transactionScope = new TransactionScope()) { AutoMapper.Mapper.Map(AffidavitDetails, affidavitDetailsEntity); ESalesUnityContainer.Container.Resolve<IGenericRepository<affidavitdetail>>().Update(affidavitDetailsEntity); affidavitDetailsId = AffidavitDetails.AffidavitDetailsId; transactionScope.Complete(); } return affidavitDetailsId; }