示例#1
0
        public RaasiCoreEntity GetByProfileID(string strProfileID)
        {
            RaasiCoreEntity objRaasiCoreEntity = new RaasiCoreEntity();

            try
            {
                Mugurtham.DTO.Profile.Raasi objRaasi = new Mugurtham.DTO.Profile.Raasi();
                IUnitOfWork objUOW = new UnitOfWork(_objLoggedInUser.ConnectionStringAppKey);
                using (objUOW as IDisposable)
                    objRaasi = objUOW.RepositoryRaasi.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault();
                objUOW = null;
                if (objRaasi != null)
                {
                    using (objRaasi as IDisposable)
                    {
                        AssignEntityFromDTO(ref objRaasi, ref objRaasiCoreEntity);
                    }
                }
                objRaasi = null;
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return(objRaasiCoreEntity);
        }
示例#2
0
 public RaasiCoreEntity GetByProfileID(string strProfileID)
 {
     RaasiCoreEntity objRaasiCoreEntity = new RaasiCoreEntity();
     try
     {
         Mugurtham.DTO.Profile.Raasi objRaasi = new Mugurtham.DTO.Profile.Raasi();
         IUnitOfWork objUOW = new UnitOfWork();
         using (objUOW as IDisposable)
             objRaasi = objUOW.RepositoryRaasi.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault();
         objUOW = null;
         if (objRaasi != null)
         {
             using (objRaasi as IDisposable)
             {
                 AssignEntityFromDTO(ref objRaasi, ref objRaasiCoreEntity);
             }
         }
         objRaasi = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return objRaasiCoreEntity;
 }
示例#3
0
        public int Edit(ref HoroscopeCoreEntity objHoroscopeCoreEntity)
        {
            try
            {
                IUnitOfWork objIUnitOfWork = new UnitOfWork();
                using (objIUnitOfWork as IDisposable)
                {
                    // Save Data to Raasi
                    RaasiCoreEntity objRaasiCoreEntity = new RaasiCoreEntity();
                    using (objRaasiCoreEntity as IDisposable)
                    {
                        objRaasiCoreEntity.ProfileID = objHoroscopeCoreEntity.ProfileID;
                        objRaasiCoreEntity.Kattam1 = objHoroscopeCoreEntity.RaasiKattam1;
                        objRaasiCoreEntity.Kattam2 = objHoroscopeCoreEntity.RaasiKattam2;
                        objRaasiCoreEntity.Kattam3 = objHoroscopeCoreEntity.RaasiKattam3;
                        objRaasiCoreEntity.Kattam4 = objHoroscopeCoreEntity.RaasiKattam4;
                        objRaasiCoreEntity.Kattam5 = objHoroscopeCoreEntity.RaasiKattam5;
                        objRaasiCoreEntity.Kattam6 = objHoroscopeCoreEntity.RaasiKattam6;
                        objRaasiCoreEntity.Kattam7 = objHoroscopeCoreEntity.RaasiKattam7;
                        objRaasiCoreEntity.Kattam8 = objHoroscopeCoreEntity.RaasiKattam8;
                        objRaasiCoreEntity.Kattam9 = objHoroscopeCoreEntity.RaasiKattam9;
                        objRaasiCoreEntity.Kattam10 = objHoroscopeCoreEntity.RaasiKattam10;
                        objRaasiCoreEntity.Kattam11 = objHoroscopeCoreEntity.RaasiKattam11;
                        objRaasiCoreEntity.Kattam12 = objHoroscopeCoreEntity.RaasiKattam12;
                        Mugurtham.DTO.Profile.Raasi objDTORaasi = new DTO.Profile.Raasi();
                        using (objDTORaasi as IDisposable)
                        {
                            RaasiCore objRaasiCore = new RaasiCore();
                            using (objRaasiCore as IDisposable)
                                objRaasiCore.AssignDTOFromEntity(ref objDTORaasi, ref objRaasiCoreEntity);
                            objRaasiCore = null;
                        }
                        objIUnitOfWork.RepositoryRaasi.Edit(objDTORaasi);
                        objDTORaasi = null;
                    }
                    objRaasiCoreEntity = null;
                    // Save data to Amsam
                    AmsamCoreEntity objAmsamCoreEntity = new AmsamCoreEntity();
                    using (objAmsamCoreEntity as IDisposable)
                    {
                        objAmsamCoreEntity.ProfileID = objHoroscopeCoreEntity.ProfileID;
                        objAmsamCoreEntity.Kattam1 = objHoroscopeCoreEntity.AmsamKattam1;
                        objAmsamCoreEntity.Kattam2 = objHoroscopeCoreEntity.AmsamKattam2;
                        objAmsamCoreEntity.Kattam3 = objHoroscopeCoreEntity.AmsamKattam3;
                        objAmsamCoreEntity.Kattam4 = objHoroscopeCoreEntity.AmsamKattam4;
                        objAmsamCoreEntity.Kattam5 = objHoroscopeCoreEntity.AmsamKattam5;
                        objAmsamCoreEntity.Kattam6 = objHoroscopeCoreEntity.AmsamKattam6;
                        objAmsamCoreEntity.Kattam7 = objHoroscopeCoreEntity.AmsamKattam7;
                        objAmsamCoreEntity.Kattam8 = objHoroscopeCoreEntity.AmsamKattam8;
                        objAmsamCoreEntity.Kattam9 = objHoroscopeCoreEntity.AmsamKattam9;
                        objAmsamCoreEntity.Kattam10 = objHoroscopeCoreEntity.AmsamKattam10;
                        objAmsamCoreEntity.Kattam11 = objHoroscopeCoreEntity.AmsamKattam11;
                        objAmsamCoreEntity.Kattam12 = objHoroscopeCoreEntity.AmsamKattam12;
                        Mugurtham.DTO.Profile.Amsam objDTOAmsam = new DTO.Profile.Amsam();
                        using (objDTOAmsam as IDisposable)
                        {
                            AmsamCore objAmsamCore = new AmsamCore();
                            using (objAmsamCore as IDisposable)
                                objAmsamCore.AssignDTOFromEntity(ref objDTOAmsam, ref objAmsamCoreEntity);
                            objAmsamCore = null;
                        }
                        objIUnitOfWork.RepositoryAmsam.Edit(objDTOAmsam);
                        objDTOAmsam = null;
                    }
                    objAmsamCoreEntity = null;
                    objHoroscopeCoreEntity.Path = GetByProfileID(objHoroscopeCoreEntity.ProfileID).Path;
                    updateHoroscope(ref objHoroscopeCoreEntity);
                    objIUnitOfWork.commit();
                    objIUnitOfWork = null;

                }
                objHoroscopeCoreEntity = null;

            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return 0;
        }
示例#4
0
        public HoroscopeCoreEntity GetByProfileID(string strProfileID)
        {
            HoroscopeCoreEntity objHoroscopeCoreEntity = new HoroscopeCoreEntity();
            Mugurtham.DTO.Profile.Raasi objRaasi = new Mugurtham.DTO.Profile.Raasi();
            Mugurtham.DTO.Profile.Amsam objAmsam = new Mugurtham.DTO.Profile.Amsam();
            Mugurtham.DTO.Profile.Horoscope objHoroscope = new Mugurtham.DTO.Profile.Horoscope();
            try
            {

                IUnitOfWork objUOW = new UnitOfWork();
                using (objUOW as IDisposable)
                {
                    objRaasi = objUOW.RepositoryRaasi.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault();
                    objAmsam = objUOW.RepositoryAmsam.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault();
                    objHoroscope = objUOW.RepositoryHoroscope.GetAll().ToList().Where(p => p.ProfileID.Trim().ToLower() == strProfileID.Trim().ToLower()).FirstOrDefault();
                }
                objUOW = null;
                //Getting Raasi Data
                if (objRaasi != null)
                {
                    using (objRaasi as IDisposable)
                    {
                        RaasiCoreEntity objRaasiCoreEntity = new RaasiCoreEntity();
                        using (objRaasiCoreEntity as IDisposable)
                        {
                            RaasiCore objRaasiCore = new RaasiCore();
                            using (objRaasiCore as IDisposable)
                                objRaasiCore.AssignEntityFromDTO(ref objRaasi, ref objRaasiCoreEntity);
                            objRaasiCore = null;
                        }
                        objHoroscopeCoreEntity.ProfileID = objRaasiCoreEntity.ProfileID;
                        objHoroscopeCoreEntity.RaasiKattam1 = objRaasiCoreEntity.Kattam1;
                        objHoroscopeCoreEntity.RaasiKattam2 = objRaasiCoreEntity.Kattam2;
                        objHoroscopeCoreEntity.RaasiKattam3 = objRaasiCoreEntity.Kattam3;
                        objHoroscopeCoreEntity.RaasiKattam4 = objRaasiCoreEntity.Kattam4;
                        objHoroscopeCoreEntity.RaasiKattam5 = objRaasiCoreEntity.Kattam5;
                        objHoroscopeCoreEntity.RaasiKattam6 = objRaasiCoreEntity.Kattam6;
                        objHoroscopeCoreEntity.RaasiKattam7 = objRaasiCoreEntity.Kattam7;
                        objHoroscopeCoreEntity.RaasiKattam8 = objRaasiCoreEntity.Kattam8;
                        objHoroscopeCoreEntity.RaasiKattam9 = objRaasiCoreEntity.Kattam9;
                        objHoroscopeCoreEntity.RaasiKattam10 = objRaasiCoreEntity.Kattam10;
                        objHoroscopeCoreEntity.RaasiKattam11 = objRaasiCoreEntity.Kattam11;
                        objHoroscopeCoreEntity.RaasiKattam12 = objRaasiCoreEntity.Kattam12;
                        objRaasiCoreEntity = null;
                    }
                }
                objRaasi = null;
                // Getting Amsam Data
                if (objAmsam != null)
                {
                    using (objAmsam as IDisposable)
                    {
                        AmsamCoreEntity objAmsamCoreEntity = new AmsamCoreEntity();
                        using (objAmsamCoreEntity as IDisposable)
                        {
                            AmsamCore objAmsamCore = new AmsamCore();
                            using (objAmsamCore as IDisposable)
                                objAmsamCore.AssignEntityFromDTO(ref objAmsam, ref objAmsamCoreEntity);
                            objAmsamCore = null;
                        }
                        objHoroscopeCoreEntity.ProfileID = objAmsamCoreEntity.ProfileID;
                        objHoroscopeCoreEntity.AmsamKattam1 = objAmsamCoreEntity.Kattam1;
                        objHoroscopeCoreEntity.AmsamKattam2 = objAmsamCoreEntity.Kattam2;
                        objHoroscopeCoreEntity.AmsamKattam3 = objAmsamCoreEntity.Kattam3;
                        objHoroscopeCoreEntity.AmsamKattam4 = objAmsamCoreEntity.Kattam4;
                        objHoroscopeCoreEntity.AmsamKattam5 = objAmsamCoreEntity.Kattam5;
                        objHoroscopeCoreEntity.AmsamKattam6 = objAmsamCoreEntity.Kattam6;
                        objHoroscopeCoreEntity.AmsamKattam7 = objAmsamCoreEntity.Kattam7;
                        objHoroscopeCoreEntity.AmsamKattam8 = objAmsamCoreEntity.Kattam8;
                        objHoroscopeCoreEntity.AmsamKattam9 = objAmsamCoreEntity.Kattam9;
                        objHoroscopeCoreEntity.AmsamKattam10 = objAmsamCoreEntity.Kattam10;
                        objHoroscopeCoreEntity.AmsamKattam11 = objAmsamCoreEntity.Kattam11;
                        objHoroscopeCoreEntity.AmsamKattam12 = objAmsamCoreEntity.Kattam12;
                        objAmsamCoreEntity = null;
                    }
                }
                objAmsam = null;

                objHoroscopeCoreEntity.DasaBalance = objHoroscope.DasaBalance;
                objHoroscopeCoreEntity.Year = objHoroscope.Year;
                objHoroscopeCoreEntity.Month = objHoroscope.Month;
                objHoroscopeCoreEntity.Day = objHoroscope.Day;
                objHoroscopeCoreEntity.Path = objHoroscope.Path;

            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            finally
            {
                /*objHoroscopeCoreEntity = null;
                objRaasi = null;
                objAmsam = null;
                objHoroscope = null;*/
            }
            return objHoroscopeCoreEntity;
        }
示例#5
0
        /// <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;
        }