Exemplo n.º 1
0
 public ActionResult ActiveInactiveMember(string id)
 {
     MemberAction objMember = new MemberAction();
     Member member = objMember.GetMemberByMemberId(id);
     if (member != null)
     {
         if (member.status == SystemStatements.STATUS_ACTIVE)
         {
             member.status = SystemStatements.STATUS_INACTIVE;
         }
         else
         {
             member.status = SystemStatements.STATUS_ACTIVE;
         }
     }
     if (objMember.UpdateMember(member))
     {
         ViewData["ManageUser"] = "******";
     }
     else
     {
         ViewData["ManageUser"] = "******";
     }
     GetAllMemberList();
     return View("ManageUser");
 }
 public ActionResult ViewMyProfile(string username)
 {
     if (!string.IsNullOrEmpty(username))
     {
         MemberAction objMember = new MemberAction();
         string UserId = objMember.FindUserIdByURL(username);
         if (!string.IsNullOrEmpty(UserId))
             Response.Redirect("/Member/UserDetail/" + UserId);
         else
             return RedirectToAction("NotFound", "UserProfile");
     }
     else
     {
         return RedirectToAction("NotFound", "UserProfile");
     }
     return View();
 }
Exemplo n.º 3
0
        // *************************************
        // URL: /Member/Dashboard
        // *************************************
        public ActionResult Dashboard(string id)
        {
            #region
            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            if (memberData == null)
                return RedirectToAction("Default", "Member");

            SeedAction objSeed = new SeedAction();

            IList<Seed> tempPlanted = objSeed.GetSeedsByUser(memberData.id.ToString()).Where(x => x.parentSeedID == null).ToList();
            IList<Seed> tempCommented = objSeed.GetAllSeedsCommentedByMe(memberData.id.ToString());
            tempCommented = tempCommented.Where(x => x.ownerId != memberData.id).ToList();
            IList<Seed> tempReply = objSeed.GetAllReplySeedsbyMember(memberData.id.ToString());
            var tempCmtReply = tempCommented.Union(tempReply);
            IList<Seed> tempFavSeeds = objSeed.GetAllFavouriteSeeds(memberData.id.ToString());

            string replySeedCount = objSeed.GetReplySeedCountbyOwnerId(memberData.id.ToString());

            if (!string.IsNullOrEmpty(id))
            {
                if (id == "Date")
                    tempPlanted = tempPlanted.OrderByDescending(x => x.createDate).ToList();

                if (id == "Category")
                    tempPlanted = tempPlanted.OrderBy(x => x.Categories.FirstOrDefault() != null ? x.Categories.FirstOrDefault().name : "").ToList();

                if (id == "Likes")
                    tempPlanted = tempPlanted.OrderByDescending(x => x.Ratings.ToList().Count).ToList();

                if (id == "Comments")
                    tempPlanted = tempPlanted.OrderByDescending(x => x.Comments.ToList().Count).ToList();

                if (id == "SeedReply")
                    tempPlanted = tempPlanted.OrderByDescending(x => x.Seed1.ToList().Count).ToList();
            }

            ViewData["MyPlantedSeeds"] = tempPlanted;
            ViewData["PlantedSeedCount"] = tempPlanted.Count();

            ViewData["MyCommentsAndReply"] = (from gs in tempCmtReply select gs).OrderByDescending(x => x.createDate).Distinct().ToList();
            ViewData["CommentsAndReplyCount"] = (from gs in tempCmtReply select gs).OrderByDescending(x => x.createDate).Distinct().ToList().Count();

            ViewData["MyFavSeeds"] = tempFavSeeds;
            ViewData["FavSeedsCount"] = tempFavSeeds.Count();

            SessionStore.SetSessionValue(SessionStore.MySeeds, tempPlanted);

            string[] dashboardCount = new string[4];
            int tmpPlant = tempPlanted.Count();
            int cmtReply = (from gs in tempCmtReply select gs).OrderByDescending(x => x.createDate).Distinct().ToList().Count();
            int fav = tempFavSeeds.Count();
            int MySeedsCount = tmpPlant + cmtReply + fav;
            dashboardCount[0] = MySeedsCount.ToString();

            StreamAction objStream = new StreamAction();
            IList<ssStream> lstStream = objStream.GetAllStreams(memberData.id.ToString());
            dashboardCount[1] = lstStream.Count().ToString();

            MemberAction objMember = new MemberAction();
            IList<Member> followingMemberList = objMember.GetFollowing(memberData.id.ToString());
            dashboardCount[2] = followingMemberList.Count().ToString();

            IList<Seed> lstNearestSeeds = getNewestNearby("15");
            dashboardCount[3] = lstNearestSeeds.Count().ToString();

            SessionStore.SetSessionValue(SessionStore.DashboardCount, dashboardCount);

            ViewData["SelectedIndex"] = 0;
            if (Request.QueryString["gridCmtReply-page"] != null)
                ViewData["SelectedIndex"] = 1;
            if (Request.QueryString["gridFavs-page"] != null)
                ViewData["SelectedIndex"] = 2;

            return View();
            #endregion
        }
