Ejemplo n.º 1
0
        public ActionResult Create(IndustryCateViewModel model)
        {
            ServiceResult result = new ServiceResult();
            if (ModelState.IsValid)
            {
                try
                {
                    IndustryCateService.Create(model);
                    result.Message = "添加IndustryCate成功!";
                    LogHelper.WriteLog("添加IndustryCate成功");
                }
                catch (Exception ex)
                {
                    result.Message = Utilities.GetInnerMostException(ex);
                    result.AddServiceError(result.Message);
                    LogHelper.WriteLog("添加IndustryCate错误", ex);
                }
            }
            else
            {
                result.Message = "请检查表单是否填写完整!";
                result.AddServiceError("请检查表单是否填写完整!");

            }

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

            return Json(result);
        }
Ejemplo n.º 3
0
 public ActionResult Delete(int ID)
 {
     ServiceResult result = new ServiceResult();
     var entity = IndustryCateService.Find(ID);
     try
     {
         IndustryCateService.Delete(entity);
         result.Message = "删除IndustryCate成功!";
         LogHelper.WriteLog("删除IndustryCate成功");
     }
     catch (Exception ex)
     {
         result.Message = Utilities.GetInnerMostException(ex);
         result.AddServiceError(result.Message);
         LogHelper.WriteLog("删除IndustryCate错误", ex);
     }
     return Json(result);
 }
Ejemplo n.º 4
0
        public ActionResult Edit(CustomerCompanyViewModel model)
        {
            ServiceResult result = new ServiceResult();
            if (ModelState.IsValid)
            {
                try
                {
                    CustomerCompanyService.Update(model);
                    result.Message = "编辑CustomerCompany成功!";
                    LogHelper.WriteLog("编辑CustomerCompany成功");
                }
                catch (Exception ex)
                {
                    result.Message = Utilities.GetInnerMostException(ex);
                    result.AddServiceError(result.Message);
                    LogHelper.WriteLog("编辑CustomerCompany错误", ex);
                }
            }
            else
            {
                result.Message = "请检查表单是否填写完整!";
                result.AddServiceError("请检查表单是否填写完整!");

            }
            return Json(result);
        }