//Modified by Sumit Gupta [31-01-15] public ActionResult ChangePassword(string id, string oldpass, string newpass, string confirmpass) { User objUser = (User)Session["User"]; Api.User.User ApiobjUser = new Api.User.User(); //UserRepository userrepo = new UserRepository(); //Domain.Socioboard.Domain.User user = ApiobjUser.getUserInfoByEmail(; string user = ApiobjUser.getUserInfoByEmail(id); string ret = string.Empty; if (newpass.Equals(confirmpass)) { //Modified by Sumit Gupta [31-01-15] //ret = ApiobjUser.ChangePassword(id, oldpass, newpass); ret = ApiobjUser.ChangePasswordWithoutOldPassword(id, "", newpass); } else { ret = "New Password and Confirm Password mismatch"; } //string ret = ApiobjUser.UpdateUser(id, fname, lname, dt); //if (ret == "1") //{ // objUser.UserName = fname + " " + lname; // objUser.TimeZone = dt; // Session["User"] = objUser; //} return(Content(ret)); }
//Modified by Sumit Gupta [31-01-15] public ActionResult ChangePassword(string id, string oldpass, string newpass, string confirmpass) { User objUser = (User)Session["User"]; Api.User.User ApiobjUser = new Api.User.User(); //UserRepository userrepo = new UserRepository(); //Domain.Socioboard.Domain.User user = ApiobjUser.getUserInfoByEmail(; string user = ApiobjUser.getUserInfoByEmail(id); Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User) new JavaScriptSerializer().Deserialize(user, typeof(Domain.Socioboard.Domain.User)); string ret = string.Empty; if (newpass.Equals(confirmpass)) { if (!_User.Password.Equals(SBUtils.MD5Hash(confirmpass))) { ret = ApiobjUser.ChangePasswordWithoutOldPassword(id, "", newpass); } else { ret = "New Password and Old Password is same"; } } else { ret = "New Password and Confirm Password mismatch"; } //string ret = ApiobjUser.UpdateUser(id, fname, lname, dt); //if (ret == "1") //{ // objUser.UserName = fname + " " + lname; // objUser.TimeZone = dt; // Session["User"] = objUser; //} return(Content(ret)); }
//Modified by Sumit Gupta [31-01-15] public ActionResult ChangePassword(string id, string oldpass, string newpass, string confirmpass) { User objUser = (User)Session["User"]; Api.User.User ApiobjUser = new Api.User.User(); //UserRepository userrepo = new UserRepository(); //Domain.Socioboard.Domain.User user = ApiobjUser.getUserInfoByEmail(; string user = ApiobjUser.getUserInfoByEmail(id); string ret = string.Empty; if (newpass.Equals(confirmpass)) { //Modified by Sumit Gupta [31-01-15] //ret = ApiobjUser.ChangePassword(id, oldpass, newpass); ret = ApiobjUser.ChangePasswordWithoutOldPassword(id, "", newpass); } else { ret = "New Password and Confirm Password mismatch"; } //string ret = ApiobjUser.UpdateUser(id, fname, lname, dt); //if (ret == "1") //{ // objUser.UserName = fname + " " + lname; // objUser.TimeZone = dt; // Session["User"] = objUser; //} return Content(ret); }
//Modified by Sumit Gupta [31-01-15] public ActionResult ChangePassword(string id, string oldpass, string newpass, string confirmpass) { User objUser = (User)Session["User"]; Api.User.User ApiobjUser = new Api.User.User(); //UserRepository userrepo = new UserRepository(); //Domain.Socioboard.Domain.User user = ApiobjUser.getUserInfoByEmail(; string user = ApiobjUser.getUserInfoByEmail(id); Domain.Socioboard.Domain.User _User=(Domain.Socioboard.Domain.User)new JavaScriptSerializer().Deserialize(user,typeof(Domain.Socioboard.Domain.User)); string ret = string.Empty; if (newpass.Equals(confirmpass)) { if (!_User.Password.Equals(SBUtils.MD5Hash(confirmpass))) { ret = ApiobjUser.ChangePasswordWithoutOldPassword(id, "", newpass); } else { ret = "New Password and Old Password is same"; } } else { ret = "New Password and Confirm Password mismatch"; } //string ret = ApiobjUser.UpdateUser(id, fname, lname, dt); //if (ret == "1") //{ // objUser.UserName = fname + " " + lname; // objUser.TimeZone = dt; // Session["User"] = objUser; //} return Content(ret); }