public override void DeleteByID(object id) { var dac = new MQUESTSYSDAC(); using (TransactionScope trans = new TransactionScope()) { base.DeleteByID(id); dac.DeleteRoleDetails(Convert.ToInt32(id)); trans.Complete(); } }
public void Create(RoleModel role, List <RoleDetailModel> roleDetails, string userName) { var dac = new MQUESTSYSDAC(); role.CreatedBy = role.ModifiedBy = userName; role.CreatedDate = role.ModifiedDate = DateTime.Now; using (TransactionScope trans = new TransactionScope()) { dac.CreateRole(role); dac.CreateRoleDetails(role.ID, role.Details); trans.Complete(); } }
public void Update(RoleModel role, List <RoleDetailModel> roleDetails, string userName) { var dac = new MQUESTSYSDAC(); var extObj = RetrieveByID(role.ID); extObj.Name = role.Name; extObj.IsActive = role.IsActive; extObj.ModifiedBy = userName; extObj.ModifiedDate = DateTime.Now; using (TransactionScope trans = new TransactionScope()) { GetDAC().Update(extObj); dac.DeleteRoleDetails(role.ID); dac.CreateRoleDetails(role.ID, role.Details); trans.Complete(); } }