/// <summary> /// 受理人反馈编辑页面 /// </summary> /// <param name="AssetRepairId"></param> /// <returns></returns> public ActionResult AssetFeedBack(int AssetRepairId) { var vm = new Models.AssetRepair.AssetFeedBackEditModel(); vm.AssetFeedBackEditDto.tbAssetRepairId = AssetRepairId; return(View(vm)); }
/// <summary> /// 查看反馈结果 /// </summary> /// <param name="AssetRepairId"></param> /// <returns></returns> public ActionResult ViewAssetFeedBack(int AssetRepairId) { var vm = new Models.AssetRepair.AssetFeedBackEditModel(); using (var db = new LcSoft.Models.DbContext()) { vm.AssetFeedBackEditDto = db.Table <Asset.Entity.tbAssetFeedBack>() .Where(m => m.tbAssetRepair.Id == AssetRepairId) .Select(m => new Dto.AssetRepair.AssetFeedBackEditDto() { FileName = m.FileName, Remark = m.Remark, tbAssetRepairId = m.tbAssetRepair.Id }).FirstOrDefault(); } return(View(vm)); }
public ActionResult ViewAssetFeedBack(Models.AssetRepair.AssetFeedBackEditModel vm) { var error = new List <string>(); using (var db = new LcSoft.Models.DbContext()) { var file = Request.Files[nameof(vm.AssetFeedBackEditDto) + "." + nameof(vm.AssetFeedBackEditDto.FileName)]; vm.AssetFeedBackEditDto.FileName = file.FileName; string FileName = System.IO.Path.GetRandomFileName().Replace(".", string.Empty); string ConType = System.IO.Path.GetExtension(file.FileName); if (!string.IsNullOrEmpty(ConType)) { file.SaveAs(Server.MapPath("~/Files/AssetRepair/") + FileName + "." + ConType); } var tbAssetRepair = db.Set <Asset.Entity.tbAssetRepair>().Find(vm.AssetFeedBackEditDto.tbAssetRepairId); var tbAssetFeedBack = new Asset.Entity.tbAssetFeedBack() { tbAssetRepair = tbAssetRepair, Remark = vm.AssetFeedBackEditDto.Remark, FileName = string.IsNullOrEmpty(ConType)?"": FileName + "." + ConType }; db.Set <Asset.Entity.tbAssetFeedBack>().Add(tbAssetFeedBack); //修改状态,完成报修 tbAssetRepair.tbProcessUser = db.Set <Sys.Entity.tbSysUser>().Find(Code.Common.UserId); tbAssetRepair.AssetRepairStatusCode = Code.EnumHelper.AssetRepair.Processed; tbAssetRepair.CompleteDate = System.DateTime.Now; db.SaveChanges(); if (db.SaveChanges() > 0) { Sys.Controllers.SysUserLogController.Insert("完成受理,反馈成功!"); } } if (error.Count > 0) { return(Content("<script type='text/javascript'>$(function(){ mui.alert('" + string.Join("\r\n", error) + "');});</script>")); } return(Content("<script type='text/javascript'> window.parent.location.href = '" + Url.Action("AssetRepairIndex", "AssetRepair", new { area = "Wechat" }) + "';</script>")); }