Exemplo n.º 4
0
        public JsonResult CheckURL(string urlString)
        {
            MemberAction objMember = new MemberAction();
            bool isURLAvailable = objMember.FindByURL(urlString);

            if (isURLAvailable == true)
                return Json(false);
            return Json(true);
        }
Exemplo n.º 5
0
 private bool SaveProfileImage(string path)
 {
     MemberAction objMember = new MemberAction();
     bool isInfoSaved = false;
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     isInfoSaved = objMember.UploadProfileImage(memberData, path);
     return isInfoSaved;
 }
Exemplo n.º 6
0
 private void GetProfileData()
 {
     MemberAction objMember = new MemberAction();
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     memberData = objMember.GetMemberByMemberId(memberData.id.ToString());
     ViewData["MemberData"] = memberData;
     MemberProfile objMemberProfile = memberData.MemberProfiles.FirstOrDefault();
     ViewData["MemberProfile"] = objMemberProfile;
     Privacy objPrivacy = memberData.Privacies.FirstOrDefault();
     ViewData["Privacy"] = objPrivacy;
 }
Exemplo n.º 7
0
 // *************************************
 // URL: /Member/ListMember
 // *************************************
 private void GetAllMemberList()
 {
     MemberAction objMember = new MemberAction();
     IList<Member> lstMember = objMember.GetAllMember().ToList();
     ViewData["MemberList"] = lstMember;
 }
Exemplo n.º 8
0
 // *************************************
 // URL: /Member/VerifyAccount
 // *************************************
 public ActionResult VerifyAccount()
 {
     #region
     bool isVerified = false;
     MemberAction objMember = new MemberAction();
     if (Request.QueryString["id"] != null)
     {
         isVerified = objMember.VerifyAcount(Request.QueryString["id"].ToString());
         if (isVerified == true)
         {
             ViewData["Verify"] = "Congratulations ! your account has been verified.";
         }
         else
         {
             ModelState.AddModelError("", "Sorry, no account found associated with this userid.");
         }
     }
     else
     {
         ViewData["Verify"] = "No account found to verify.";
     }
     return View();
     #endregion
 }
Exemplo n.º 9
0
        public ActionResult Profile()
        {
            #region
            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            if (memberData == null)
            {
                string universalURL = "http://" + (Request.ServerVariables["SERVER_NAME"] + Request.ServerVariables["URL"]).ToString();
                SessionStore.SetSessionValue("RequestedURL", universalURL);
                return RedirectToAction("Default", "Member");
            }

            MemberAction objMember = new MemberAction();
            Privacy privacyData = objMember.GetPrivacyByMemberId(memberData.id);
            if (memberData == null)
                return RedirectToAction("Default", "Member");

            GetRegions();
            MyUsername(privacyData);
            SeedContributionMessage(privacyData);
            SeedCommitmentMessage(privacyData);
            GetExternalAccountList();
            GetProfileData();
            ViewData["LoggedInMember"] = memberData.id.ToString();
            return View();
            #endregion
        }
Exemplo n.º 10
0
        public ActionResult PrivacyAccounts(ProfileModel objPrivacyModel)
        {
            #region
            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            MemberAction objMember = new MemberAction();
            SeedSpeak.Model.Privacy privacyAccount = new SeedSpeak.Model.Privacy();
            privacyAccount.viewUsername = objPrivacyModel.ViewUsername;
            privacyAccount.seedContribution = objPrivacyModel.seedContribution;
            privacyAccount.seedCommitment = objPrivacyModel.seedCommitment;
            privacyAccount.viewLocation = Convert.ToBoolean(objPrivacyModel.viewLocation);
            privacyAccount.webNotification = Convert.ToBoolean(objPrivacyModel.webNotification);
            privacyAccount.devicePush = Convert.ToBoolean(objPrivacyModel.devicePush);
            privacyAccount.emailNotification = Convert.ToBoolean(objPrivacyModel.emailNotification);

            bool saved = objMember.ManageMemberPrivacy(memberData, privacyAccount);
            if (saved == true)
            {
                ViewData["PrivacyMsg"] = "<b>Privacy account saved succesfully.</b>";
            }
            else
            {
                ViewData["PrivacyMsg"] = "Problem saving privacy account.";
            }
            ViewData["SelectedIndex"] = 1;
            GetRegions();
            MyUsername(privacyAccount);
            SeedContributionMessage(privacyAccount);
            SeedCommitmentMessage(privacyAccount);
            GetExternalAccountList();
            GetExternalAccountList();
            GetProfileData();
            ViewData["LoggedInMember"] = memberData.id.ToString();
            return View("Profile");
            #endregion
        }
