public ActionResult Reg(string username, string password, string phone, string sex, string name) { if ("".Equals(username) || "".Equals(password) || "".Equals(phone) || "".Equals(sex) || "".Equals(name)) { return(View()); } User user = UserService.AddEntity(new User { username = username, password = password, isSys = "0" }); UserInfo userInfo = UserInfoService.AddEntity(new UserInfo { name = name, sex = sex, phone = phone, }); UserUserInfoService.AddEntity(new UserUserInfo { uid = user.uid, uiid = userInfo.uiid, pubTime = DateTime.Now.ToString("yyyyMMdd") }); return(RedirectToAction("Login", "User")); }
public JsonResult addUser(UserUserInfoEntity entity) { User user = UserService.AddEntity(new User { username = entity.username, password = entity.password, isSys = entity.isSys }); if (entity.isSys == "1") { UserAuthService.AddEntity(new UserAuth { main = "0", users = "0", orders = "0", house = "0", others = "0", uid = user.uid }); } UserInfo userInfo = UserInfoService.AddEntity(new UserInfo { name = entity.name, sex = entity.sex, phone = entity.phone }); UserUserInfoService.AddEntity(new UserUserInfo { uid = user.uid, uiid = userInfo.uiid, pubTime = DateTime.Now.ToString("yyyyMMdd") }); return(Json("success", JsonRequestBehavior.AllowGet)); }