//二 代码 /// <summary> /// /// </summary> /// <param name="Ok"></param> /// <returns></returns> public ActionResult UserLogin(B_Unamelist Ok) { string strMsg = "fail"; B_Unamelist MyUL = new B_Unamelist(); MyUL.uname = Ok.uname; MyUL.pwd = Ok.pwd; var dbStaff = (from tbStaff in myModels.B_Unamelist where tbStaff.uname == MyUL.uname && tbStaff.pwd == MyUL.pwd || tbStaff.phone == MyUL.uname && tbStaff.pwd == MyUL.pwd select new DaXingShangMaoSystem.LY.PeiHuoDan { UnameID = tbStaff.UnameID, QiDongName = tbStaff.uname, Remarks = tbStaff.pwd, P_Remember = tbStaff.phone }).ToList(); if (dbStaff.Count > 0) { Session["UnameID"] = dbStaff[0].UnameID; strMsg = "login"; } else { strMsg = "UnNimeHuoPawssFail"; } return(Json(strMsg, JsonRequestBehavior.AllowGet)); }
public ActionResult InsertUname() { B_Unamelist KK = new B_Unamelist(); KK.uname = Request.Form["uname"]; KK.phone = Request.Form["phone"]; KK.pwd = Common.AESEncryptHelper.Encrypt(Request.Form["pwd"]); KK.pwd = Request.Form["pwd"]; KK.useof = Convert.ToBoolean(Request.Form["useof"]); if (KK.uname != null && KK.phone != null && KK.pwd != null && KK.useof != null) { myModels.B_Unamelist.Add(KK); myModels.SaveChanges(); return(Json("success", JsonRequestBehavior.AllowGet)); } else { return(Json("fail", JsonRequestBehavior.AllowGet)); } }