public ActionResult ComplainCreate(FormCollection fc) { var cTypeId = Utility.CommonHelper.To<int>(fc["Select_Type_List"]); var cContent = fc["ComplainContent"]; var cAttName = fc["UploadFileName"]; var cCode = fc["UploadFileCode"]; var cExt = fc["UploadFileExt"]; var cSize = fc["UploadFileSize"]; var currUserId = LoginUserManager.CurrLoginUser.UserId; //创建投诉内容 var complainContent = new ComplainContent() { BranchId = LoginUserManager.CurrLoginUser.BranchId, UserId = LoginUserManager.CurrLoginUser.UserId, MenuId = cTypeId, Content = cContent, Status = ConvertEnum.StatusTypeForActive, CreateBy = currUserId, CreateTime = DateTime.Now, UpdateBy = currUserId, UpdateTime = DateTime.Now, IsReply = ConvertEnum.ComplainStatusTypeForNoReply, Remark = "" }; //创建投诉附件 ComplainAttachment complainAttachment = null; if (!(string.IsNullOrEmpty(cAttName) || string.IsNullOrEmpty(cCode) || string.IsNullOrEmpty(cExt))) { complainAttachment = new ComplainAttachment() { FAttName = cAttName, FileCode = cCode, FileExt = cExt, FileSize = Utility.CommonHelper.To<int>(cSize), Status = Utility.CommonHelper.To<int>(Enum.StatusType.Active), CreateBy = currUserId, CreateTime = DateTime.Now }; } ComplainBLL.CreateComplainContent(complainContent, complainAttachment); return RedirectToAction("Index"); }
public JsonResult ComplainCreate(StudentComplainModel scm) { var cTypeId = scm.SelectType; var cBranchId = scm.ComplainBranchId; var currUserId = scm.ComplainUserId; var cContent = scm.ComplainContent; var cAttName = scm.UploadFileName; var cCode = scm.UploadFileCode; var cExt = scm.UploadFileExt; var cSize = scm.UploadFileSize; //创建投诉内容 var complainContent = new ComplainContent() { BranchId = cBranchId, UserId = currUserId.Value, MenuId = cTypeId.Value, Content = cContent, Status = ConvertEnum.StatusTypeForActive, CreateBy = LoginUserManager.CurrLoginUser.UserId, CreateTime = DateTime.Now, UpdateBy = currUserId, UpdateTime = DateTime.Now, IsReply = ConvertEnum.ComplainStatusTypeForNoReply, Remark = "" }; //创建投诉附件 ComplainAttachment complainAttachment = null; if (!(string.IsNullOrEmpty(cAttName) || string.IsNullOrEmpty(cCode) || string.IsNullOrEmpty(cExt))) { complainAttachment = new ComplainAttachment() { FAttName = cAttName, FileCode = cCode, FileExt = cExt, FileSize = Utility.CommonHelper.To<int>(cSize), Status = Utility.CommonHelper.To<int>(Enum.StatusType.Active), CreateBy = currUserId, CreateTime = DateTime.Now }; } var result = ComplainBLL.CreateComplainContent(complainContent, complainAttachment); return Json(new { state = result }); }