예제 #1
0
 private void SetValue(HttpRequestBase req,Family family)
 {
     family.ID = Convert.ToInt32(req.Form["id"]);
     family.UserID = req.Form["userId"].ToString();
     family.UserName = req.Form["userName"].ToString();
     family.Sex = Convert.ToByte(req.Form["sex"]);
     family.Grd = new Grade { ID = Convert.ToInt32(req.Form["grdId"]) };
     family.Dep = new Department() { ID = Convert.ToInt32(req.Form["depId"]) };
     family.Clg = new Collage() { ID = Convert.ToInt32(req.Form["clgId"]) };
     family.Wish = req.Form["wish"].ToString();
 }
예제 #2
0
 private void SetValue(Family family)
 {
     family.ID = Convert.ToInt32(dalBase.DataRead["id"]);
     family.UserID = dalBase.DataRead["userId"].ToString();
     family.UserName = dalBase.DataRead["userName"].ToString();
     family.Sex = Convert.ToByte(dalBase.DataRead["sex"]);
     family.Grd = new Grade() { ID = Convert.ToInt32(dalBase.DataRead["grdId"]) };
     family.Dep = new Department() { ID = Convert.ToInt32(dalBase.DataRead["depId"]) };
     family.Clg = new Collage() { ID = Convert.ToInt32(dalBase.DataRead["clgId"]) };
     family.Wish = dalBase.DataRead["wish"].ToString();
 }
예제 #3
0
 public ActionResult Update(int? id, int curPage)
 {
     if (Request.Form != null && Request.Form.Count > 0)
     {
         resp = familyService.UpdateFamily(Request);
         return this.JudgeResult(resp, () => RedirectToAction("Details", new
         {
             curpage = curPage,
             msg = string.Format("更新了成员{0} {1}", Request.Form["userid"], Request.Form["username"])
         }));
     }
     else
     {
         Family family = null;
         resp = familyService.GetFamily((int)id, ()=> family = new Family());
         return this.JudgeResult(resp, () => {
             conta_Family = new Container_Family();
             conta_Family.family = family;
             userService = ServiceBuilder.BuildUserService();
             conta_Family.list_Col = userService.GetAllCollage();
             conta_Family.list_Grd = userService.GetAllGrd();
             conta_Family.list_Dep = userService.GetAllDep();
             conta_Family.user = new UserStatus()
             {
                 Grd = family.Grd,
                 Clg = family.Clg,
                 Dep = family.Dep,
             };
             conta_Family.curpage = curPage;
             return View(conta_Family);
         });
     }
 }