Esempio n. 1
0
 public ActionResult Add(int? id)
 {
     ResponseStatus resp = ResponseStatus.NONE;
     if (Request.Form != null && Request.Form.Count > 0)
     {
         resp = workService.AddWork(Request);
         return this.JudgeResult(resp, () => RedirectToAction("Details",
             new { id = Convert.ToInt32(Request.Form["activityId"]), msg = string.Format("添加了工作:{0}", Request.Form["content"].ToString()) }));
     }
     conta_Uwork = new Container_UWork();
     conta_Uwork.activityId = (int)id;
     conta_Uwork.hash_work = GLB.hash_work;
     resp = workService.WorkPrepare(Request, conta_Uwork);
     return this.JudgeResult(resp, () => View(conta_Uwork));
 }
Esempio n. 2
0
        public ResponseStatus GetWork(HttpRequestBase req, Container_UWork conta_UWork, int id)
        {
            conta_UWork.work = new Work();
            ResponseStatus resp = ResponseStatus.NONE;
            workDal = new WorkDAL();
            resp = workDal.GetDetail(id, conta_UWork.work);
            workDal.ReturnUnitToPool();

            resp = this.WorkPrepare(req, conta_UWork);

            return resp;
        }
Esempio n. 3
0
        public ResponseStatus WorkPrepare(HttpRequestBase req,Container_UWork conta_UWork)
        {
            userDal = new UserDAL();
            List<UserBase> list_ub = userDal.GetUsers(req.Cookies[GLB.userId].Value);
            userDal.ReturnUnitToPool();

            conta_UWork.list_ub = list_ub;
            ResponseStatus resp = list_ub == null ? ResponseStatus.FAILED : ResponseStatus.SUCCESS;

            return resp;
        }
Esempio n. 4
0
 public ActionResult Update(int? id,int? activityId)
 {
     if (Request.Form != null && Request.Form.Count > 0)
     {
         ResponseStatus resp = workService.UpdateWork(Request);
         return this.JudgeResult(resp, () => RedirectToAction("Details",
             new { id = Convert.ToInt32(Request.Form["activityId"]), msg = string.Format("更新了工作:{0}", Request.Form["content"].ToString()) }));
     }
     else
     {
         Container_UWork conta_UWork = new Container_UWork();
         conta_UWork.activityId = (int)activityId;
         ResponseStatus resp = workService.GetWork(Request, conta_UWork, (int)id);
         return this.JudgeResult(resp, () =>View(conta_UWork));
     }
 }