Esempio n. 1
0
 public int GetAll(ref List <RoleCoreEntity> objSangamCoreEntityList)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey);
         using (objIUnitOfWork as IDisposable)
         {
             foreach (Mugurtham.DTO.Role.Role objSangam in objIUnitOfWork.RepositoryRole.GetAll().ToList().OrderBy(x => x.Name))
             {
                 Mugurtham.DTO.Role.Role _objSangam = objSangam;
                 using (_objSangam as IDisposable)
                 {
                     RoleCoreEntity objRoleCoreEntity = new RoleCoreEntity();
                     using (objRoleCoreEntity as IDisposable)
                     {
                         AssignEntityFromDTO(ref _objSangam, ref objRoleCoreEntity);
                         objSangamCoreEntityList.Add(objRoleCoreEntity);
                     }
                     objRoleCoreEntity = null;
                 }
                 _objSangam = null;
             }
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return(0);
 }
Esempio n. 2
0
        public RoleCoreEntity GetByID(string strID)
        {
            RoleCoreEntity objRoleCoreEntity = new RoleCoreEntity();

            try
            {
                Mugurtham.DTO.Role.Role objSangam = new Mugurtham.DTO.Role.Role();
                IUnitOfWork             objUOW    = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey);
                using (objUOW as IDisposable)
                    objSangam = objUOW.RepositoryRole.GetAll().ToList().Where(p => p.ID.Trim().ToLower() == strID.Trim().ToLower()).FirstOrDefault();
                objUOW = null;
                if (objSangam != null)
                {
                    using (objSangam as IDisposable)
                    {
                        AssignEntityFromDTO(ref objSangam, ref objRoleCoreEntity);
                    }
                }
                objSangam = null;
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return(objRoleCoreEntity);
        }
Esempio n. 3
0
 public int GetAll(ref List<RoleCoreEntity> objSangamCoreEntityList)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             foreach (Mugurtham.DTO.Role.Role objSangam in objIUnitOfWork.RepositoryRole.GetAll().ToList().OrderBy(x => x.Name))
             {
                 Mugurtham.DTO.Role.Role _objSangam = objSangam;
                 using (_objSangam as IDisposable)
                 {
                     RoleCoreEntity objRoleCoreEntity = new RoleCoreEntity();
                     using (objRoleCoreEntity as IDisposable)
                     {
                         AssignEntityFromDTO(ref _objSangam, ref objRoleCoreEntity);
                         objSangamCoreEntityList.Add(objRoleCoreEntity);
                     }
                     objRoleCoreEntity = null;
                 }
                 _objSangam = null;
             }
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Esempio n. 4
0
 public RoleCoreEntity GetByID(string strID)
 {
     RoleCoreEntity objRoleCoreEntity = new RoleCoreEntity();
     try
     {
         Mugurtham.DTO.Role.Role objSangam = new Mugurtham.DTO.Role.Role();
         IUnitOfWork objUOW = new UnitOfWork();
         using (objUOW as IDisposable)
             objSangam = objUOW.RepositoryRole.GetAll().ToList().Where(p => p.ID.Trim().ToLower() == strID.Trim().ToLower()).FirstOrDefault();
         objUOW = null;
         if (objSangam != null)
         {
             using (objSangam as IDisposable)
             {
                 AssignEntityFromDTO(ref objSangam, ref objRoleCoreEntity);
             }
         }
         objSangam = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return objRoleCoreEntity;
 }