コード例 #1
0
ファイル: SangamCore.cs プロジェクト: vijaydairyf/Mugurtham
 public int GetAllWithoutRestrictions(ref List <SangamCoreEntity> objSangamCoreEntityList)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork(_ConnectionStringAppKey);
         using (objIUnitOfWork as IDisposable)
         {
             foreach (Mugurtham.DTO.Sangam.Sangam objSangam in objIUnitOfWork.RepositorySangam.GetAll().ToList())
             {
                 Mugurtham.DTO.Sangam.Sangam _objSangam = objSangam;
                 using (_objSangam as IDisposable)
                 {
                     SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity();
                     using (objSangamCoreEntity as IDisposable)
                     {
                         AssignEntityFromDTO(ref _objSangam, ref objSangamCoreEntity);
                         objSangamCoreEntityList.Add(objSangamCoreEntity);
                     }
                     objSangamCoreEntity = null;
                 }
                 _objSangam = null;
             }
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return(0);
 }
コード例 #2
0
ファイル: SangamCore.cs プロジェクト: vijaydairyf/Mugurtham
        public SangamCoreEntity GetByID(string strID)
        {
            SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity();

            try
            {
                Mugurtham.DTO.Sangam.Sangam objSangam = new Mugurtham.DTO.Sangam.Sangam();
                IUnitOfWork objUOW = new UnitOfWork(_ConnectionStringAppKey);
                using (objUOW as IDisposable)
                    objSangam = objUOW.RepositorySangam.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 objSangamCoreEntity);
                    }
                }
                objSangam = null;
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return(objSangamCoreEntity);
        }
