コード例 #1
0
 private int AssignEntityFromDTO(ref Mugurtham.DTO.User.User objDTOUser, ref Mugurtham.Core.User.UserCoreEntity objUserCoreEntity)
 {
     try
     {
         objUserCoreEntity.CreatedBy     = objDTOUser.CreatedBy;
         objUserCoreEntity.CreatedDate   = DateTime.Now;
         objUserCoreEntity.ID            = objDTOUser.ID;
         objUserCoreEntity.LoginID       = objDTOUser.LoginID;
         objUserCoreEntity.Password      = objDTOUser.Password;
         objUserCoreEntity.IsActivated   = objDTOUser.IsActivated;
         objUserCoreEntity.LocaleID      = objDTOUser.LocaleID;
         objUserCoreEntity.ModifiedBy    = objDTOUser.ModifiedBy;
         objUserCoreEntity.ModifiedDate  = DateTime.Now;
         objUserCoreEntity.Name          = objDTOUser.Name;
         objUserCoreEntity.RoleID        = objDTOUser.RoleID;
         objUserCoreEntity.SangamID      = objDTOUser.SangamID;
         objUserCoreEntity.ThemeID       = objDTOUser.ThemeID;
         objUserCoreEntity.HomePagePath  = objDTOUser.HomePagePath;
         objUserCoreEntity.IsHighlighted = objDTOUser.IsHighlighted;
         objUserCoreEntity.ShowHoroscope = objDTOUser.ShowHoroscope;
         objUserCoreEntity.IsMarried     = objDTOUser.IsMarried;
         objUserCoreEntity.PaymentDate   = objDTOUser.PaymentDate;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return(0);
 }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: UserCore.cs プロジェクト: AnandJS/Mugurtham
 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;
 }