Exemplo n.º 11
0
        public string CheckMember(string userName, string password)
        {
            Boolean isAuthenticate = false;

            MemberAction objMember = new MemberAction();
            Member memberData = objMember.Authenticate(userName, password);
            if (memberData != null)
            {
                isAuthenticate = true;
            }

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            var output = serializer.Serialize(isAuthenticate);

            return output;
        }
Exemplo n.º 12
0
        public ActionResult People(string id)
        {
            #region
            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            MemberAction objMember = new MemberAction();
            IList<Member> followerMemberList = objMember.GetFollowers(memberData.id.ToString());
            IList<Member> followingMemberList = objMember.GetFollowing(memberData.id.ToString());
            IList<Seed> seedList = objMember.GetFollowingActivity(memberData.id.ToString());

            if (!string.IsNullOrEmpty(id))
            {
                if (id == "Proximity")
                    seedList = seedList.OrderByDescending(x => x.createDate).ToList();

                if (id == "Date")
                    seedList = seedList.OrderByDescending(x => x.createDate).ToList();

                if (id == "Category")
                    seedList = seedList.OrderByDescending(x => x.Categories.FirstOrDefault() != null ? x.Categories.FirstOrDefault().name : "").ToList();

                if (id == "Likes")
                    seedList = seedList.OrderByDescending(x => x.Ratings.ToList().Count).ToList();

                if (id == "Comments")
                    seedList = seedList.OrderByDescending(x => x.Comments.ToList().Count).ToList();

                if (id == "SeedReply")
                    seedList = seedList.OrderByDescending(x => x.Seed1.ToList().Count).ToList();
            }

            ViewData["LatestActivity"] = seedList;
            ViewData["Following"] = followingMemberList;
            ViewData["Followers"] = followerMemberList;
            return View();
            #endregion
        }
Exemplo n.º 13
0
 public string MuteUnMute(string muteId, string btnAction)
 {
     #region
     var output = string.Empty;
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     MemberAction objMember = new MemberAction();
     bool isDone = objMember.MuteOrUnMutePeople(memberData.id.ToString(), muteId, btnAction);
     memberData = objMember.GetMemberByMemberId(memberData.id.ToString());
     SessionStore.SetSessionValue(SessionStore.Memberobject, memberData);
     JavaScriptSerializer serializer = new JavaScriptSerializer();
     if (btnAction == "Mute" && isDone == true)
         output = serializer.Serialize("Unmute");
     if (btnAction == "Unmute" && isDone == true)
         output = serializer.Serialize("Mute");
     return output;
     #endregion
 }
Exemplo n.º 14
0
        public ActionResult Login(RegisterModel objLoginModel, string chkRemember)
        {
            #region
            MemberAction objMember = new MemberAction();
            Member memberData = objMember.Authenticate(objLoginModel.LogUserName, objLoginModel.LogPassword);

            if (memberData != null)
            {
                if (chkRemember != null)
                {
                    //Create a new cookie, passing the name into the constructor
                    HttpCookie cookie = new HttpCookie("UserInfo");
                    HttpCookie cookie1 = new HttpCookie("PassInfo");

                    //Set the cookies value
                    cookie.Value = objLoginModel.LogUserName;
                    cookie1.Value = objLoginModel.LogPassword;

                    //Set the cookie to expire in 1 minute
                    DateTime dtNow = DateTime.Now.AddDays(30);

                    cookie.Expires = dtNow;
                    cookie1.Expires = dtNow;

                    //Add the cookie
                    Response.Cookies.Add(cookie);
                    Response.Cookies.Add(cookie1);
                }

                SessionStore.SetSessionValue(SessionStore.Memberobject, memberData);
                string requestURL = (string)SessionStore.GetSessionValue("RequestedURL");
                SessionStore.SetSessionValue("RequestedURL", null);

                if (memberData.Role.name == SystemStatements.ROLE_SUPER_ADMIN)
                {
                    if (!string.IsNullOrEmpty(requestURL))
                        return Redirect(requestURL);
                    else
                        return RedirectToAction("AdminDashboard", "Admin");
                }
                else if (memberData.Role.name == SystemStatements.ROLE_END_USER)
                {
                    if (!string.IsNullOrEmpty(requestURL))
                    {
                        //Response.Redirect(requestURL);
                        return Redirect(requestURL);
                    }
                    else
                    {
                        //return RedirectToAction("Dashboard", "Member");
                        return RedirectToAction("Default", "Member");
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(requestURL))
                        return Redirect(requestURL);
                    else
                    {
                        //return RedirectToAction("Dashboard", "Member");
                        return RedirectToAction("Default", "Member");
                    }
                }
            }
            else
            {
                ModelState.AddModelError("", "Login failed for current user.");
            }
            return View("Default");
            #endregion
        }
