Ejemplo n.º 1
0
        public ActionResult AjaxCreate(PlanLogViewModel model)
        {
            ServiceResult result = new ServiceResult();

            if (!ModelState.IsValid)
            {
                result.Message = "表单输入有误,请仔细填写表单!";
                result.AddServiceError("表单输入有误,请仔细填写表单!");
            }
            else
            {
                try
                {
                    PlanLogService.Create(model);
                    result.Message = "添加计划日志成功!";
                }
                catch (Exception ex)
                {
                    result.Message = ex.Message;
                    result.AddServiceError(Utilities.GetInnerMostException(ex));
                    LogHelper.WriteLog("用户:" + CookieHelper.MemberID + "添加计划日志失败!", ex);
                }
            }
            return Json(result);
        }
Ejemplo n.º 2
0
 public ActionResult AjaxCreate(int ID)
 {
     var model = new PlanLogViewModel()
     {
         CompanyID = ID
     };
     return View(model);
 }
Ejemplo n.º 3
0
        public ActionResult Create(PlanLogViewModel model)
        {
            ServiceResult result = new ServiceResult();

            TempData["Service_Result"] = result;
            if (!ModelState.IsValid)
            {
                result.Message = "表单输入有误,请仔细填写表单!";
                result.AddServiceError("表单输入有误,请仔细填写表单!");
            }
            else
            {
                try
                {
                    PlanLogService.Create(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);
        }