コード例 #3
0
ファイル: SangamCore.cs プロジェクト: AnandJS/Mugurtham
 public int GetAll(ref List<SangamCoreEntity> objSangamCoreEntityList)
 {
     try
     {
         IUnitOfWork objIUnitOfWork = new UnitOfWork();
         using (objIUnitOfWork as IDisposable)
         {
             foreach (Mugurtham.DTO.Sangam.Sangam objSangam in objIUnitOfWork.RepositorySangam.GetAll().Where(p => p.IsActivated == "1").ToList().OrderBy(x => x.Name))
             {
                 Mugurtham.DTO.Sangam.Sangam _objSangam = objSangam;
                 using (_objSangam as IDisposable)
                 {
                     SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity();
                     using (objSangamCoreEntity as IDisposable)
                     {
                         AssignEntityFromDTO(ref _objSangam, ref objSangamCoreEntity);
                         objSangamCoreEntityList.Add(objSangamCoreEntity);
                     }
                     objSangamCoreEntity = null;
                 }
                 _objSangam = null;
             }
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
コード例 #4
0
ファイル: SangamCore.cs プロジェクト: vijaydairyf/Mugurtham
 public int GetNewProfileID(out string strNewProfileID, string sangamID, ref SangamCoreEntity objSangamCoreEntity)
 {
     strNewProfileID = string.Empty;
     try
     {
         if (!string.IsNullOrWhiteSpace(sangamID))
         {
             objSangamCoreEntity = GetByID(sangamID);
             strNewProfileID     = objSangamCoreEntity.ProfileIDStartsWith + (objSangamCoreEntity.LastProfileIDNo + 1).ToString();
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return(0);
 }
コード例 #5
0
ファイル: SangamCore.cs プロジェクト: AnandJS/Mugurtham
 public int GetNewProfileID(out string strNewProfileID, Mugurtham.Core.Login.LoggedInUser objLoggedIn)
 {
     strNewProfileID = string.Empty;
     try
     {
         if (!string.IsNullOrWhiteSpace(objLoggedIn.sangamID))
         {
             SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity();
             using (objSangamCoreEntity as IDisposable)
             {
                 objSangamCoreEntity = GetByID(objLoggedIn.sangamID);
                 strNewProfileID = objSangamCoreEntity.ProfileIDStartsWith + (objSangamCoreEntity.LastProfileIDNo + 1).ToString();
             }
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
コード例 #6
0
ファイル: SangamCore.cs プロジェクト: AnandJS/Mugurtham
 public SangamCoreEntity GetByID(string strID)
 {
     SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity();
     try
     {
         Mugurtham.DTO.Sangam.Sangam objSangam = new Mugurtham.DTO.Sangam.Sangam();
         IUnitOfWork objUOW = new UnitOfWork();
         using (objUOW as IDisposable)
             objSangam = objUOW.RepositorySangam.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 objSangamCoreEntity);
             }
         }
         objSangam = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return objSangamCoreEntity;
 }
コード例 #7
0
ファイル: ProfileCore.cs プロジェクト: AnandJS/Mugurtham
        /// <summary>
        /// Creates a new row in all profile registration table for the passed profileID
        /// </summary>
        /// <param name="strProfileID">New ProfileID to create in all registration tables</param>
        /// <returns></returns>
        public int Add(ref BasicInfoCoreEntity objBasicInfoCoreEntity, out string strProfileID, Mugurtham.Core.Login.LoggedInUser objLoggedIn)
        {
            strProfileID = string.Empty;
            string strUserID = string.Empty;
            SangamCore objSangamCore = new SangamCore();
            try
            {
                using (objSangamCore as IDisposable)
                {
                    objSangamCore.GetNewProfileID(out strProfileID, objLoggedIn);
                    Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity = new SangamCoreEntity();
                    using (objSangamCoreEntity as IDisposable)
                    {
                        objSangamCoreEntity = objSangamCore.GetByID(objLoggedIn.sangamID);
                        if (string.IsNullOrEmpty(objSangamCoreEntity.LastProfileIDNo.ToString()))
                            return -1;
                        objSangamCoreEntity.LastProfileIDNo += 1;
                        objSangamCore.Edit(ref objSangamCoreEntity);
                    }
                    objSangamCoreEntity = null;
                }
                objSangamCore = null;

                User.UserCore objUserCore = new User.UserCore();
                using (objUserCore as IDisposable)
                {
                    User.UserCoreEntity objUserCoreEntity = new User.UserCoreEntity();
                    using (objUserCoreEntity as IDisposable)
                    {
                        objUserCoreEntity.ID = Helpers.primaryKey;
                        objUserCoreEntity.Name = objBasicInfoCoreEntity.Name;
                        objUserCoreEntity.LoginID = strProfileID;
                        objUserCoreEntity.Password = strProfileID; // Helpers.passwordGenerator();
                        objUserCoreEntity.SangamID = objLoggedIn.sangamID;
                        objUserCoreEntity.RoleID = Constants.RoleIDForUserProfile;
                        objUserCoreEntity.ThemeID = Constants.ThemeBootstrap;
                        objUserCoreEntity.LocaleID = Constants.LocaleUSEnglish;
                        objUserCoreEntity.IsActivated = "1"; // Activated by default
                        objUserCoreEntity.HomePagePath = Constants.HomePagePathForProfileUser;
                        objUserCore.Add(ref objUserCoreEntity, out strUserID);
                    }
                    objUserCoreEntity = null;
                }
                objUserCore = null;

                BasicInfoCore objBasicInfoCore = new BasicInfoCore();
                using (objBasicInfoCore as IDisposable)
                {
                    objBasicInfoCoreEntity.ProfileID = strProfileID;
                    objBasicInfoCoreEntity.ElanUserID = strUserID;
                    objBasicInfoCoreEntity.SangamID = objLoggedIn.sangamID;
                    objBasicInfoCore.Add(ref objBasicInfoCoreEntity, objLoggedIn.LoginID);
                }
                objBasicInfoCore = null;

                CareerCore objCareerCore = new CareerCore();
                using (objCareerCore as IDisposable)
                {
                    CareerCoreEntity objCareerCoreEntity = new CareerCoreEntity();
                    using (objCareerCoreEntity as IDisposable)
                    {
                        objCareerCoreEntity.ProfileID = strProfileID;
                        objCareerCore.Add(ref objCareerCoreEntity);
                    }
                    objCareerCoreEntity = null;
                }
                objCareerCore = null;

                ContactCore objContactCore = new ContactCore();
                using (objContactCore as IDisposable)
                {
                    ContactCoreEntity objContactCoreEntity = new ContactCoreEntity();
                    using (objContactCoreEntity as IDisposable)
                    {
                        objContactCoreEntity.ProfileID = strProfileID;
                        objContactCore.Add(ref objContactCoreEntity);
                    }
                    objContactCoreEntity = null;
                }
                objContactCore = null;

                FamilyCore objFamilyCore = new FamilyCore();
                using (objFamilyCore as IDisposable)
                {
                    FamilyCoreEntity objFamilyCoreEntity = new FamilyCoreEntity();
                    using (objFamilyCoreEntity as IDisposable)
                    {
                        objFamilyCoreEntity.ProfileID = strProfileID;
                        objFamilyCore.Add(ref objFamilyCoreEntity);
                    }
                    objFamilyCoreEntity = null;
                }
                objFamilyCore = null;

                LocationCore objLocationCore = new LocationCore();
                using (objLocationCore as IDisposable)
                {
                    LocationCoreEntity objLocationCoreEntity = new LocationCoreEntity();
                    using (objLocationCoreEntity as IDisposable)
                    {
                        objLocationCoreEntity.ProfileID = strProfileID;
                        objLocationCore.Add(ref objLocationCoreEntity);
                    }
                    objLocationCoreEntity = null;
                }
                objLocationCore = null;

                ReferenceCore objReferenceCore = new ReferenceCore();
                using (objReferenceCore as IDisposable)
                {
                    ReferenceCoreEntity objReferenceCoreEntity = new ReferenceCoreEntity();
                    using (objReferenceCoreEntity as IDisposable)
                    {
                        objReferenceCoreEntity.ProfileID = strProfileID;
                        objReferenceCore.Add(ref objReferenceCoreEntity);
                    }
                    objReferenceCoreEntity = null;
                }
                objReferenceCore = null;
                RaasiCore objRaasiCore = new RaasiCore();
                using (objRaasiCore as IDisposable)
                {
                    RaasiCoreEntity objRaasiCoreEntity = new RaasiCoreEntity();
                    using (objRaasiCoreEntity as IDisposable)
                    {
                        objRaasiCoreEntity.ProfileID = strProfileID;
                        objRaasiCore.Add(ref objRaasiCoreEntity);
                    }
                    objRaasiCoreEntity = null;
                }
                objRaasiCore = null;
                AmsamCore objAmsamCore = new AmsamCore();
                using (objAmsamCore as IDisposable)
                {
                    AmsamCoreEntity objAmsamCoreEntity = new AmsamCoreEntity();
                    using (objAmsamCoreEntity as IDisposable)
                    {
                        objAmsamCoreEntity.ProfileID = strProfileID;
                        objAmsamCore.Add(ref objAmsamCoreEntity);
                    }
                    objAmsamCoreEntity = null;
                }
                objAmsamCore = null;
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return 0;
        }