Exemplo n.º 15
0
 public ActionResult LikeSeedPartial(string SLikedid, string partialLike)
 {
     #region
     SeedAction objSeed = new SeedAction();
     Seed seedData = objSeed.GetSeedBySeedId(SLikedid);
     seedData.status = SystemStatements.STATUS_GROWING;
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     MemberAction objMember = new MemberAction();
     bool isDone = objMember.LikeUnlike(memberData.id.ToString(), SLikedid, partialLike);
     seedData = objSeed.GetSeedBySeedId(SLikedid);
     ViewData["LikeData"] = seedData.id;
     return PartialView("LikePartial");
     #endregion
 }
Exemplo n.º 16
0
        public ActionResult UploadProfileImage(HttpPostedFileBase upProfileImage, string btnUpProfileImage, string x1, string y1, string x2, string y2, string w, string h)
        {
            #region
            MemberAction objMember = new MemberAction();
            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            Privacy privacyData = objMember.GetPrivacyByMemberId(memberData.id);

            if (btnUpProfileImage == null)
            {
                Session["ContentLength"] = null;
                Session["ContentType"] = null;
                Session["ContentStream"] = null;

                Session["ContentLength"] = Request.Files[0].ContentLength;
                Session["ContentType"] = Request.Files[0].ContentType;
                byte[] b = new byte[Request.Files[0].ContentLength];
                Request.Files[0].InputStream.Read(b, 0, Request.Files[0].ContentLength);
                Session["ContentStream"] = b;
                return Content(Request.Files[0].ContentType + ";" + Request.Files[0].ContentLength);
            }
            else
            {
                #region Code to upload profile image
                int X1 = Convert.ToInt32(x1);
                int Y1 = Convert.ToInt32(y1);
                int X2 = Convert.ToInt32(x2);
                int Y2 = Convert.ToInt32(y2);
                int X = System.Math.Min(X1, X2);
                int Y = System.Math.Min(Y1, Y2);
                int w1 = Convert.ToInt32(w);
                int h1 = Convert.ToInt32(h);
                // That can be any image type (jpg,jpeg,png,gif) from any where in the local server
                if (!Directory.Exists(Server.MapPath("~/jcrop/tempImage/")))
                {
                    Directory.CreateDirectory(Server.MapPath("~/jcrop/tempImage/"));
                }
                string OPath = Server.MapPath("~/jcrop/tempImage/");
                upProfileImage.SaveAs(OPath + "temp.png");
                string originalFile = Server.MapPath("~/jcrop/tempImage/") + "temp.png";

                using (Image img = Image.FromFile(originalFile))
                {
                    using (System.Drawing.Bitmap _bitmap = new System.Drawing.Bitmap(w1, h1))
                    {
                        _bitmap.SetResolution(img.HorizontalResolution, img.VerticalResolution);
                        using (Graphics _graphic = Graphics.FromImage(_bitmap))
                        {
                            _graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
                            _graphic.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                            _graphic.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
                            _graphic.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
                            _graphic.DrawImage(img, 0, 0, w1, h1);
                            _graphic.DrawImage(img, new Rectangle(0, 0, w1, h1), X, Y, w1, h1, GraphicsUnit.Pixel);

                            string extension = Path.GetExtension(originalFile);

                            string croppedFileName = memberData.id.ToString();

                            if (!Directory.Exists(Server.MapPath("~/UploadedMedia/")))
                            {
                                Directory.CreateDirectory(Server.MapPath("~/UploadedMedia/"));
                            }
                            string path = Server.MapPath("~/UploadedMedia/");

                            // If the image is a gif file, change it into png
                            if (extension.EndsWith("gif", StringComparison.OrdinalIgnoreCase))
                            {
                                extension = ".png";
                            }

                            string newFullPathName = string.Concat(path, croppedFileName, extension);

                            using (System.Drawing.Imaging.EncoderParameters encoderParameters = new System.Drawing.Imaging.EncoderParameters(1))
                            {
                                encoderParameters.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L);
                                _bitmap.Save(newFullPathName, GetImageCodec(extension), encoderParameters);
                            }
                            ViewData["CropImage"] = "~/UploadedMedia/" + croppedFileName + extension;
                            string upPath = "../../UploadedMedia/" + croppedFileName + extension;
                            bool isMediaSaved = SaveProfileImage(upPath);
                            if (isMediaSaved == true)
                            {
                                ViewData["ProfileImageMsg"] = "<b>Image has been uploaded successfully.</b>";
                                memberData = objMember.GetMemberByMemberId(memberData.id.ToString());
                                memberData.MemberProfiles.FirstOrDefault().imagePath = upPath;
                                SessionStore.SetSessionValue(SessionStore.Memberobject, memberData);
                            }
                        }
                    }
                }
                #endregion
            }
            ViewData["SelectedIndex"] = 0;
            GetRegions();
            MyUsername(privacyData);
            SeedContributionMessage(privacyData);
            SeedCommitmentMessage(privacyData);
            GetExternalAccountList();
            GetExternalAccountList();
            GetProfileData();
            ViewData["LoggedInMember"] = memberData.id.ToString();
            return View("Profile");
            #endregion
        }
