public JsonResult RegisterConfirm(int regId) { T_USER_DATA Data = db.T_USER_DATA.Where(x => x.ID == regId).FirstOrDefault(); Data.Isvalid = true; Data.ValidTime = DateTime.Now; db.SaveChanges(); var msg = "Your Email Is Verified!"; return(Json(msg, JsonRequestBehavior.AllowGet)); }
public JsonResult CheckValidUser(T_USER_DATA model) { string result = "Fail"; var DataItem = db.T_USER_DATA.Where(x => x.UserID == model.UserID && x.Password == model.Password).SingleOrDefault(); if (DataItem != null) { Session["ID"] = DataItem.ID.ToString(); Session["UserID"] = DataItem.UserID.ToString(); result = "Success"; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult SaveResponseData(FormCollection formData) { var maxID = db.T_USER_DATA.Max(n => n.ID); if (maxID != 0) { maxID++; } else { maxID = 1; //int v = Convert.ToInt32(DateTime.Now.ToString("yyyyMMdd") + "0001"); //NewID = v; } T_USER_DATA t_USER_DATA = new T_USER_DATA() { ID = maxID, UserID = formData[0], Username = formData[1], Phone = formData[2], Email = formData[3], Password = formData[4] }; //int rowLength = db.T_USER_DATA.Count(rowLength); //for(int i = 0; i < rowLength; i++) //{ // i = t_USER_DATA.ID; //} t_USER_DATA.Isvalid = false; db.T_USER_DATA.Add(t_USER_DATA); db.SaveChanges(); BuildEmailTemplate(t_USER_DATA.ID); return(RedirectToAction("Success")); }