private void buttonExport_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (spotPunishmentDecisionUnit == null) { spotPunishmentDecisionUnit = new SpotPunishmentDecisionUnit(); spotPunishmentDecisionUnit.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } spotPunishmentDecisionUnit.Status = 1; SaveData(); WordDocument doc = new WordDocument("行政当场处罚决定书"); doc.AddField("DocTitle", spotPunishmentDecisionUnit.DocTitle); doc.AddField("PutOnRecordCompanyName", spotPunishmentDecisionUnit.PutOnRecordCompanyName); doc.AddField("FieldEAddress", spotPunishmentDecisionUnit.FieldEAddress); doc.AddField("FieldEPeopleZio", spotPunishmentDecisionUnit.FieldEPeopleZio); doc.AddField("FieldEFName", spotPunishmentDecisionUnit.FieldEFName); doc.AddField("FieldEPosition", spotPunishmentDecisionUnit.FieldEPosition); doc.AddField("FieldEPeoplePhone", spotPunishmentDecisionUnit.FieldEPeoplePhone); doc.AddField("IllegalEvidence", spotPunishmentDecisionUnit.IllegalEvidence); doc.AddField("IllegalProvisions", spotPunishmentDecisionUnit.IllegalProvisions); doc.AddField("According", spotPunishmentDecisionUnit.According); doc.AddField("PunishmentAmount", spotPunishmentDecisionUnit.PunishmentAmount); doc.AddField("IfSpotPay", spotPunishmentDecisionUnit.IfSpotPay ? "√" : ""); doc.AddField("IfOther", spotPunishmentDecisionUnit.IfOther ? "√" : ""); doc.AddField("BankName", spotPunishmentDecisionUnit.BankName); doc.AddField("BankID", spotPunishmentDecisionUnit.BankID); doc.AddField("ReconsiderationUnitName1", spotPunishmentDecisionUnit.ReconsiderationUnitName1); doc.AddField("ReconsiderationUnitName2", spotPunishmentDecisionUnit.ReconsiderationUnitName2); doc.AddField("LitigationUnitName", spotPunishmentDecisionUnit.LitigationUnitName); doc.AddFootField("DocManageArea", spotPunishmentDecisionUnit.DocManageArea); OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt", new object[] { doc, "EnforceForm.frmSpotPunishmentDecisionUnits", spotPunishmentDecisionUnit.FilePath })); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
public frmSpotPunishmentDecisionUnit(SpotPunishmentDecisionUnit spotPunishmentDecisionUnit) : this() { this.spotPunishmentDecisionUnit = spotPunishmentDecisionUnit; }
private void SaveData() { if (spotPunishmentDecisionUnit == null) { spotPunishmentDecisionUnit = new SpotPunishmentDecisionUnit(); spotPunishmentDecisionUnit.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } GetEntity(spotPunishmentDecisionUnit); Company company = new Company { CompanyName = PutOnRecordCompanyName.Text, CompanyAddress = FieldEAddress.Text, CompanyPost = FieldEPeopleZio.Text, JuridicalPerson = FieldEFName.Text, JuridicalPersonJob = FieldEPosition.Text, Mobile = FieldEPeoplePhone.Text }; InvokeUtil.SystemService.UpdateCompanyByName(company); Bank bank = new Bank { BankName = BankName.Text, Account = BankID.Text }; InvokeUtil.SystemService.UpdateBankByNameAccount(bank); InvokeUtil.SystemService.EntityUpdate(spotPunishmentDecisionUnit); }