Exemplo n.º 17
0
        public ActionResult UserDetail(string id)
        {
            #region
            Member memData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            if (memData != null)
            {
                if (Convert.ToString(memData.id) == id)
                    ViewData["ProfileView"] = "Self";
                else
                    ViewData["ProfileView"] = "Other";
            }
            MemberAction objMember = new MemberAction();
            Member memberData = objMember.GetMemberByMemberId(id);
            ViewData["MemberInfo"] = memberData;

            SeedAction objSeed = new SeedAction();
            IList<Seed> listSeed = objSeed.GetSeedsByUser(id).ToList();

            ViewData["ListSeed"] = listSeed;

            IList<Member> followerMemberList = objMember.GetFollowers(id);
            IList<Member> followingMemberList = objMember.GetFollowing(id);
            IList<Seed> seedList = objMember.GetFollowingActivity(id);
            ViewData["LatestActivity"] = seedList;
            ViewData["Following"] = followingMemberList;
            ViewData["Followers"] = followerMemberList;

            IList<Seed> FavSeeds = objSeed.GetAllFavouriteSeeds(id);
            ViewData["FavSeeds"] = FavSeeds;

            StreamAction objStream = new StreamAction();
            IList<ssStream> lstFeeds = objStream.GetAllStreams(id);
            IList<ssStream> lstMyFeeds = lstFeeds.Where(x => x.streamType.Equals(SystemStatements.STREAM_FEED)).OrderByDescending(x => x.createDate).ToList();
            IList<ssStream> lstMyLists = lstFeeds.Where(x => x.streamType.Equals(SystemStatements.STREAM_HANDPICKED)).OrderByDescending(x => x.createDate).ToList();

            ViewData["UserFeeds"] = lstMyFeeds;
            ViewData["UserLists"] = lstMyLists;

            IList<Seed> LatestActivity = objMember.GetFollowingActivity(id);
            ViewData["LatestActivity"] = LatestActivity;

            string[] counts = new string[7];
            counts[0] = Convert.ToString(listSeed.Count());
            counts[1] = Convert.ToString(FavSeeds.Count());
            counts[2] = Convert.ToString(followerMemberList.Count());
            counts[3] = Convert.ToString(lstMyFeeds.Count());
            counts[4] = Convert.ToString(lstMyLists.Count());
            counts[5] = Convert.ToString(followingMemberList.Count());
            counts[6] = Convert.ToString(LatestActivity.Count());
            ViewData["Counts"] = counts;

            ViewData["ParentTabSelectedIndex"] = 0;
            ViewData["ChildTabSelectedIndex"] = 0;
            if (Request.QueryString["PlantedSeedsgridbox-page"] != null)
                ViewData["ParentTabSelectedIndex"] = 0;
            if (Request.QueryString["Likesgridbox-page"] != null)
                ViewData["ParentTabSelectedIndex"] = 1;
            if (Request.QueryString["gridboxFeeds-page"] != null)
                ViewData["ParentTabSelectedIndex"] = 3;
            if (Request.QueryString["gridboxLists-page"] != null)
                ViewData["ParentTabSelectedIndex"] = 4;
            if (Request.QueryString["Following-page"] != null)
            {
                ViewData["ParentTabSelectedIndex"] = 2;
                ViewData["ChildTabSelectedIndex"] = 0;
            }
            if (Request.QueryString["Followers-page"] != null)
            {
                ViewData["ParentTabSelectedIndex"] = 2;
                ViewData["ChildTabSelectedIndex"] = 1;
            }
            if (Request.QueryString["LatestActivitygridbox-page"] != null)
            {
                ViewData["ParentTabSelectedIndex"] = 2;
                ViewData["ChildTabSelectedIndex"] = 2;
            }

            return View();
            #endregion
        }
