Exemple #1
0
        private int GetDataSet(ref DataSet objDataSet)
        {
            try
            {
                Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
                string     conString = ConfigurationManager.ConnectionStrings["VishwakarmaMugurtham"].ConnectionString;
                SqlCommand cmd       = new SqlCommand("select * from rolemaster");
                using (SqlConnection con = new SqlConnection(conString))
                {
                    using (SqlDataAdapter sda = new SqlDataAdapter())
                    {
                        cmd.Connection = con;

                        sda.SelectCommand      = cmd;
                        objDataSet.DataSetName = "SangamDataset";
                        sda.Fill(objDataSet);
                        Common.Utilities.Helpers.LogMessageInFlatFile(objDataSet.Tables[0].Rows.Count.ToString());
                    }
                }
            }
            catch (Exception objEx)
            {
                Common.Utilities.Helpers.LogExceptionInFlatFile(objEx);
            }
            return(0);
        }
        public ActionResult getInterestedInMeProfiles()
        {
            string strGender = "admin"; // Mugurtham admin, Sangam admin, public user

            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            if (objLoggedIn.roleID == Mugurtham.Core.Constants.RoleIDForUserProfile) // User Profiles
            {
                if (!string.IsNullOrWhiteSpace(objLoggedIn.BasicInfoCoreEntity.Gender))
                {
                    if (objLoggedIn.BasicInfoCoreEntity.Gender.ToLower().Trim() == "male".ToLower().Trim())
                    {
                        strGender = "female";
                    }
                    else
                    {
                        strGender = "male";
                    }
                }
            }
            ProfileBasicViewEntity objProfileBasicViewEntity = new ProfileBasicViewEntity();
            ProfileInterestedCore  objProfileInterestedCore  = new ProfileInterestedCore(ref objLoggedIn);

            using (objProfileInterestedCore as IDisposable)
            {
                objProfileInterestedCore.GetInterestedInMeProfiles(Utility.connectionString(), strGender,
                                                                   objLoggedIn.LoginID, objLoggedIn.sangamID,
                                                                   ref objProfileBasicViewEntity,
                                                                   ref objLoggedIn
                                                                   );
            }
            objProfileInterestedCore = null;
            return(this.Json(objProfileBasicViewEntity, JsonRequestBehavior.AllowGet));
        }
 public ActionResult SaveSangamBanner(HttpPostedFileBase file)
 {
     Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
     if (file != null && file.ContentLength > 0)
     {
         try
         {
             string path = Path.Combine(Server.MapPath("~/Images/Mugurtham/Sangam/Banner"),
                                        objLoggedIn.sangamID + Path.GetExtension(Path.GetFileName(file.FileName)));
             file.SaveAs(path);
             Mugurtham.Core.Sangam.SangamCore objSangamCore = new Core.Sangam.SangamCore(objLoggedIn.ConnectionStringAppKey);
             using (objSangamCore as IDisposable)
             {
                 Mugurtham.Core.Sangam.SangamCoreEntity objSangamCoreEntity = new Core.Sangam.SangamCoreEntity();
                 using (objSangamCoreEntity as IDisposable)
                 {
                     objSangamCoreEntity            = objSangamCore.GetByID(objLoggedIn.sangamID);
                     objSangamCoreEntity.BannerPath = "/Images/Mugurtham/Sangam/Banner/" + objLoggedIn.sangamID + Path.GetExtension(Path.GetFileName(file.FileName));
                     objSangamCore.Edit(ref objSangamCoreEntity);
                 }
                 objSangamCoreEntity = null;
             }
             objSangamCore = null;
         }
         catch (Exception ex)
         {
             ViewBag.Message = "ERROR:" + ex.Message.ToString();
         }
     }
     else
     {
         ViewBag.Message = "You have not specified a file.";
     }
     return(Redirect("/Matrimony#/SangamAdminSettings"));
 }
Exemple #4
0
        public static string connectionString()
        {
            /*www.codeproject.com/Articles/420217/DataSet-vs-DataReader*/
            string strConnectionString = string.Empty;

            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)HttpContext.Current.Session["LoggedInUser"];
            strConnectionString = objLoggedIn.ConnectionString;
            return(strConnectionString);
        }
