Esempio n. 1
0
 public ActionResult AjaxCreate(MediaRequireViewModel model)
 {
     ServiceResult result = new ServiceResult();
     if (!ModelState.IsValid)
     {
         result.Message = "表单输入有误,请仔细填写表单!";
         result.AddServiceError("表单输入有误,请仔细填写表单!");
     }
     else
     {
         try
         {
             var resolver = MemberService.Find(model.ResolveID);
             model.DepartmentID = resolver.DepartmentID;
             MediaRequireService.Create(model);
             result.Message = "添加媒体请求成功!";
         }
         catch (Exception ex)
         {
             result.Message = "添加媒体请求失败!";
             result.AddServiceError(Utilities.GetInnerMostException(ex));
             LogHelper.WriteLog("用户:" + CookieHelper.MemberID + "添加媒体请求失败!", ex);
         }
     }
     return Json(result);
 }
Esempio n. 2
0
 public ActionResult AjaxAppend(MediaRequireAppendViewModel model)
 {
     ServiceResult result = new ServiceResult();
     if (!ModelState.IsValid)
     {
         result.Message = "表单输入有误,请仔细填写表单!";
         result.AddServiceError("表单输入有误,请仔细填写表单!");
     }
     else
     {
         try
         {
             var entity = new MediaRequireViewModel()
             {
                 DepartmentID = model.DepartmentID,
                 AttachmentPath = model.AttachmentPath,
                 CompanyID = model.CompanyID,
                 Description = model.Description,
                 IsRoot = model.IsRoot,
                 ID = model.ID,
                 Name = model.Name,
                 ResolveID = model.ResolveID,
                 PID = model.PID,
                 SenderID = model.SenderID,
                 Status = model.Status
             };
             MediaRequireService.Create(entity);
             result.Message = "追加回复成功!";
         }
         catch (Exception ex)
         {
             result.Message = "追加回复失败!";
             result.AddServiceError(Utilities.GetInnerMostException(ex));
             LogHelper.WriteLog("用户:" + CookieHelper.MemberID + "追加回复失败!", ex);
         }
     }
     return Json(result);
 }
Esempio n. 3
0
        public ActionResult AjaxCreate(int ID)
        {
            var entity = CustomerCompanyService.Find(ID);
            var model = new MediaRequireViewModel()
            {
                CompanyID = ID,
                SenderID = CookieHelper.MemberID,
                Name = "策略单请求:" + entity.Name,
                IsRoot = 1

            };
            return PartialView(model);
        }