/// <summary> /// 个人信息修改界面 /// </summary> /// <param name="account"></param> /// <returns></returns> public ActionResult UserSingle(Guid account) { Model.ViewObject.Sex sex1 = new Model.ViewObject.Sex("1", "男"); Model.ViewObject.Sex sex2 = new Model.ViewObject.Sex("0", "女"); List <Model.ViewObject.Sex> sexList = new List <Model.ViewObject.Sex>(); sexList.Add(sex1); sexList.Add(sex2); SelectList selectlistSex = new SelectList(sexList, "numstring", "showstring"); ViewBag.Sex = selectlistSex; Model.BussionObject.UserShow_BO res = userSer.ModiUser(account); return(View(res)); }
public ActionResult UserSingle(Model.BussionObject.UserShow_BO model) { try { Model.ViewObject.Sex sex1 = new Model.ViewObject.Sex("1", "男"); Model.ViewObject.Sex sex2 = new Model.ViewObject.Sex("0", "女"); List <Model.ViewObject.Sex> sexList = new List <Model.ViewObject.Sex>(); sexList.Add(sex1); sexList.Add(sex2); SelectList selectlistSex = new SelectList(sexList, "numstring", "showstring"); ViewBag.Sex = selectlistSex; if (ModelState.IsValid) { var cres = userSer.ValidAccount(model.boAccount); if (cres > 0) { ViewBag.cc = JsonConvert.SerializeObject(cres); return(View(model)); } else { int res = userSer.ModiUser(model); var userinfo = userSer.Find(new object[] { model.boID }); Session[Keys.userInfo] = userinfo; return(RedirectToAction("UserSingle", "Home", new { account = model.boID })); } } else { return(View(model)); } } catch { return(View(model)); } }