public ActionResult ChangePSD(Forgot_Password fp) { try { if (true) { if (fp.Password == fp.ConfirmPassword) { if (db.PA_MOB_CUST_SIGHN_UP.AsEnumerable().Where(x => x.CUST_ID == fp.CUST_ID).Count() > 0) { PA_MOB_CUST_SIGHN_UP cfs = db.PA_MOB_CUST_SIGHN_UP.AsEnumerable().Where(x => x.CUST_ID == fp.CUST_ID).SingleOrDefault(); cfs.PASSWORD = EncryptDecrypt.Encrypt(fp.Password); db.Entry(cfs).State = EntityState.Modified; db.SaveChanges(); } ViewBag.msg = "Password Succefully Changed ."; } return(View("Change_Password")); } } catch (Exception ex) { throw (ex); } }
public bool VerifyAccount(int Customer_id, string Date, string Tm) { try { TimeSpan time = TimeSpan.Parse(Tm); DateTime f_time = DateTime.ParseExact(Date, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime f_time112 = f_time + time; DateTime d1 = new DateTime(f_time112.Year, f_time112.Month, f_time112.Day, f_time112.Hour, f_time112.Minute, f_time112.Second); DateTime d2 = d1.AddHours(2); DateTime d3 = DateTime.Now; int res = DateTime.Compare(d2, d3); if (res > 0) { PA_MOB_CUST_SIGHN_UP cfs = dbCon.PA_MOB_CUST_SIGHN_UP.AsEnumerable().Where(x => x.CUST_ID == Customer_id).SingleOrDefault(); cfs.ISACTIVE = true;; dbCon.SaveChanges(); dbCon.Entry(cfs).State = EntityState.Detached; return(true); //ViewBag.verifiedAccount = "Your Account verified Sucessfully Now Uou can Log in from App."; } else { return(false); //ViewBag.verifiedAccount = "Sorry Link Validity Has Been Expired"; } //return View("VerifyAccount"); } catch (Exception ex) { throw (ex); } }
public void updateprofile(profileupdate prof) { try { bool tknVld = GF.ValidateToken(prof.DEVICE_ID, prof.TOKEN); if (tknVld == true) { PA_MOB_CUST_SIGHN_UP cfs = db.PA_MOB_CUST_SIGHN_UP.AsEnumerable().Where(x => x.EMAIL_ID.ToUpper().Trim() == prof.USER_ID.ToUpper().Trim() && x.ISACTIVE == true).SingleOrDefault(); if (cfs != null) { cfs.MOBILE_NO = prof.MOBILE_NO; cfs.ADDRESS = prof.ADDRESS; db.SaveChanges(); db.Entry(cfs).State = EntityState.Detached; var routData = new CMNObject { STATUS_CODE = 200, MESSAGE = "Profile Successfully Updated" }; json = JsonConvert.SerializeObject(routData, Formatting.Indented); } else { var routedata = new CMNObject { STATUS_CODE = 401, MESSAGE = "Invalid USER ID" }; json = JsonConvert.SerializeObject(routedata, Formatting.Indented); } } else { var routedata = new CMNObject { STATUS_CODE = 401, MESSAGE = "Invalid User" }; json = JsonConvert.SerializeObject(routedata, Formatting.Indented); } } catch (Exception ex) { var routData = new CMNObject { STATUS_CODE = 401, MESSAGE = ex.Message }; json = JsonConvert.SerializeObject(routData, Formatting.Indented); } HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Buffer = true; HttpContext.Current.Response.Charset = "UTF-8"; HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8; HttpContext.Current.Response.ContentType = "application/json"; HttpContext.Current.Response.Write(json); HttpContext.Current.Response.End(); }