public ActionResult Edit(Epm_ReformRecord model) { Result <int> result = new Result <int>(); string fileDataJson = Request.Form["fileDataJsonFile"];//获取上传文件json字符串 if (!string.IsNullOrEmpty(fileDataJson)) { model.TzAttachs = JsonConvert.DeserializeObject <List <Epm_TzAttachs> >(fileDataJson);//将文件信息json字符 } using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(Request))) { result = proxy.UpdateReformRecord(model); } return(Json(result.ToResultView())); }
///<summary> ///修改: ///</summary> /// <param name="model">要修改的model</param> /// <returns>受影响的行数</returns> public Result <int> UpdateReformRecord(Epm_ReformRecord model) { Result <int> result = new Result <int>(); try { var rows = DataOperateBusiness <Epm_ReformRecord> .Get().Update(model); result.Data = rows; result.Flag = EResultFlag.Success; WriteLog(AdminModule.ReformRecord.GetText(), SystemRight.Modify.GetText(), "修改: " + model.Id); } catch (Exception ex) { result.Data = -1; result.Flag = EResultFlag.Failure; result.Exception = new ExceptionEx(ex, "UpdateReformRecord"); } return(result); }
public Result <int> AddReformRecordeEtity(Epm_ReformRecord model) { Result <int> result = new Result <int>(); try { int rows = 0; bool isAdd = false; var first = DataOperateBusiness <Epm_ReformRecord> .Get().GetList(t => t.ProjectName == model.ProjectName && t.State != (int)PreProjectState.ApprovalFailure && t.State != (int)PreProjectState.Discarded).FirstOrDefault(); if (first == null) { isAdd = true; first = new Epm_ReformRecord(); SetCreateUser(first); } first.ProjectName = model.ProjectName; first.ProjectId = model.ProjectId; first.ProjectCodeInvest = model.ProjectCodeInvest; first.ProjectCodeWhole = model.ProjectCodeWhole; first.ProjectCodeProject = model.ProjectCodeProject; first.RemarkType = model.RemarkType; first.StationName = model.StationName; first.StationId = model.StationId; first.StationCodeInvest = model.StationCodeInvest; first.StationCodeWhole = model.StationCodeWhole; first.StationCodeProject = model.StationCodeProject; first.CompanyName = model.CompanyName; first.CompanyId = model.CompanyId; first.LimitType = model.LimitType; first.SourceFund = model.SourceFund; first.Investment = model.Investment; first.ItemNumber = model.ItemNumber; first.ItemTime = model.ItemTime; first.ItemUnit = model.ItemUnit; first.ItemMoney = model.ItemMoney; first.InitialNumber = model.InitialNumber; first.InitialMoney = model.InitialMoney; first.RemarkStartTime = model.RemarkStartTime; first.RemarkEndTime = model.RemarkEndTime; first.RemarkMoney = model.RemarkMoney; first.DecisionMaker = model.DecisionMaker; first.LeaderPerson = model.LeaderPerson; first.Operator = model.Operator; first.PipetteCoding = model.PipetteCoding; first.InitialSalesOfRefinedOil = model.InitialSalesOfRefinedOil; first.RemarkSalesOfRefinedOil = model.RemarkSalesOfRefinedOil; first.InitialSalesOfGas = model.InitialSalesOfGas; first.RemarkSalesOfGas = model.RemarkSalesOfGas; first.IRR = model.IRR; first.ProjectContent = model.ProjectContent; first.Remark = model.Remark; first.AnnexType = model.AnnexType; first.AnnexAddress = model.AnnexAddress; first.State = model.State; first.Approver = model.Approver; first.ApproverId = model.ApproverId; first.ApproveTime = model.ApproveTime; first.ApproveResult = model.ApproveResult; first.ApproveRemark = model.ApproveRemark; first.AreaCompanyName = model.AreaCompanyName; first.AreaCompanyCode = model.AreaCompanyCode; first.CostAmount = model.CostAmount; first.RemarkTypeName = model.RemarkTypeName; first.DecisionMakerId = model.DecisionMakerId; first.LeaderPersonId = model.LeaderPersonId; first.OperatorId = model.OperatorId; SetCurrentUser(first); if (isAdd) { rows = DataOperateBusiness <Epm_ReformRecord> .Get().Add(first); } else { rows = DataOperateBusiness <Epm_ReformRecord> .Get().Update(first); } //上传附件 AddFilesBytzTable(first, model.TzAttachs); result.Data = rows; result.Flag = EResultFlag.Success; //WriteLog(AdminModule.TzFirstNegotiation.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id); } catch (Exception ex) { result.Data = -1; result.Flag = EResultFlag.Failure; result.Exception = new ExceptionEx(ex, "AddTzFirstNegotiation"); } return(result); }