public HttpResponseMessage getProfileByProfileID(string ID)
 {
     ProfileCore objProfileCoreForView = null;
     ProfileCore objProfileCore = new ProfileCore();
     using (objProfileCore as IDisposable)
         objProfileCore.GetByProfileID(ID, out objProfileCoreForView);
     objProfileCore = null;
     return Request.CreateResponse(HttpStatusCode.OK, objProfileCoreForView,
       Configuration.Formatters.JsonFormatter);
 }
 public HttpResponseMessage getByProfileID(string ID)
 {
     ProfileCore objProfCore = null;
     if (!string.IsNullOrWhiteSpace(ID))
     {
         ProfileCore objProfileCore = new ProfileCore();
         using (objProfileCore as IDisposable)
             objProfileCore.GetByProfileID(ID, out objProfCore);
         objProfileCore = null;
     }
     return Request.CreateResponse(HttpStatusCode.OK, objProfCore,
       Configuration.Formatters.JsonFormatter);
 }
Esempio n. 3
0
 public ActionResult getViewedProfiles()
 {
     string strGender = "admin"; // Mugurtham admin, Sangam admin, public user
     Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
     if (objLoggedIn.roleID == "F62DDFBE55448E3A3") // User Profiles
     {
         if (!string.IsNullOrWhiteSpace(objLoggedIn.BasicInfoCoreEntity.Gender))
         {
             if (objLoggedIn.BasicInfoCoreEntity.Gender.ToLower().Trim() == "male".ToLower().Trim())
                 strGender = "female";
             else
                 strGender = "male";
         }
     }
     ProfileCore objProfileCore = new ProfileCore();
     ProfileBasicViewEntity objProfileBasicViewEntity = new ProfileBasicViewEntity();
     using (objProfileCore as IDisposable)
     {
         objProfileCore.GetViewedProfiles(Utility.connectionString(), strGender,
             objLoggedIn.LoginID, objLoggedIn.sangamID,
             ref objProfileBasicViewEntity,
             ref objLoggedIn
             );
     }
     objProfileCore = null;
     return this.Json(objProfileBasicViewEntity, JsonRequestBehavior.AllowGet);
 }
Esempio n. 4
0
 public ActionResult getProfilePhotos()
 {
     Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
     List<Mugurtham.Core.Profile.Photo.PhotoCoreEntity> objPhotoCoreEntityList = new List<Mugurtham.Core.Profile.Photo.PhotoCoreEntity>();
     ProfileCore objProfileCore = new ProfileCore();
     using (objProfileCore as IDisposable)
         objProfileCore.GetProfilePhotos(ref objPhotoCoreEntityList, objLoggedIn.LoginID);
     objProfileCore = null;
     return this.Json(objPhotoCoreEntityList, JsonRequestBehavior.AllowGet);
 }
Esempio n. 5
0
        private int validateUserAccessToThisProfile(string strProfileID, ref ProfileCore objProfileCore, Mugurtham.Core.Login.LoggedInUser objLoggedIn = null)
        {
            objProfileCore.validateFullViewAccess = false;
            try
            {
                if (objLoggedIn != null)
                {
                    // When LoggedIn user is this Profile user then grant access to view
                    if (objLoggedIn.LoginID == strProfileID)
                        objProfileCore.validateFullViewAccess = true;
                    // When LoggedIn user is the Sangam Admin of this Profile user then grant access to view
                    else if ((objLoggedIn.sangamID == objProfileCore.UserCoreEntity.SangamID)
                        && (objLoggedIn.roleID == Constants.RoleIDForSangamAdmin))
                        objProfileCore.validateFullViewAccess = true;
                    // When LoggedIn user is the Member of this Profile users Sangam then grant access to view
                    else if ((objLoggedIn.sangamID == objProfileCore.UserCoreEntity.SangamID)
                        && (objLoggedIn.roleID == Constants.RoleIDForUserProfile))
                        objProfileCore.validateFullViewAccess = true;
                    // When LoggedIn user is the Mugurtham Admin then grant access
                    else if (objLoggedIn.roleID == Constants.RoleIDForMugurthamAdmin)
                        objProfileCore.validateFullViewAccess = true;
                }

            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return 0;
        }
Esempio n. 6
0
 /// <summary>
 /// Preventing Hacking - Through Inspect Element when display hidden is disabled
 /// Donot empty the information containing in the Basic Information
 /// </summary>
 /// <returns></returns>
 public int setEmptyInfoToProfile(ref ProfileCore objProfileCore)
 {
     try
     {
         // Reset BasicInformation Object to Empty - [Never Nullify it]
         objProfileCore.BasicInfoCoreEntity.AboutMe = string.Empty;
         objProfileCore.BasicInfoCoreEntity.Age = 0;
         objProfileCore.BasicInfoCoreEntity.AnyDhosham = string.Empty;
         objProfileCore.BasicInfoCoreEntity.BloodGroup = string.Empty;
         objProfileCore.BasicInfoCoreEntity.BodyType = string.Empty;
         objProfileCore.BasicInfoCoreEntity.Caste = string.Empty;
         objProfileCore.BasicInfoCoreEntity.ChildrenLivingStatus = string.Empty;
         objProfileCore.BasicInfoCoreEntity.Complexion = string.Empty;
         objProfileCore.BasicInfoCoreEntity.Gender = string.Empty;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return 0;
 }
Esempio n. 7
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;
        }