Exemplo n.º 18
0
 public ActionResult Profile(ProfileModel objProfileModel, string userFName, string userLName, string setURL, string userBio)
 {
     #region
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     MemberAction objMember = new MemberAction();
     Privacy privacyData = objMember.GetPrivacyByMemberId(memberData.id);
     if (!string.IsNullOrEmpty(setURL))
         setURL = "www.seedspeak.com/" + setURL;
     bool isProfileUpdated = objMember.ManageMemberProfile(memberData, objProfileModel.City, objProfileModel.ZipCode, double.Parse(objProfileModel.Latitude), double.Parse(objProfileModel.Longitude), objProfileModel.Sex, objProfileModel.Dob, setURL, userBio);
     if (!string.IsNullOrEmpty(userFName) || !string.IsNullOrEmpty(userLName))
     {
         memberData.firstName = userFName;
         memberData.lastName = userLName;
         bool updated = objMember.UpdateMember(memberData);
         if (updated == true)
         {
             ViewData["PersonalMsg"] = "<b>Name updated successfully.</b>";
         }
         else
         {
             ViewData["PersonalMsg"] = "Error while updating name.";
         }
     }
     if (isProfileUpdated == true)
     {
         ViewData["PersonalMsg"] = "<b>Profile updated successfully.</b>";
     }
     else
     {
         ViewData["PersonalMsg"] = "Error occured while updating profile.";
     }
     ViewData["SelectedIndex"] = 0;
     GetRegions();
     MyUsername(privacyData);
     SeedContributionMessage(privacyData);
     SeedCommitmentMessage(privacyData);
     GetExternalAccountList();
     GetProfileData();
     ViewData["LoggedInMember"] = memberData.id.ToString();
     return View(objProfileModel);
     #endregion
 }
Exemplo n.º 19
0
 //Check Unread Likes
 public void CheckUnreadLikes(string ids)
 {
     if (!ids.Equals("undefined") && !string.IsNullOrEmpty(ids))
     {
         string[] strSplitArr = ids.Split(';');
         MemberAction objMemberAction = new MemberAction();
         if (strSplitArr.Length > 0)
         {
             for (int i = 0; i <= strSplitArr.Length - 1; i++)
             {
                 if (!string.IsNullOrEmpty(strSplitArr[i].ToString()))
                     objMemberAction.UpdateMemberLikes(new Guid(strSplitArr[i].ToString()));
             }
         }
     }
 }
Exemplo n.º 20
0
 public void RegionCode()
 {
     LocationAction objLocation = new LocationAction();
     MemberAction objMember = new MemberAction();
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     IList<Model.Region> lstRegion = objLocation.GetAllRegions();
     ViewData["RegionList"] = new SelectList(lstRegion, "code", "code");
 }
Exemplo n.º 21
0
 private void GetExternalAccountList()
 {
     MemberAction objMember = new MemberAction();
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     IList<ExternalAccount> listAccount = objMember.GetExternalAccountsList(memberData.id.ToString()).ToList();
     ViewData["AccountList"] = listAccount;
 }
Exemplo n.º 22
0
        public ActionResult SignUpThanks(string LogUserName, string LogPassword)
        {
            MemberAction objMember = new MemberAction();
            Member memberData = objMember.Authenticate(LogUserName, LogPassword);

            if (memberData != null)
            {
                SessionStore.SetSessionValue(SessionStore.Memberobject, memberData);
                if (memberData.Role.name == SystemStatements.ROLE_SUPER_ADMIN)
                    return RedirectToAction("AdminDashboard", "Admin");
                else if (memberData.Role.name == SystemStatements.ROLE_END_USER)
                    return RedirectToAction("Dashboard", "Member");
                else
                    return RedirectToAction("Dashboard", "Member");
            }
            else
            {
                ModelState.AddModelError("", "Login failed for current user.");
            }
            return View();
        }
Exemplo n.º 23
0
        // *************************************
        // URL: /Member/ManageProfile
        // *************************************
        private void GetRegions()
        {
            #region
            LocationAction objLocation = new LocationAction();
            MemberAction objMember = new MemberAction();

            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);

            Location locData = objLocation.GetLocationDetailByMemberId(memberData.id.ToString());

            string cityId = "";
            string regionId = "";

            if (locData != null)
            {
                if (locData.City != null)
                {
                    cityId = locData.City.id.ToString();

                    if (locData.City.Region != null)
                    {
                        regionId = locData.City.Region.id.ToString();
                    }
                }
            }

            IList<Model.Region> lstRegionItem = objLocation.GetAllRegions();

            ViewData["CityId"] = cityId;

            if (regionId.Length > 0)
            {
                Model.Region selLstRegionItem = objLocation.GetRegionById(regionId);
                ViewData["RegionItem"] = new SelectList(lstRegionItem, "id", "name", selLstRegionItem.id);
            }
            else
            {
                ViewData["RegionItem"] = new SelectList(lstRegionItem, "id", "name");
            }
            #endregion
        }
