private FeeBillModelRef ConvertData(string wkID) { FeeBillModelRef model = new FeeBillModelRef(); var FeeModel = new FeeBill().GetModelFromWorkFlowID(wkID); if (FeeModel != null) { model = FeeModel.MapTo <FeeBillModel, FeeBillModelRef>(); model.PageName = "FeeBill"; return(model); } var NotcieModel = new NoticeBill().GetModelFromWorkFlowID(wkID); if (NotcieModel != null) { model.BillNo = NotcieModel.BillNo; model.PersonInfo = NotcieModel.PersonInfo; model.TotalMoney = NotcieModel.TotalMoney; model.CreateTime = NotcieModel.CreateTime; model.TransactionDate = NotcieModel.TransactionDate; model.ApprovalTime = NotcieModel.ApprovalTime; model.ApprovalStatus = NotcieModel.ApprovalStatus; model.ApprovalPost = NotcieModel.ApprovalPost; model.Remark = NotcieModel.Remark; model.ProviderName = NotcieModel.ProviderInfo.ProviderName; model.Owner = NotcieModel.Owner; model.Creator = NotcieModel.Creator; model.SpecialAttribute = new SpecialAttribute(); model.SpecialAttribute.Funds = NotcieModel.SpecialAttribute.Funds; model.SpecialAttribute.Agent = NotcieModel.SpecialAttribute.Agent; model.SpecialAttribute.Check = NotcieModel.SpecialAttribute.Check; model.Items = NotcieModel.Items; model.Currency = NotcieModel.Currency; model.WorkNumber = NotcieModel.WorkNumber; model.ProviderCode = NotcieModel.ProviderInfo.ProviderCode; model.Owner = NotcieModel.Owner; model.MissBill = NotcieModel.MissBill; model.WorkFlowID = NotcieModel.WorkFlowID; model.CountTime = new CountTime(); model.Status = NotcieModel.Status; model.PageName = "NoticeBill"; return(model); } var BorrowModel = new BorrowBill().GetModelFromWorkFlowID(wkID); if (BorrowModel != null) { model.BillNo = BorrowModel.BillNo; model.PageName = "BorrowBill"; model.PersonInfo = BorrowModel.PersonInfo; model.TotalMoney = BorrowModel.TotalMoney; model.CreateTime = BorrowModel.CreateTime; model.TransactionDate = BorrowModel.TransactionDate; model.ApprovalTime = BorrowModel.ApprovalTime; model.ApprovalStatus = BorrowModel.ApprovalStatus; model.ApprovalPost = BorrowModel.ApprovalPost; model.Remark = BorrowModel.Remark; model.Owner = BorrowModel.Owner; model.Creator = BorrowModel.Creator; model.SpecialAttribute = BorrowModel.SpecialAttribute; model.Items = BorrowModel.Items; model.Currency = BorrowModel.Currency; model.WorkNumber = BorrowModel.WorkNumber; model.Owner = BorrowModel.Owner; model.WorkFlowID = BorrowModel.WorkFlowID; model.CollectionInfo = BorrowModel.CollectionInfo; model.CountTime = new CountTime(); model.Status = BorrowModel.Status; return(model); } var RefundModel = new RefundBill().GetModelFromWorkFlowID(wkID); if (RefundModel != null) { model = RefundModel.MapTo <RefundBillModel, FeeBillModelRef>(); model.PageName = "RefundBill"; return(model); } return(model); }
/// <summary> /// 保存单据修改 /// </summary> /// <param name="model"></param> /// <returns></returns> public string SaveBillChange(EditBillModel model) { try { var employee = Marisfrolg.Public.Common.GetEmployeeInfo(); EditBillModel OriginalModel = new EditBillModel(); EditLog Editform = new EditLog(); string result = ""; switch (model.BillsType) { //费用单 case "1": var list1 = new FeeBill().GetBillModel(model.BillNo); OriginalModel = list1.MapTo <FeeBillModel, EditBillModel>(); OriginalModel.Brand = list1.PersonInfo.Brand; OriginalModel.CostCenter = list1.PersonInfo.CostCenter; var obj1 = GetCompanyInfo(list1.PersonInfo.IsHeadOffice, model.CostCenter); model.E_Company = obj1.NAME; model.E_CompanyCode = obj1.CODE; result = new FeeBill().SaveFeeBillChange(model); break; //付款单 case "2": var list2 = new NoticeBill().GetBillModel(model.BillNo); OriginalModel.BillNo = list2.BillNo; OriginalModel.BillsType = list2.BillsType; OriginalModel.BillsItems = list2.BillsItems; OriginalModel.Brand = list2.PersonInfo.Brand; OriginalModel.CostCenter = list2.PersonInfo.CostCenter; OriginalModel.Currency = list2.Currency; OriginalModel.Items = list2.Items; OriginalModel.MissBill = list2.MissBill; OriginalModel.SpecialAttribute = new SpecialAttribute() { Agent = list2.SpecialAttribute.Agent, Funds = list2.SpecialAttribute.Funds, Check = list2.SpecialAttribute.Check, BankDebt = 0, MarketDebt = 0, Cash = 0 }; OriginalModel.MissBill = list2.MissBill; OriginalModel.Photos = list2.Photos; var obj2 = GetCompanyInfo(list2.PersonInfo.IsHeadOffice, model.CostCenter); model.E_Company = obj2.NAME; model.E_CompanyCode = obj2.CODE; result = new NoticeBill().SaveNoticeBillChange(model); break; //借款单 case "3": var list3 = new BorrowBill().GetBillModel(model.BillNo); OriginalModel = list3.MapTo <BorrowBillModel, EditBillModel>(); OriginalModel.SpecialAttribute = list3.SpecialAttribute; OriginalModel.Brand = list3.PersonInfo.Brand; OriginalModel.CostCenter = list3.PersonInfo.CostCenter; var obj3 = GetCompanyInfo(list3.PersonInfo.IsHeadOffice, model.CostCenter); model.E_Company = obj3.NAME; model.E_CompanyCode = obj3.CODE; result = new BorrowBill().SaveBorrowBillChange(model); break; //费用还款单 case "4": var list4 = new RefundBill().GetBillModel(model.BillNo); OriginalModel = list4.MapTo <RefundBillModel, EditBillModel>(); OriginalModel.Brand = list4.PersonInfo.Brand; OriginalModel.CostCenter = list4.PersonInfo.CostCenter; var obj4 = GetCompanyInfo(list4.PersonInfo.IsHeadOffice, model.CostCenter); model.E_Company = obj4.NAME; model.E_CompanyCode = obj4.CODE; result = new RefundBill().SaveRefundBillChange(model); break; default: break; } Editform.BillNo = model.BillNo; Editform.CreateTime = DateTime.Now; Editform.Creator = employee.EmployeeNo; Editform.OriginalData = OriginalModel; Editform.ModifiedData = model; new EditLogForm().CreateEditRecord(Editform); return(result); } catch (Exception ex) { Logger.Write("保存单据失败:" + ex.ToString() + "," + System.Reflection.MethodBase.GetCurrentMethod().Name); return(""); } }