Exemple #5
0
        public ActionResult RemoveProfilePic(string ID)
        {
            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            string    strUserID    = string.Empty;
            PhotoCore objPhotoCore = new PhotoCore(ref objLoggedIn);

            using (objPhotoCore as IDisposable)
                objPhotoCore.Delete(ID);
            objPhotoCore = null;
            return(this.Json("Success", JsonRequestBehavior.AllowGet));
        }
 public ActionResult getProfileByProfileID(string ID)
 {
     Mugurtham.Core.Login.LoggedInUser      objLoggedIn           = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
     Mugurtham.Core.Profile.API.ProfileCore objProfileCoreForView = null;
     Mugurtham.Core.Profile.API.ProfileCore objProfileCore        = new Mugurtham.Core.Profile.API.ProfileCore(ref objLoggedIn);
     using (objProfileCore as IDisposable)
         objProfileCore.GetByProfileID(ID, out objProfileCoreForView, objLoggedIn);
     objProfileCore = null;
     // Try to change the below implementation as it is possible of JSON HiJacking -- Anand J
     return(this.Json(objProfileCoreForView, JsonRequestBehavior.AllowGet));
 }
        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(ref objLoggedIn);

            using (objProfileCore as IDisposable)
                objProfileCore.GetProfilePhotos(ref objPhotoCoreEntityList, objLoggedIn.LoginID);
            objProfileCore = null;
            return(this.Json(objPhotoCoreEntityList, JsonRequestBehavior.AllowGet));
        }
