예제 #1
0
        public UserCoreEntity GetByID(string strID)
        {
            UserCoreEntity objUserCoreEntity = new UserCoreEntity();

            try
            {
                Mugurtham.DTO.User.User objUser = new Mugurtham.DTO.User.User();
                IUnitOfWork             objUOW  = new UnitOfWork(_ConnectionStringAppKey);
                using (objUOW as IDisposable)
                    objUser = objUOW.RepositoryUser.GetAll().ToList().Where(p => p.ID.Trim().ToLower() == strID.Trim().ToLower()).FirstOrDefault();
                objUOW = null;
                if (objUser != null)
                {
                    using (objUser as IDisposable)
                    {
                        AssignEntityFromDTO(ref objUser, ref objUserCoreEntity);
                    }
                }
                objUser = null;
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return(objUserCoreEntity);
        }
예제 #2
0
 public int assignHomePagePath(ref UserCoreEntity objUserCoreEntity)
 {
     try
     {
         if (objUserCoreEntity.RoleID == Constants.RoleIDForMugurthamAdmin)
         {
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForMugurthamAdmin;
         }
         else if (objUserCoreEntity.RoleID == Constants.RoleIDForSangamAdmin)
         {
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForSangamAdmin;
         }
         else if (objUserCoreEntity.RoleID == Constants.RoleIDForUserProfile)
         {
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForProfileUser;
         }
         else if (objUserCoreEntity.RoleID == Constants.RoleIDForUserPublic)
         {
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForPublicUser;
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return(0);
 }
예제 #3
0
 public int assignHomePagePath(ref UserCoreEntity objUserCoreEntity)
 {
     try
     {
         if (objUserCoreEntity.RoleID == Constants.RoleIDForMugurthamAdmin)
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForMugurthamAdmin;
         else if (objUserCoreEntity.RoleID == Constants.RoleIDForSangamAdmin)
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForSangamAdmin;
         else if (objUserCoreEntity.RoleID == Constants.RoleIDForUserProfile)
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForProfileUser;
         else if (objUserCoreEntity.RoleID == Constants.RoleIDForUserPublic)
             objUserCoreEntity.HomePagePath = Constants.HomePagePathForPublicUser;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
예제 #4
0
        public int GetAll(ref List <UserCoreEntity> objUserCoreEntityList)
        {
            IUnitOfWork objIUnitOfWork = new UnitOfWork(_ConnectionStringAppKey);

            try
            {
                using (objIUnitOfWork as IDisposable)
                {
                    foreach (Mugurtham.DTO.User.User objSangam in objIUnitOfWork.RepositoryUser.GetAll().ToList())
                    {
                        Mugurtham.DTO.User.User _objSangam = objSangam;
                        using (_objSangam as IDisposable)
                        {
                            UserCoreEntity objUserCoreEntity = new UserCoreEntity();
                            using (objUserCoreEntity as IDisposable)
                            {
                                AssignEntityFromDTO(ref _objSangam, ref objUserCoreEntity);
                                Sangam.SangamCore objSangamCore = new Sangam.SangamCore(_ConnectionStringAppKey);
                                using (objSangamCore as IDisposable)
                                {
                                    Sangam.SangamCoreEntity objSangamCoreEntity = new Sangam.SangamCoreEntity();
                                    using (objSangamCoreEntity as IDisposable)
                                    {
                                        objSangamCoreEntity          = objSangamCore.GetByID(objUserCoreEntity.SangamID);
                                        objUserCoreEntity.SangamName = objSangamCoreEntity.Name;
                                    }
                                    objSangamCoreEntity = null;
                                }
                                objSangamCore = null;
                                objUserCoreEntityList.Add(objUserCoreEntity);
                            }
                            objUserCoreEntity = null;
                        }
                        _objSangam = null;
                    }
                }
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return(0);
        }
예제 #5
0
 public UserCoreEntity GetByLoginID(string strID)
 {
     UserCoreEntity objUserCoreEntity = new UserCoreEntity();
     try
     {
         Mugurtham.DTO.User.User objSangam = new Mugurtham.DTO.User.User();
         IUnitOfWork objUOW = new UnitOfWork();
         using (objUOW as IDisposable)
             objSangam = objUOW.RepositoryUser.GetAll().ToList().Where(p => p.LoginID.Trim().ToLower() == strID.Trim().ToLower()).FirstOrDefault();
         objUOW = null;
         if (objSangam != null)
         {
             using (objSangam as IDisposable)
             {
                 AssignEntityFromDTO(ref objSangam, ref objUserCoreEntity);
             }
         }
         objSangam = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return objUserCoreEntity;
 }
예제 #6
0
 public int GetAllSangamUsers(ref List<UserCoreEntity> objUserCoreEntityList, string strSangamID)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             foreach (Mugurtham.DTO.User.User objSangam in objIUnitOfWork.RepositoryUser.GetAll().Where(p => p.SangamID == strSangamID).ToList())
             {
                 Mugurtham.DTO.User.User _objSangam = objSangam;
                 using (_objSangam as IDisposable)
                 {
                     UserCoreEntity objUserCoreEntity = new UserCoreEntity();
                     using (objUserCoreEntity as IDisposable)
                     {
                         AssignEntityFromDTO(ref _objSangam, ref objUserCoreEntity);
                         Sangam.SangamCore objSangamCore = new Sangam.SangamCore();
                         using (objSangamCore as IDisposable)
                         {
                             Sangam.SangamCoreEntity objSangamCoreEntity = new Sangam.SangamCoreEntity();
                             using (objSangamCoreEntity as IDisposable)
                             {
                                 objSangamCoreEntity = objSangamCore.GetByID(objUserCoreEntity.SangamID);
                                 objUserCoreEntity.SangamName = objSangamCoreEntity.Name;
                             }
                             objSangamCoreEntity = null;
                         }
                         objSangamCore = null;
                         objUserCoreEntityList.Add(objUserCoreEntity);
                     }
                     objUserCoreEntity = null;
                 }
                 _objSangam = null;
             }
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
예제 #7
0
 private Mugurtham.Core.User.UserCoreEntity getUserEntity(string strProfileID)
 {
     Mugurtham.Core.User.UserCoreEntity objUserCoreEntity = null;
     try
     {
         Mugurtham.Core.User.UserCore objUserCore = new Mugurtham.Core.User.UserCore();
         using (objUserCore as IDisposable)
         {
             objUserCoreEntity = new Mugurtham.Core.User.UserCoreEntity();
             using (objUserCoreEntity as IDisposable)
             {
                 objUserCoreEntity = objUserCore.GetByLoginID(strProfileID);
             }
         }
         objUserCore = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return objUserCoreEntity;
 }