private void SetValue(HttpRequestBase req,ImportantEvent importantEvent,bool isAdd)
 {
     if (!isAdd) importantEvent.Id = Convert.ToInt32(req.Form["id"]);
     importantEvent.Content = req.Form["content"].ToString();
     importantEvent.PublisTime = Convert.ToDateTime(req.Form["publish"]);
 }
 public ActionResult Update(int? id, int curPage)
 {
     if (Request.Form != null && Request.Form.Count > 0)
         {
             resp = importantEventService.UpdateImportantEvent(Request);
             return this.JudgeResult(resp, () => RedirectToAction("Details",
             new
             {
                 curpage = curPage,
                 msg = string.Format("更新了事项:{0}", Request.Form["content"])
             }));
         }
         else
         {
             ImportantEvent importantEvent = null;
             resp = importantEventService.GetImportantEvent((int)id, () => importantEvent = new ImportantEvent());
             return this.JudgeResult(resp, () => {
                 conta_ImportantEvent = new Container_ImportantEvent()
                 {
                     importantEvent = importantEvent,
                     CurPage = curPage
                 };
                 return View(conta_ImportantEvent);
             });
         }
 }