Exemple #8
0
        public ActionResult Add([System.Web.Http.FromBody] Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity)
        {
            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            string strProfileID = string.Empty;

            Mugurtham.Core.Profile.API.ProfileCore objProfileCore = new Mugurtham.Core.Profile.API.ProfileCore(ref objLoggedIn);
            using (objProfileCore as IDisposable)
            {
                objProfileCore.Add(ref objBasicInfoCoreEntity, out strProfileID, objLoggedIn);
            }
            objProfileCore = null;
            return(this.Json(strProfileID, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getByProfileID(string ProfileID)
        {
            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            ProfileCore objProfileCoreReturn = new ProfileCore(ref objLoggedIn);
            ProfileCore objProfileCore       = new ProfileCore(ref objLoggedIn);

            using (objProfileCore as IDisposable)
            {
                objProfileCore.GetByProfileID(ProfileID, out objProfileCoreReturn, objLoggedIn);
            }
            objProfileCore = null;
            return(this.Json(objProfileCoreReturn, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getAllProfiles(bool lazyLoad = false)
        {
            string strGender = "admin"; // Mugurtham admin, Sangam admin, public user

            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            if (objLoggedIn.roleID == Constants.RoleIDForUserProfile) // User Profiles
            {
                if (!string.IsNullOrWhiteSpace(objLoggedIn.BasicInfoCoreEntity.Gender))
                {
                    if (objLoggedIn.BasicInfoCoreEntity.Gender.ToLower().Trim() == "male".ToLower().Trim())
                    {
                        strGender = "female";
                    }
                    else
                    {
                        strGender = "male";
                    }
                }
            }
            //string cs = System.Configuration.ConfigurationManager.ConnectionStrings["connectionStringName"].ConnectionString;
            ProfileBasicViewEntity   objProfileBasicViewEntity   = new ProfileBasicViewEntity();
            PorfileBasicInfoViewCore objPorfileBasicInfoViewCore = new PorfileBasicInfoViewCore();

            using (objPorfileBasicInfoViewCore as IDisposable)
            {
                objPorfileBasicInfoViewCore.GetAllProfiles(Utility.connectionString(), strGender, lazyLoad,
                                                           ref objProfileBasicViewEntity,
                                                           ref objLoggedIn
                                                           );
            }
            objPorfileBasicInfoViewCore = null;
            //Uncommented the below code for performance optimization - Apr 11 2016 - Anand J

            /*
             * List<ProfileCore> objProfileCoreList = new List<ProfileCore>();
             * ProfileCore objProfileCore = new ProfileCore();
             * using (objProfileCore as IDisposable)
             *  objProfileCore.GetAll(ref objProfileCoreList, strGender, objLoggedIn.sangamID);
             * objProfileCore = null;*/
            //Response.AddHeader("Content-Encoding", "gzip");

            var jsonResult = this.Json(objProfileBasicViewEntity.ProfileBasicInfoViewCoreEntityList, JsonRequestBehavior.AllowGet);

            jsonResult.MaxJsonLength = int.MaxValue;

            return(jsonResult);
            //return this.Json(objProfileBasicViewEntity.ProfileBasicInfoViewCoreEntityList, JsonRequestBehavior.AllowGet);
        }
        public ActionResult RemoveInterest(string ID)
        {
            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            string strUserID = string.Empty;
            ProfileInterestedCore objProfileInterestedCore = new ProfileInterestedCore(ref objLoggedIn);

            using (objProfileInterestedCore as IDisposable)
            {
                ProfileInterestedCoreEntity objProfileInterestedCoreEntity = new ProfileInterestedCoreEntity();
                using (objProfileInterestedCoreEntity as IDisposable)
                    objProfileInterestedCore.Delete(objLoggedIn.LoginID, ID);
                objProfileInterestedCoreEntity = null;
            }
            objProfileInterestedCore = null;
            return(this.Json("Success", JsonRequestBehavior.AllowGet));
        }
        public ActionResult getIsInterestedProfile(string ID)
        {
            bool isInterestedProfile  = false;
            int  intInterestedProfile = 0; // 0 -> Not an interested Profile; 1 -> is an interested profile

            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            Mugurtham.Core.ProfileInterested.ProfileInterestedCore objProfileInterestedCore = new Core.ProfileInterested.ProfileInterestedCore(ref objLoggedIn);
            using (objProfileInterestedCore as IDisposable)
                isInterestedProfile = objProfileInterestedCore.isInterestedProfile(objLoggedIn.LoginID, ID);
            objProfileInterestedCore = null;
            if (isInterestedProfile)
            {
                intInterestedProfile = 1;
            }
            // Try to change the below implementation as it is possible of JSON HiJacking -- Anand J
            return(this.Json(intInterestedProfile, JsonRequestBehavior.AllowGet));
        }
Exemple #13
0
 private int savePhotoToFolder(string strPhotoPath, string strProfileID)
 {
     Mugurtham.Core.Login.LoggedInUser      objLoggedIn  = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
     Mugurtham.Core.Profile.Photo.PhotoCore objPhotoCore = new Core.Profile.Photo.PhotoCore(ref objLoggedIn);
     using (objPhotoCore as IDisposable)
     {
         Mugurtham.Core.Profile.Photo.PhotoCoreEntity objPhotoCoreEntity = new Core.Profile.Photo.PhotoCoreEntity();
         using (objPhotoCoreEntity as IDisposable)
         {
             objPhotoCoreEntity.IsProfilePic = 0;
             objPhotoCoreEntity.PhotoPath    = strPhotoPath;
             objPhotoCoreEntity.ProfileID    = strProfileID;
             objPhotoCore.Add(ref objPhotoCoreEntity);
         }
         objPhotoCoreEntity = null;
     }
     objPhotoCore = null;
     return(0);
 }
        public ActionResult Add(string ID)
        {
            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            string            strUserID            = string.Empty;
            ProfileViewedCore objProfileViewedCore = new ProfileViewedCore(ref objLoggedIn);

            using (objProfileViewedCore as IDisposable)
            {
                ProfileViewedCoreEntity objProfileViewedCoreEntity = new ProfileViewedCoreEntity();
                using (objProfileViewedCoreEntity as IDisposable)
                {
                    objProfileViewedCoreEntity.ViewerID = objLoggedIn.LoginID;
                    objProfileViewedCoreEntity.ViewedID = ID;
                    objProfileViewedCore.Add(ref objProfileViewedCoreEntity);
                }
                objProfileViewedCoreEntity = null;
            }
            objProfileViewedCore = null;
            return(this.Json("Success", JsonRequestBehavior.AllowGet));
        }
 public ActionResult getSangamDashboardData()
 {
     Core.Sangam.SangamDashboardEntity objSangamDashboardEntity = new Core.Sangam.SangamDashboardEntity();
     try
     {
         Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
         SangamDashboardCore objSangamDashboardCore    = new SangamDashboardCore(ref objLoggedIn);
         using (objSangamDashboardCore as IDisposable)
         {
             objSangamDashboardCore.GetSangamDashboardData(objLoggedIn.ConnectionString, objLoggedIn.sangamID, ref objSangamDashboardEntity);
         }
         objSangamDashboardCore = null;
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     finally
     {
         // ((IDisposable)objSangamDashboardEntity).Dispose();
     }
     return(this.Json(objSangamDashboardEntity, JsonRequestBehavior.AllowGet));
 }
Exemple #16
0
 public ActionResult SaveProfilePhoto(HttpPostedFileBase file, string ProfileID)
 {
     if (file != null && file.ContentLength > 0)
     {
         try
         {
             Mugurtham.Core.Login.LoggedInUser      objLoggedIn      = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
             Mugurtham.Core.BasicInfo.BasicInfoCore objBasicInfoCore = new Core.BasicInfo.BasicInfoCore(ref objLoggedIn);
             using (objBasicInfoCore as IDisposable)
             {
                 Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity = new Core.BasicInfo.BasicInfoCoreEntity();
                 using (objBasicInfoCoreEntity as IDisposable)
                 {
                     objBasicInfoCoreEntity           = objBasicInfoCore.GetByProfileID(ProfileID);
                     objBasicInfoCoreEntity.PhotoPath = "/Areas/Profile/Images/ProfilePhoto/" + objLoggedIn.CommunityName + "/" + ProfileID + Path.GetExtension(Path.GetFileName(file.FileName));
                     string strFilePath = Path.Combine(Server.MapPath("~/Areas/Profile/Images/ProfilePhoto"),
                                                       ProfileID + Path.GetExtension(Path.GetFileName(file.FileName)));
                     file.SaveAs(strFilePath);
                     addTextWatermark(strFilePath);
                     objBasicInfoCore.Edit(ref objBasicInfoCoreEntity);
                 }
                 objBasicInfoCoreEntity = null;
             }
             objBasicInfoCore = null;
         }
         catch (Exception ex)
         {
             ViewBag.Message = "ERROR:" + ex.Message.ToString();
         }
     }
     else
     {
         ViewBag.Message = "You have not specified a file.";
     }
     return(Redirect("/Matrimony#/Photo"));
 }
 public BasicInfoCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
        public ActionResult getUserBadgeCount()
        {
            string strGender = "admin"; // Mugurtham admin, Sangam admin, public user

            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            if (objLoggedIn.roleID == Mugurtham.Core.Constants.RoleIDForUserProfile) // User Profiles
            {
                if (!string.IsNullOrWhiteSpace(objLoggedIn.BasicInfoCoreEntity.Gender))
                {
                    if (objLoggedIn.BasicInfoCoreEntity.Gender.ToLower().Trim() == "male".ToLower().Trim())
                    {
                        strGender = "female";
                    }
                    else
                    {
                        strGender = "male";
                    }
                }
            }
            UserBadgeCount objUserBadgeCount = new UserBadgeCount();

            objUserBadgeCount.InterestedInMeProfiles = 0;
            objUserBadgeCount.InterestedProfiles     = 0;
            objUserBadgeCount.ViewedProfiles         = 0;
            objUserBadgeCount.HighlightedProfiles    = 0;
            objUserBadgeCount.RecentlyJoined         = 0;
            objUserBadgeCount.RecentlyViewedProfiles = 0;
            using (SqlConnection objSqlConnection = new SqlConnection(Utility.connectionString()))
            {
                objSqlConnection.Open();
                // 1.  create a command object identifying the stored procedure
                SqlCommand objSqlCommand = new SqlCommand("uspGetProfileBadgeCount", objSqlConnection);

                // 2. set the command object so it knows to execute a stored procedure
                objSqlCommand.CommandType = CommandType.StoredProcedure;

                // 3. add parameter to command, which will be passed to the stored procedure
                objSqlCommand.Parameters.Add(new SqlParameter("@GENDER", strGender));
                objSqlCommand.Parameters.Add(new SqlParameter("@INTERESTEDID", objLoggedIn.LoginID));
                objSqlCommand.Parameters.Add(new SqlParameter("@SANGAMID", objLoggedIn.sangamID));

                // execute the command
                using (SqlDataReader objSqlDataReader = objSqlCommand.ExecuteReader())
                {
                    while (objSqlDataReader.Read())
                    {
                        if (objSqlDataReader["HighlightedProfilesCount"] != null)
                        {
                            objUserBadgeCount.HighlightedProfiles = Convert.ToInt32(objSqlDataReader["HighlightedProfilesCount"].ToString());
                        }
                        if (objSqlDataReader["InterestedInMeProfilesCount"] != null)
                        {
                            objUserBadgeCount.InterestedInMeProfiles = Convert.ToInt32(objSqlDataReader["InterestedInMeProfilesCount"].ToString());
                        }
                        if (objSqlDataReader["InterestedProfilesCount"] != null)
                        {
                            objUserBadgeCount.InterestedProfiles = Convert.ToInt32(objSqlDataReader["InterestedProfilesCount"].ToString());
                        }
                        if (objSqlDataReader["ProfilesJoinedThisWeekCount"] != null)
                        {
                            objUserBadgeCount.RecentlyJoined = Convert.ToInt32(objSqlDataReader["ProfilesJoinedThisWeekCount"].ToString());
                        }
                        if (objSqlDataReader["ProfilesViewedMeCount"] != null)
                        {
                            objUserBadgeCount.ViewedProfiles = Convert.ToInt32(objSqlDataReader["ProfilesViewedMeCount"].ToString());
                        }
                        if (objSqlDataReader["RecentlyViewedProfilesCount"] != null)
                        {
                            objUserBadgeCount.RecentlyViewedProfiles = Convert.ToInt32(objSqlDataReader["RecentlyViewedProfilesCount"].ToString());
                        }
                    }
                    objSqlDataReader.Close();
                }
                objSqlCommand.Cancel();
                objSqlCommand.Dispose();
                objSqlConnection.Close();
                objSqlConnection.Dispose();
            }

            /*
             * List<ProfileCore> objProfileCoreList = new List<ProfileCore>();
             * ProfileInterestedCore objProfileInterestedCore = new ProfileInterestedCore();
             * using (objProfileInterestedCore as IDisposable)
             *  objProfileInterestedCore.GetInterestedInMeProfiles(ref objProfileCoreList, strGender, objLoggedIn.LoginID, objLoggedIn.sangamID);
             * if (objProfileCoreList != null)
             *  objUserBadgeCount.InterestedInMeProfiles = objProfileCoreList.Count;
             * objProfileCoreList = null;
             * List<ProfileCore> objIntProfProfileCoreList = new List<ProfileCore>();
             * objProfileInterestedCore.GetInterestedProfiles(ref objIntProfProfileCoreList, strGender, objLoggedIn.LoginID, objLoggedIn.sangamID);
             * objProfileInterestedCore = null;
             * if (objIntProfProfileCoreList != null)
             *  objUserBadgeCount.InterestedProfiles = objIntProfProfileCoreList.Count;
             * objIntProfProfileCoreList = null;
             * ProfileCore objProfileCore = new ProfileCore();
             * using (objProfileCore as IDisposable)
             * {
             *  List<ProfileCore> objViewedProfileCoreList = new List<ProfileCore>();
             *  objProfileCore.GetViewedProfiles(ref objViewedProfileCoreList, strGender, objLoggedIn.LoginID, objLoggedIn.sangamID);
             *  if (objViewedProfileCoreList != null)
             *      objUserBadgeCount.ViewedProfiles = objViewedProfileCoreList.Count;
             *  objViewedProfileCoreList = null;
             *  List<ProfileCore> objHighlightedProfileCoreList = new List<ProfileCore>();
             *  objProfileCore.GetHighlightedProfiles(ref objHighlightedProfileCoreList, strGender, objLoggedIn.sangamID);
             *  if (objHighlightedProfileCoreList != null)
             *      objUserBadgeCount.HighlightedProfiles = objHighlightedProfileCoreList.Count;
             *  objHighlightedProfileCoreList = null;
             *  List<ProfileCore> objRecentlyProfileCoreList = new List<ProfileCore>();
             *  objProfileCore.GetRecentlyJoined(ref objRecentlyProfileCoreList, strGender, objLoggedIn.sangamID);
             *  if (objRecentlyProfileCoreList != null)
             *      objUserBadgeCount.RecentlyJoined = objRecentlyProfileCoreList.Count;
             *  objRecentlyProfileCoreList = null;
             * }
             * objProfileCore = null;
             */
            return(this.Json(objUserBadgeCount, JsonRequestBehavior.AllowGet));
        }
Exemple #19
0
 public SangamDashboardCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
 public HoroscopeCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
Exemple #21
0
 public RoleCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
Exemple #22
0
 public FamilyCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
Exemple #23
0
        public ActionResult SaveHoroscopeImage(HttpPostedFileBase file, string ProfileID)
        {
            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            if (file != null && file.ContentLength > 0)
            {
                try
                {
                    string strProfileHoroFolderPath = Path.Combine(Server.MapPath("~/Areas/Profile/Images/ProfilePhoto/" + objLoggedIn.CommunityName + "/" + ProfileID + "/Horoscope"));

                    if (!Directory.Exists(strProfileHoroFolderPath))
                    {
                        Directory.CreateDirectory(strProfileHoroFolderPath);
                    }

                    System.IO.DirectoryInfo objDirectoryInfo = new DirectoryInfo(strProfileHoroFolderPath);

                    foreach (FileInfo objFile in objDirectoryInfo.GetFiles())
                    {
                        objFile.Delete();
                    }
                    foreach (DirectoryInfo objDir in objDirectoryInfo.GetDirectories())
                    {
                        objDir.Delete(true);
                    }
                    string path = Path.Combine(Server.MapPath("~/Areas/Profile/Images/ProfilePhoto/" + objLoggedIn.CommunityName + "/" + ProfileID + "/Horoscope/" + ProfileID + Path.GetExtension(Path.GetFileName(file.FileName))));
                    string strProfileHoroPath = "/Areas/Profile/Images/ProfilePhoto/" + objLoggedIn.CommunityName + "/" + ProfileID + "/Horoscope/" + ProfileID + Path.GetExtension(Path.GetFileName(file.FileName));
                    if (
                        Path.GetExtension(Path.GetFileName(file.FileName)).ToString().ToLower() == ".jpg".ToString().ToLower() ||
                        Path.GetExtension(Path.GetFileName(file.FileName)).ToString().ToLower() == ".jpeg".ToString().ToLower() ||
                        Path.GetExtension(Path.GetFileName(file.FileName)).ToString().ToLower() == ".gif".ToString().ToLower() ||
                        Path.GetExtension(Path.GetFileName(file.FileName)).ToString().ToLower() == ".png".ToString().ToLower()
                        )
                    {
                        file.SaveAs(path);
                        addTextWatermark(path);
                        Mugurtham.Core.Profile.Horoscope.HoroscopeCore objHoroscopeCore = new Core.Profile.Horoscope.HoroscopeCore(ref objLoggedIn);
                        using (objHoroscopeCore as IDisposable)
                        {
                            Mugurtham.Core.Profile.Horoscope.HoroscopeCoreEntity objHoroscopeCoreEntity = new Core.Profile.Horoscope.HoroscopeCoreEntity();
                            using (objHoroscopeCoreEntity as IDisposable)
                            {
                                objHoroscopeCoreEntity      = objHoroscopeCore.GetByProfileID(ProfileID, objLoggedIn.LoginID);
                                objHoroscopeCoreEntity.Path = strProfileHoroPath;
                                if (!string.IsNullOrEmpty(strProfileHoroPath))
                                {
                                    objHoroscopeCore.updateHoroscope(ref objHoroscopeCoreEntity);
                                }
                            }
                            objHoroscopeCoreEntity = null;
                        }
                        objHoroscopeCore = null;
                    }
                }
                catch (Exception ex)
                {
                    ViewBag.Message = "ERROR:" + ex.Message.ToString();
                }
            }
            else
            {
                ViewBag.Message = "You have not specified a file.";
            }
            return(Redirect("/Matrimony#/Horoscope"));
        }
 public ProfileViewedCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
 public ProfileSecurity(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
Exemple #26
0
 public ActionResult SaveProfilePhotoAlbum(List <HttpPostedFileBase> file, string ProfileID)
 {
     try
     {
         string strFileName          = string.Empty;
         string strProfilePhotoPath  = string.Empty;
         int    intProfilePhotoIndex = 1;
         // Create if profile directory does not exsist
         Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
         string strProfileFolderPath = Path.Combine(Server.MapPath("~/Areas/Profile/Images/ProfilePhoto/" + objLoggedIn.CommunityName.Trim() + "/" + ProfileID));
         if (!Directory.Exists(strProfileFolderPath))
         {
             Directory.CreateDirectory(strProfileFolderPath);
         }
         foreach (HttpPostedFileBase item in file)
         {
             if (item != null)
             {
                 strFileName         = Helpers.primaryKey;
                 strProfilePhotoPath = "/Areas/Profile/Images/ProfilePhoto/" + objLoggedIn.CommunityName + "/" + ProfileID + "/" + strFileName + Path.GetExtension(Path.GetFileName(item.FileName));
             }
             //if (Array.Exists(model.FilesToBeUploaded.Split(','), s => s.Equals(item.FileName)))
             if (
                 Path.GetExtension(Path.GetFileName(item.FileName)).ToString().ToLower() == ".jpg".ToString().ToLower() ||
                 Path.GetExtension(Path.GetFileName(item.FileName)).ToString().ToLower() == ".jpeg".ToString().ToLower() ||
                 Path.GetExtension(Path.GetFileName(item.FileName)).ToString().ToLower() == ".gif".ToString().ToLower() ||
                 Path.GetExtension(Path.GetFileName(item.FileName)).ToString().ToLower() == ".png".ToString().ToLower()
                 )
             {
                 try
                 {
                     Mugurtham.Core.BasicInfo.BasicInfoCore objBasicInfoCore = new Core.BasicInfo.BasicInfoCore(ref objLoggedIn);
                     using (objBasicInfoCore as IDisposable)
                     {
                         Mugurtham.Core.BasicInfo.BasicInfoCoreEntity objBasicInfoCoreEntity = new Core.BasicInfo.BasicInfoCoreEntity();
                         using (objBasicInfoCoreEntity as IDisposable)
                         {
                             objBasicInfoCoreEntity           = objBasicInfoCore.GetByProfileID(ProfileID);
                             objBasicInfoCoreEntity.PhotoPath = strProfilePhotoPath;
                             string strFilePath = Path.Combine(Server.MapPath("~/Areas/Profile/Images/ProfilePhoto/" + objLoggedIn.CommunityName.Trim() + "/" + ProfileID.Trim()),
                                                               strFileName + Path.GetExtension(Path.GetFileName(item.FileName)));
                             item.SaveAs(strFilePath);
                             addTextWatermark(strFilePath);
                             savePhotoToFolder(strProfilePhotoPath, ProfileID);
                             if (intProfilePhotoIndex == 1)
                             {
                                 objBasicInfoCore.Edit(ref objBasicInfoCoreEntity);
                             }
                         }
                         objBasicInfoCoreEntity = null;
                     }
                     objBasicInfoCore = null;
                 }
                 catch (Exception ex)
                 {
                     ViewBag.Message = "ERROR:" + ex.Message.ToString();
                 }
             }
             intProfilePhotoIndex += 1;
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return(Redirect("/Matrimony#/Photo"));
 }
Exemple #27
0
 public CareerCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
Exemple #28
0
 public ContactCore(ref Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
Exemple #29
0
 public PaymentGatewayTransactionsCore(Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }
Exemple #30
0
 public PaymentProfileTransactionsCore(Mugurtham.Core.Login.LoggedInUser objLoggedInUser)
 {
     _objLoggedInUser = objLoggedInUser;
 }