Exemplo n.º 24
0
        public ActionResult SignUpUser(RegisterModel objRegModel, string captcha)
        {
            #region Code for Registration
            MemberAction objMember = new MemberAction();
            bool isUserExist = objMember.FindByUserName(objRegModel.UserName.Trim());

            if (isUserExist)
            {
                ModelState.AddModelError("", "User Already exist. Please change Username.");
            }
            else
            {
                bool isRegistered = objMember.Signup(objRegModel);
                if (isRegistered == true)
                {
                    #region Send Mail if Registration Successful
                    //send automated email - content of email will be decided later
                    // Creating array list for token
                    ArrayList arrTokens = new ArrayList();
                    arrTokens.Add(objRegModel.FirstName + " " + objRegModel.LastName);
                    arrTokens.Add("http://" + Request.ServerVariables["SERVER_NAME"] + "/Member/Dashboard");
                    arrTokens.Add("http://" + Request.ServerVariables["SERVER_NAME"] + "/Seed/DiscoverSeed");
                    arrTokens.Add("http://" + Request.ServerVariables["SERVER_NAME"] + "/Member/Profile");

                    // Filling mail object
                    SendMail objSendMail = new SendMail();
                    objSendMail.ToEmailId = objRegModel.UserName;
                    objSendMail.Subject = "email.member.signup.subject.content";
                    objSendMail.MsgBody = "email.member.signup.body.content";
                    objSendMail.ChangesInMessage = arrTokens;

                    objSendMail.SendEmail(objSendMail);//    SendMail.(member.username, SystemStatements.DEFAUL_EMAIL_ADDRESS, SystemStatements.EMAIL_SUBJECT_SIGNUP, "");
                    #endregion

                    return RedirectToAction("SignUpThanks", "Member");
                }
                else
                {
                    ModelState.AddModelError("", "Error occured while registration.");
                }
            }
            return View("Default");
            #endregion
        }
Exemplo n.º 25
0
 //Check Unread Notifications
 public void CheckUnreadNotifications(string id)
 {
     if (!id.Equals("undefined") && !string.IsNullOrEmpty(id))
     {
         MemberAction objMember = new MemberAction();
         string[] notifyIds = id.Split(',');
         for (int i = 0; i < notifyIds.Count(); i++)
         {
             if (notifyIds[i + 1] == "Comment")
             {
                 objMember.UpdateMemberComments(new Guid(notifyIds[i]));
             }
             else if (notifyIds[i + 1] == "Flag")
             {
                 objMember.UpdateMemberFlags(new Guid(notifyIds[i]));
             }
             else if (notifyIds[i + 1] == "Rating")
             {
                 objMember.UpdateMemberLikes(new Guid(notifyIds[i]));
             }
             i++;
         }
     }
 }
Exemplo n.º 26
0
        public ActionResult TopPeople(string peopleSearch)
        {
            #region
            MemberAction objMember = new MemberAction();
            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            //Search User by name
            IList<Member> memberSearchList = objMember.GetMembersByName(peopleSearch);
            if (memberSearchList.Count > 0)
            {
                ViewData["MostActive"] = memberSearchList;
                SessionStore.SetSessionValue(SessionStore.PeopleSearch, memberSearchList);
            }
            else
            {
                //Most Active if search does not return result
                IList<Member> memberList = objMember.GetAllMember();
                if (memberData != null)
                {
                    memberList = memberList.Where(x => x.id != memberData.id).OrderByDescending(x => x.Seeds.Count()).ToList();
                }
                else
                {
                    memberList = memberList.OrderByDescending(x => x.Seeds.Count()).ToList();
                }
                ViewData["MostActive"] = memberList;
                ViewData["NoResult"] = "Your search did not return any result, showing most active users";
            }

            //Nearby Users
            CommonMethods objCmnMethods = new CommonMethods();
            string strIpAddress = System.Web.HttpContext.Current.Request.UserHostAddress;
            if (strIpAddress == "127.0.0.1")
                strIpAddress = "61.246.241.162";

            string ipLocation = objCmnMethods.IP2AddressAPI(strIpAddress);
            string zipCodeSearch = string.Empty;
            string[] currentAddress;
            if (!string.IsNullOrEmpty(ipLocation))
            {
                //IPaddressAPI
                currentAddress = ipLocation.Split(',');

                if (string.IsNullOrEmpty(currentAddress[7].Replace("\"", "").ToString()))
                    zipCodeSearch = "85027";
                else
                    zipCodeSearch = currentAddress[7].Replace("\"", "").ToString();
            }
            else
            {
                //MaxMind
                ipLocation = objCmnMethods.IP2AddressMaxMind();
                currentAddress = ipLocation.Split('\'');

                if (string.IsNullOrEmpty(currentAddress[15].ToString()))
                    zipCodeSearch = "85027";
                else
                    zipCodeSearch = currentAddress[15].ToString();
            }
            IList<Member> lstMember = new List<Member>();
            if (memberData != null)
                lstMember = objMember.GetMembersByZip(zipCodeSearch).Where(x => x.id != memberData.id).ToList();
            else
                lstMember = objMember.GetMembersByZip(zipCodeSearch);
            ViewData["NearbyUsers"] = lstMember.Distinct().ToList();
            return View();
            #endregion
        }
