Esempio n. 1
0
        public ActionResult Edit(DetailSvrCoefConModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var item = dao.GetEntity("ORG_ID", model.ORG_ID, "SERIALID", model.SERIALID);
                    item.MODIFY_DTIME = DateTime.Now;
                    item.COEFFICIENT  = model.COEFFICIENT;
                    item.MODIFY_ID    = UserState.UserID;

                    var rst = dao.UpdateObject(item);
                    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 Details(string id, string orgId)
        {
            try
            {
                var item  = CHK_DETAIL_SVR_COEF_CON_DAL.Get(orgId, id);
                var model = new DetailSvrCoefConModel()
                {
                    ORG_ID       = item.ORG_ID,
                    ORG_NAM      = item.ORG_NAM,
                    COEFFICIENT  = item.COEFFICIENT,
                    MODIFY_DTIME = item.MODIFY_DTIME,
                    SERIALID     = item.SERIALID,
                    SERIALNAME   = item.SERIALNAME,
                    USER_NAM     = item.USER_NAM
                };

                return(View(model));
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("查看出错", ex);
                return(RedirectToAction("Error", "Home"));
            }
        }