public int Add(ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity, out string strRoleID) { strRoleID = Helpers.primaryKey; try { IUnitOfWork objIUnitOfWork = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.Role.Role objDTORole = new DTO.Role.Role(); using (objDTORole as IDisposable) { objRoleCoreEntity.ID = strRoleID; AssignDTOFromEntity(ref objDTORole, ref objRoleCoreEntity); } objIUnitOfWork.RepositoryRole.Add(objDTORole); objDTORole = null; } objIUnitOfWork.commit(); objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return(0); }
public int Add(ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity, out string strRoleID) { strRoleID = Helpers.primaryKey; try { IUnitOfWork objIUnitOfWork = new UnitOfWork(); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.Role.Role objDTORole = new DTO.Role.Role(); using (objDTORole as IDisposable) { objRoleCoreEntity.ID = strRoleID; AssignDTOFromEntity(ref objDTORole, ref objRoleCoreEntity); } objIUnitOfWork.RepositoryRole.Add(objDTORole); objDTORole = null; } objIUnitOfWork.commit(); objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return 0; }
public int Edit(ref Mugurtham.Core.Role.RoleCoreEntity objRoleCoreEntity) { try { IUnitOfWork objIUnitOfWork = new UnitOfWork(); using (objIUnitOfWork as IDisposable) { Mugurtham.DTO.Role.Role objDTORole = new DTO.Role.Role(); using (objDTORole as IDisposable) { AssignDTOFromEntity(ref objDTORole, ref objRoleCoreEntity); } objIUnitOfWork.RepositoryRole.Edit(objDTORole); objDTORole = null; } objIUnitOfWork.commit(); objIUnitOfWork = null; } catch (Exception objEx) { Helpers.LogExceptionInFlatFile(objEx); } return 0; }