问题描述
刚接触EF,了解不多还请大神们帮助!!!!if(ModelState.IsValid){stringcode=Request["txtRUValidetaCode"];if(!string.IsNullOrEmpty(code)){if(Session["code"]!=null){if(Session["code"].ToString().ToLower().Equals(code.ToLower())){model.U_id=System.Guid.NewGuid().ToString();model.U_pwd=MD5.LoadMD5(model.U_pwd);//密码加密后数据存储不了,不执行DbEntityEntry<U_user>enty=db.Entry(model);enty.State=System.Data.EntityState.Added;db.SaveChanges();returnJson(new{State="ok",Msg="注册成功"});}else{returnJson(new{State="Yanzhenma",Msg="验证码错误!"});}}else{returnJson(new{State="Yanzhenma",Msg="验证码过期!"});}}else{returnJson(new{State="Yanzhenma",Msg="请输入验证码!"});}}returnJson(new{State="Error",Msg="控件值校验失败!"});
时间: 2024-09-15 02:54:58