Exemplo n.º 27
0
        public string CheckUserSignUp(string userName, string captaText, string checkString)
        {
            bool isUserFind;
            string userMessage = "true";
            //  string captchaValue = SessionStore.GetSessionValue(SessionStore.Captcha).ToString();

            MemberAction objMember = new MemberAction();
            isUserFind = objMember.FindByUserName(userName);

            MvcReCaptcha.CaptchaValidatorAttribute valAttributr = new MvcReCaptcha.CaptchaValidatorAttribute();

            bool isCaptchaMatch = valAttributr.myValidator(checkString, captaText);

            if (isUserFind)
            {
                userMessage = "User already exist, Please enter different email";
            }
            else if (isCaptchaMatch == false)
            {
                userMessage = "Captcha value is not valid";
            }

            JavaScriptSerializer serializer = new JavaScriptSerializer();
            var output = serializer.Serialize(userMessage);

            return output;
        }
Exemplo n.º 28
0
 public ActionResult UpdateOrganization(string newOrg)
 {
     #region
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     MemberAction objMember = new MemberAction();
     Privacy privacyData = objMember.GetPrivacyByMemberId(memberData.id);
     bool updated = objMember.UpdateOrganization(newOrg, memberData.id.ToString());
     if (updated == true)
     {
         ViewData["UpdateOrg"] = "<b>Organization updated successfully.</b>";
         memberData = objMember.GetMemberByMemberId(memberData.id.ToString());
         memberData.organisationName = newOrg;
         SessionStore.SetSessionValue(SessionStore.Memberobject, memberData);
     }
     else
     {
         ViewData["UpdateOrg"] = "Error while updating organization.";
     }
     ViewData["SelectedIndex"] = 2;
     GetRegions();
     MyUsername(privacyData);
     SeedContributionMessage(privacyData);
     SeedCommitmentMessage(privacyData);
     GetExternalAccountList();
     GetProfileData();
     ViewData["LoggedInMember"] = memberData.id.ToString();
     return View("Profile");
     #endregion
 }
Exemplo n.º 29
0
 public ActionResult ExternalAccounts(ProfileModel objExternalModel)
 {
     #region
     Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
     MemberAction objMember = new MemberAction();
     Privacy privacyData = objMember.GetPrivacyByMemberId(memberData.id);
     SeedSpeak.Model.ExternalAccount extAccount = new SeedSpeak.Model.ExternalAccount();
     extAccount.accountTye = objExternalModel.AccountType;
     extAccount.username = objExternalModel.Username;
     extAccount.passwd = objExternalModel.Password;
     extAccount.verified = false;
     bool saved = objMember.ManageExternalAccount(memberData, extAccount);
     if (saved == true)
     {
         ViewData["ExternalMsg"] = "<b>External account saved succesfully.</b>";
     }
     else
     {
         ViewData["ExternalMsg"] = "Problem saving external account.";
     }
     ViewData["SelectedIndex"] = 2;
     GetRegions();
     MyUsername(privacyData);
     SeedContributionMessage(privacyData);
     SeedCommitmentMessage(privacyData);
     GetExternalAccountList();
     GetExternalAccountList();
     GetProfileData();
     ViewData["LoggedInMember"] = memberData.id.ToString();
     return View("Profile");
     #endregion
 }
Exemplo n.º 30
0
        public ActionResult UpdateUserName(ProfileModel objNewEmail)
        {
            #region
            Member memberData = (Member)SessionStore.GetSessionValue(SessionStore.Memberobject);
            MemberAction objMember = new MemberAction();
            Privacy privacyData = objMember.GetPrivacyByMemberId(memberData.id);
            string newemail = objNewEmail.NewEmail.ToString();
            bool updated = objMember.UpdateUserName(newemail, memberData.id.ToString());
            if (updated == true)
            {
                //send automated email
                // Creating array list for token
                ArrayList arrTokens = new ArrayList();
                arrTokens.Add(memberData.firstName + " " + memberData.lastName);
                arrTokens.Add(newemail);

                // Filling mail object
                SendMail objSendMail = new SendMail();
                objSendMail.ToEmailId = newemail;
                objSendMail.Subject = "email.member.usernameChange.subject.content";
                objSendMail.MsgBody = "email.member.usernameChange.body.content";
                objSendMail.ChangesInMessage = arrTokens;
                objSendMail.SendEmail(objSendMail);
                ViewData["UpdateLoginMsg"] = "<b>Username updated successfully.</b>";
            }
            else
            {
                ViewData["UpdateLoginMsg"] = "Error while updating username.";
            }
            ViewData["SelectedIndex"] = 2;
            GetRegions();
            MyUsername(privacyData);
            SeedContributionMessage(privacyData);
            SeedCommitmentMessage(privacyData);
            GetExternalAccountList();
            GetProfileData();
            ViewData["LoggedInMember"] = memberData.id.ToString();
            return View("Profile");
            #endregion
        }