public void Put([FromBody]BasicInfoCoreEntity objBasicInfoCoreEntity)
        {
            string strLoggedInUserID = string.Empty;
            IEnumerable<string> headerValues = Request.Headers.GetValues("MugurthamUserToken");
            strLoggedInUserID = headerValues.FirstOrDefault();

            BasicInfoCore objBasicInfoCore = new BasicInfoCore();
            using (objBasicInfoCore as IDisposable)
                objBasicInfoCore.Edit(ref objBasicInfoCoreEntity);
            objBasicInfoCore = null;
        }
Exemple #2
0
 public int GetAll(ref List<ProfileCore> objProfileCoreList, string strGender, string strSangamID)
 {
     try
     {
         BasicInfoCore objBasicInfoCore = new BasicInfoCore();
         using (objBasicInfoCore as IDisposable)
         {
             List<BasicInfoCoreEntity> objBasicInfoCoreEntityList = new List<BasicInfoCoreEntity>();
             IUnitOfWork objIUnitOfWork = new UnitOfWork();
             using (objIUnitOfWork as IDisposable)
             {
                 if ((objIUnitOfWork.RepositoryBasicInfo.getAllProfiles(strGender, strSangamID) != null) &&
                     (objIUnitOfWork.RepositoryBasicInfo.getAllProfiles(strGender, strSangamID).Count > 0))
                 {
                     List<Mugurtham.DTO.Profile.BasicInfo> objListBasicInfo = new List<Mugurtham.DTO.Profile.BasicInfo>();
                     objListBasicInfo = objIUnitOfWork.RepositoryBasicInfo.getAllProfiles(strGender, strSangamID);
                     if (objListBasicInfo != null && objListBasicInfo.Count > 0)
                     {
                         foreach (Mugurtham.DTO.Profile.BasicInfo objBasicInfo in objListBasicInfo)
                         {
                             using (objBasicInfo as IDisposable)
                             {
                                 BasicInfoCoreEntity objBasicInfoCoreEntity = new BasicInfoCoreEntity();
                                 using (objBasicInfoCoreEntity as IDisposable)
                                 {
                                     objBasicInfoCore.AssignEntityFromDTO(objBasicInfoCoreEntity, objBasicInfo);
                                     objBasicInfoCoreEntityList.Add(objBasicInfoCoreEntity);
                                 }
                                 objBasicInfoCoreEntity = null;
                             }
                         }
                     }
                 }
             }
             objIUnitOfWork = null;
             foreach (BasicInfoCoreEntity objBasicInfoCoreEntity in objBasicInfoCoreEntityList)
             {
                 ProfileCore objProfileCore = null;
                 GetByProfileID(objBasicInfoCoreEntity.ProfileID, out objProfileCore);
                 objProfileCoreList.Add(objProfileCore);
                 using (objProfileCore as IDisposable) { }
                 objProfileCore = null;
             }
         }
         objBasicInfoCore = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Exemple #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="strProfileID"></param>
        /// <param name="objProfileCore"></param>
        /// <param name="objLoggedIn"></param>
        /// <param name="boolAddAllEntities">Optional argument to add all profile entities to the prfoilecore object -- added to consider performance optimization</param>
        /// <returns></returns>
        public int GetByProfileID(string strProfileID, out ProfileCore objProfileCore, Mugurtham.Core.Login.LoggedInUser objLoggedIn = null, bool boolAddAllEntities = false)
        {
            objProfileCore = null;
            try
            {
                objProfileCore = new ProfileCore();
                if (string.IsNullOrWhiteSpace(strProfileID))
                    return -1;
                //Adding all entities to Profile object
                using (objProfileCore as IDisposable)
                {
                    // Assign the user object for this profileID
                    objProfileCore.UserCoreEntity = getUserEntity(strProfileID);
                    validateUserAccessToThisProfile(strProfileID, ref objProfileCore, objLoggedIn);
                    if (objProfileCore.validateFullViewAccess)
                    {
                        BasicInfoCore objBICore = new BasicInfoCore();
                        using (objBICore as IDisposable)
                        {
                            //Check profile restrictions
                            // if allowed then process the rest of the code
                            // else return error code
                            IUnitOfWork objIUnitOfWork = new UnitOfWork();
                            using (objIUnitOfWork as IDisposable)
                            {
                                BasicInfoCoreEntity objBasicInfoCoreEntity = new BasicInfo.BasicInfoCoreEntity();
                                using (objBasicInfoCoreEntity as IDisposable)
                                {
                                    if (objIUnitOfWork.RepositoryBasicInfo.getByProfileID(strProfileID) != null)
                                    {
                                        objProfileCore.BasicInfoCoreEntity = objBasicInfoCoreEntity;
                                        objBICore.AssignEntityFromDTO(objProfileCore.BasicInfoCoreEntity, objIUnitOfWork.RepositoryBasicInfo.getByProfileID(strProfileID));
                                    }
                                    else
                                    {
                                        return -1; // Error Code
                                    }
                                }
                                objBasicInfoCoreEntity = null;
                            }
                            objIUnitOfWork = null;
                            objProfileCore.SangamID = objProfileCore.BasicInfoCoreEntity.SangamID;
                            objProfileCore.Gender = objProfileCore.BasicInfoCoreEntity.Gender;
                            objProfileCore.Star = objProfileCore.BasicInfoCoreEntity.Star;
                            objProfileCore.SubCaste = objProfileCore.BasicInfoCoreEntity.SubCaste;
                            objProfileCore.Age = objProfileCore.BasicInfoCoreEntity.Age;
                            objProfileCore.profileDOB = objProfileCore.BasicInfoCoreEntity.DOB.ToString();
                            objProfileCore.MugurthamProfileID = objProfileCore.BasicInfoCoreEntity.ProfileID;
                            objProfileCore.SangamProfiledID = objProfileCore.BasicInfoCoreEntity.SangamProfileID;
                        }
                        objBICore = null;

                        Photo.PhotoCore objPhotoCore = new Photo.PhotoCore();
                        using (objPhotoCore as IDisposable)
                        {
                            List<Mugurtham.Core.Profile.Photo.PhotoCoreEntity> objPhotoCoreEntityList = new List<Mugurtham.Core.Profile.Photo.PhotoCoreEntity>();
                            objProfileCore.GetProfilePhotos(ref objPhotoCoreEntityList, strProfileID);
                            objProfileCore.PhotoCoreEntityList = objPhotoCoreEntityList;
                        }
                        objPhotoCore = null;
                        CareerCore objCareerCore = new CareerCore();
                        using (objCareerCore as IDisposable)
                            objProfileCore.CareerCoreEntity = objCareerCore.GetByProfileID(strProfileID);
                        objCareerCore = null;
                        LocationCore objLocationCore = new LocationCore();
                        using (objLocationCore as IDisposable)
                            objProfileCore.LocationCoreEntity = objLocationCore.GetByProfileID(strProfileID);
                        objLocationCore = null;
                        ContactCore objContactCore = new ContactCore();
                        using (objContactCore as IDisposable)
                            objProfileCore.ContactCoreEntity = objContactCore.GetByProfileID(strProfileID);
                        objContactCore = null;
                        FamilyCore objFamilyCore = new FamilyCore();
                        using (objFamilyCore as IDisposable)
                            objProfileCore.FamilyCoreEntity = objFamilyCore.GetByProfileID(strProfileID);
                        objFamilyCore = null;
                        ReferenceCore objReferenceCore = new ReferenceCore();
                        using (objReferenceCore as IDisposable)
                            objProfileCore.ReferenceCoreEntity = objReferenceCore.GetByProfileID(strProfileID);
                        objReferenceCore = null;
                        SangamCore objSangamCore = new SangamCore();
                        using (objSangamCore as IDisposable)
                            objProfileCore.SangamCoreEntity = objSangamCore.GetByID(objProfileCore.BasicInfoCoreEntity.SangamID);
                        objReferenceCore = null;
                        RaasiCore objRaasiCore = new RaasiCore();
                        using (objRaasiCore as IDisposable)
                            objProfileCore.RaasiCoreEntity = objRaasiCore.GetByProfileID(strProfileID);
                        objRaasiCore = null;
                        AmsamCore objAmsamCore = new AmsamCore();
                        using (objAmsamCore as IDisposable)
                            objProfileCore.AmsamCoreEntity = objAmsamCore.GetByProfileID(strProfileID);
                        objRaasiCore = null;
                        HoroscopeCore objHoroscopeCore = new HoroscopeCore();
                        using (objHoroscopeCore as IDisposable)
                            objProfileCore.HoroscopeCoreEntity = objHoroscopeCore.GetByProfileID(strProfileID);
                        objHoroscopeCore = null;
                    }

                }
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return 0;
        }
Exemple #4
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;
        }