private void buttonExport_Click(object sender, EventArgs e) { UseWaitCursor = true; Application.DoEvents(); try { if (spotCheck == null) { spotCheck = new SpotCheck(); spotCheck.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } spotCheck.Status = 1; SaveData(); WordDocument doc = new WordDocument("现场检查记录"); doc.Entity = spotCheck; doc.AddField("CompanyName", spotCheck.CompanyName); doc.AddField("CompanyAddress", spotCheck.CompanyAddress); doc.AddField("CheckAddress", spotCheck.CheckAddress); doc.AddField("JuridicalName", spotCheck.JuridicalName); doc.AddField("JuridicalJob", spotCheck.JuridicalJob); doc.AddField("JuridicalTel", spotCheck.JuridicalTel); doc.AddField("CheckStartTimeYear", spotCheck.CheckStartTime.Year.ToString()); doc.AddField("CheckStartTimeMonth", spotCheck.CheckStartTime.Month.ToString()); doc.AddField("CheckStartTimeDay", spotCheck.CheckStartTime.Day.ToString()); doc.AddField("CheckStartTimeHours", spotCheck.CheckStartTime.Hour.ToString()); doc.AddField("CheckStartTimeMinute", spotCheck.CheckStartTime.Minute.ToString()); doc.AddField("CheckEndTimeDay", spotCheck.CheckEndTime.Day.ToString()); doc.AddField("CheckEndTimeHours", spotCheck.CheckEndTime.Hour.ToString()); doc.AddField("CheckEndTimeMinute", spotCheck.CheckEndTime.Minute.ToString()); doc.AddField("Area", spotCheck.Area); doc.AddField("OfficerName1", spotCheck.OfficerName1); doc.AddField("OfficerName2", spotCheck.OfficerName2); doc.AddField("CID1", spotCheck.CID1); doc.AddField("CID2", spotCheck.CID2); doc.AddField("CheckCondition", spotCheck.CheckCondition); doc.AddField("SpotCondition", spotCheck.SpotCondition); //doc.AddField("CheckPerson1", spotCheck.CheckPerson1); //doc.AddField("CheckPerson2", spotCheck.CheckPerson2); //doc.AddField("SiteJuridical", spotCheck.SiteJuridical); //doc.AddField("CheckDate", spotCheck.CheckDate.ToString("yyyy年M月d日")); //doc.AddFootField("FirstPageTest", "测试"); //doc.AddFootField("Test", "测试"); //OutputDocuemnt frm = new OutputDocuemnt(doc); //frm.OpenWindow(this); OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt", new object[] { doc, "EnforceForm.frmSpotChecks", spotCheck.FilePath })); } catch (Exception ex) { CommonInvoke.ErrorMessageBox(ex); } UseWaitCursor = false; }
public frmSpotCheck(SpotCheck spotCheck) : this() { this.spotCheck = spotCheck; }
public frmSpotCheck(object obj) : this() { this.spotCheck = (SpotCheck)obj; }
private void SaveData() { if (spotCheck == null) { spotCheck = new SpotCheck(); spotCheck.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName(); } GetEntity(spotCheck); Company company = new Company { CompanyName = CompanyName.Text, CompanyAddress = CompanyAddress.Text, JuridicalPerson = JuridicalName.Text, JuridicalPersonJob = JuridicalJob.Text, Mobile = JuridicalTel.Text }; InvokeUtil.SystemService.UpdateCompanyByName(company); CheckPlace checkPlace = new CheckPlace { CheckContent = CheckAddress.Text }; InvokeUtil.SystemService.UpdateCheckPlace(checkPlace); Officers officer1 = new Officers { OfficersName = OfficerName1.Text, CID = CID1.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer1); Officers officer2 = new Officers { OfficersName = OfficerName2.Text, CID = CID2.Text }; InvokeUtil.SystemService.UpdateOfficersByArgs(officer2); InvokeUtil.SystemService.EntityUpdate(spotCheck); }