Esempio n. 1
0
 public ActionResult Edit(WARN_COMPLAIN_DETAIL model)
 {
     try
     {
         var data = WarncomplaindetailDao.GetEntity("SEQ", model.SEQ);
         data.COMPLAIN_METHOD = model.COMPLAIN_METHOD;
         data.COMPLAIN_REASON = model.COMPLAIN_REASON;
         data.INPUT_USER      = UserState.UserID;
         data.INPUT_TIME      = DateTime.Now;
         data.STATE           = 2;//默认状态为已处理
         var rst = WarncomplaindetailDao.UpdateObject(data);
         if (rst > 0)
         {
             Alter("修改成功!", util.Enum.AlterTypeEnum.Success, false, true);
             return(Redirect("/Home/Blank"));
         }
         ModelState.AddModelError("", "修改失败。");
         return(View(model));
     }
     catch (Exception ex)
     {
         LogHelper.ErrorLog("修改出错!", ex);
         ModelState.AddModelError("", "修改失败!" + ex.Message);
         return(RedirectToAction("Error", "Home"));
     }
 }
Esempio n. 2
0
 public ActionResult Delete(string id)
 {
     try
     {
         var arrid = id.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         foreach (var _id in arrid)
         {
             // WarncomplaindetailDao.Delete("SEQ", int.Parse(_id.Split('-')[0]));
             var data = WarncomplaindetailDao.GetEntity("SEQ", _id);
             data.STATE      = 3;
             data.INPUT_USER = UserState.UserID;
             data.INPUT_TIME = DateTime.Now;
             var rst = WarncomplaindetailDao.UpdateObject(data);
         }
         Alter("撤销成功!", util.Enum.AlterTypeEnum.Success, false, true);
         return(RedirectToAction("/"));
     }
     catch (Exception ex)
     {
         LogHelper.ErrorLog("删除出错", ex);
         return(Redirect("/Home/Error"));
     }
 }