private void buttonExport_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (spotPunishmentDecisionPersonal == null) { spotPunishmentDecisionPersonal = new SpotPunishmentDecisionPersonal(); spotPunishmentDecisionPersonal.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } spotPunishmentDecisionPersonal.Status = 1; SaveData(); WordDocument doc = new WordDocument("行政当场处罚决定书个人"); doc.AddField("DocTitle", spotPunishmentDecisionPersonal.DocTitle); doc.AddField("FieldEPeopleName", spotPunishmentDecisionPersonal.FieldEPeopleName); doc.AddField("FieldEPeopleSex", spotPunishmentDecisionPersonal.FieldEPeopleSex); doc.AddField("FieldEPeopleAge", spotPunishmentDecisionPersonal.FieldEPeopleAge); doc.AddField("FieldEPeopleID", spotPunishmentDecisionPersonal.FieldEPeopleID); doc.AddField("FieldEPeopleAddress", spotPunishmentDecisionPersonal.FieldEPeopleAddress); doc.AddField("FieldEPeopleCompanyName", spotPunishmentDecisionPersonal.FieldEPeopleCompanyName); doc.AddField("FieldEPeoplePosition", spotPunishmentDecisionPersonal.FieldEPeoplePosition); doc.AddField("FieldEPeopleCompanyAddress", spotPunishmentDecisionPersonal.FieldEPeopleCompanyAddress); doc.AddField("FieldEPeoplePhone", spotPunishmentDecisionPersonal.FieldEPeoplePhone); doc.AddField("IllegalEvidence", spotPunishmentDecisionPersonal.IllegalEvidence); doc.AddField("IllegalProvisions", spotPunishmentDecisionPersonal.IllegalProvisions); doc.AddField("According", spotPunishmentDecisionPersonal.According); doc.AddField("PunishmentAmount", spotPunishmentDecisionPersonal.PunishmentAmount); doc.AddField("IfSpotPay", spotPunishmentDecisionPersonal.IfSpotPay ? "√" : ""); doc.AddField("IfOther", spotPunishmentDecisionPersonal.IfOther ? "√" : ""); doc.AddField("BankName", spotPunishmentDecisionPersonal.BankName); doc.AddField("BankID", spotPunishmentDecisionPersonal.BankID); doc.AddField("ReconsiderationUnitName1", spotPunishmentDecisionPersonal.ReconsiderationUnitName1); doc.AddField("ReconsiderationUnitName2", spotPunishmentDecisionPersonal.ReconsiderationUnitName2); doc.AddField("LitigationUnitName", spotPunishmentDecisionPersonal.LitigationUnitName); doc.AddFootField("DocManageArea", spotPunishmentDecisionPersonal.DocManageArea); OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt", new object[] { doc, "EnforceForm.frmSpotPunishmentDecisionPersonals", spotPunishmentDecisionPersonal.FilePath })); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
public frmSpotPunishmentDecisionPersonal(SpotPunishmentDecisionPersonal spotPunishmentDecisionPersonal) : this() { this.spotPunishmentDecisionPersonal = spotPunishmentDecisionPersonal; }
private void SaveData() { if (spotPunishmentDecisionPersonal == null) { spotPunishmentDecisionPersonal = new SpotPunishmentDecisionPersonal(); spotPunishmentDecisionPersonal.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } GetEntity(spotPunishmentDecisionPersonal); NaturalPerson naturalPerson = new NaturalPerson { Sex = FieldEPeopleSex.Text, Age = FieldEPeopleAge.Text, CompanyTel = FieldEPeoplePhone.Text, Address = FieldEPeopleAddress.Text, CompanyName = FieldEPeopleCompanyName.Text, Job = FieldEPeoplePosition.Text, CompanyAddress = FieldEPeopleCompanyAddress.Text }; InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson); Bank bank = new Bank { BankName = BankName.Text, Account = BankID.Text }; InvokeUtil.SystemService.UpdateBankByNameAccount(bank); InvokeUtil.SystemService.EntityUpdate(spotPunishmentDecisionPersonal); }