Esempio n. 1
0
        public ActionResult AjaxEdit(int ID)
        {
            var entity = PlanLogService.Find(ID);
            var model = new PlanLogEditViewModel()
            {
                CompanyID = entity.CompanyID,
                PlanTime = entity.PlanTime,
                ID = entity.ID,
                Content = entity.Content
            };

            return PartialView(model);
        }
Esempio n. 2
0
        public ActionResult Edit(int ID)
        {
            var entity = PlanLogService.Find(ID);
            var model = new PlanLogEditViewModel()
            {
                CompanyID = entity.CompanyID,

                ID = entity.ID,
                Content = entity.Content
            };

            return View(model);
        }
Esempio n. 3
0
        public ActionResult Edit(PlanLogEditViewModel model)
        {
            ServiceResult result = new ServiceResult();

            TempData["Service_Result"] = result;
            if (!ModelState.IsValid)
            {
                result.Message = "表单输入有误,请仔细填写表单!";
                result.AddServiceError("表单输入有误,请仔细填写表单!");
            }
            else
            {
                try
                {
                    PlanLogService.Update(model);
                    result.Message = "编辑计划日志成功!";
                    return RedirectToAction("details", "customercompany", new { id = model.CompanyID });
                }
                catch (Exception ex)
                {
                    result.Message = "编辑计划日志失败!";
                    result.AddServiceError(Utilities.GetInnerMostException(ex));
                    LogHelper.WriteLog("用户:" + CookieHelper.MemberID + "编辑计划日志失败!", ex);
                }

            }

            return View(model);
        }
Esempio n. 4
0
        public ActionResult AjaxEdit(PlanLogEditViewModel model)
        {
            ServiceResult result = new ServiceResult();
            if (!ModelState.IsValid)
            {
                result.Message = "表单输入有误,请仔细填写表单!";
                result.AddServiceError("表单输入有误,请仔细填写表单!");
            }
            else
            {
                try
                {
                    PlanLogService.Update(model);
                    result.Message = "编辑计划日志成功!";
                }
                catch (Exception ex)
                {
                    result.Message = "编辑计划日志失败!";
                    result.AddServiceError(Utilities.GetInnerMostException(ex));
                    LogHelper.WriteLog("用户:" + CookieHelper.MemberID + "编辑计划日志失败!", ex);
                }

            }
            return Json(result);
        }