public ActionResult Login() { userService = ServiceBuilder.BuildUserService(); UserStatus us = null; ResponseStatus rspStatus = userService.Login(Request, conTa_status, ref us); if (rspStatus == ResponseStatus.SUCCESS) { CookieFactory cf = CookieFactory.Instance(); cf.CreateCookie(GLB.userId, us.UserID, DateTime.Now.AddYears(1), Response); cf.CreateCookie(GLB.userName, us.UserName, DateTime.Now.AddYears(1), Response); cf.CreateCookie(GLB.id, us.ID.ToString(), DateTime.Now.AddYears(1), Response); cf.CreateCookie(GLB.depId, us.Dep.ID.ToString(), DateTime.Now.AddYears(1), Response); GLB.Instance().GetActivitiesIdCookies(Response, DateTime.Now.AddYears(1)); return(RedirectToAction("PersonalHome")); } else if (rspStatus == ResponseStatus.NOT_PASS) { return(RedirectToAction("Message", "Other", new { msg = Msg.NotPass })); } else if (rspStatus == ResponseStatus.NOT_REGISTER) { return(RedirectToAction("Message", "Other", new { msg = Msg.NotReg })); } else if (rspStatus == ResponseStatus.REQFORM_COUNT_ISZERO) { return(View()); } return(View()); }
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); })); } }
public ActionResult Search() { userService = ServiceBuilder.BuildUserService(); container_list_s.list_Grd = userService.GetAllGrd(); container_list_s.list_Dep = userService.GetAllDep(); container_list_s.list_Col = userService.GetAllCollage(); return(View(container_list_s)); }
public ActionResult Register() { userService = ServiceBuilder.BuildUserService(); conTa_status.list_Grd = userService.GetAllGrd(); conTa_status.list_Dep = userService.GetAllDep(); conTa_status.list_Col = userService.GetAllCollage(); conTa_status.list_Role = userService.GetAllRole(); return(View(conTa_status)); }
public ActionResult Add(int curPage) { if (Request.Form != null && Request.Form.Count > 0) { resp = familyService.AddFamily(Request); return(this.JudgeResult(resp, () => RedirectToAction("Details", new { curpage = curPage, msg = string.Format("添加了成员{0} {1}", Request.Form["userid"], Request.Form["username"]) }))); } conta_List_Status = new Container_List_Status(); userService = ServiceBuilder.BuildUserService(); conta_List_Status.list_Col = userService.GetAllCollage(); conta_List_Status.list_Grd = userService.GetAllGrd(); conta_List_Status.list_Dep = userService.GetAllDep(); conta_List_Status.curpage = curPage; return(View(conta_List_Status)); }
public ActionResult PermissionNewUser(int?id) { userService = ServiceBuilder.BuildUserService(); userPaginate.CurrentPage = id == null ? 1 : (int)id; ResponseStatus respStatus = userService.PermissionNewUser(Request, userPaginate, conTa_list_u_Sta); if (respStatus == ResponseStatus.SUCCESS) { return(View(conTa_list_u_Sta)); } else if (respStatus == ResponseStatus.NOT_PERMIS_NEWUSER) { return(RedirectToAction("Message", "Other", new { msg = Msg.NoPermissionNewUser })); } else { return(View("Login")); } }
public ActionResult Registering() { userService = ServiceBuilder.BuildUserService(); ResponseStatus respStatus = userService.Registering(Request, conTa_status); if (respStatus == ResponseStatus.SUCCESS) { return(RedirectToAction("Message", "Other", new { msg = Msg.ThankReg })); } else if (respStatus == ResponseStatus.HAVEREG) { return(RedirectToAction("Message", "Other", new { msg = Msg.HaveReg })); } else { conTa_status.list_Grd = userService.GetAllGrd(); conTa_status.list_Dep = userService.GetAllDep(); conTa_status.list_Col = userService.GetAllCollage(); conTa_status.list_Role = userService.GetAllRole(); return(View("Register", conTa_status)); } }
public ActionResult PersonalHome() { userService = ServiceBuilder.BuildUserService(); userService.GetDataForPersonalHome(Request, conTa_Notices_MyWorks_TeamWorks_Activities); return(View(conTa_Notices_MyWorks_TeamWorks_Activities)); }