예제 #1
0
        private void buttonExport_Click(object sender, EventArgs e)
        {
            UseWaitCursor = true;
            Application.DoEvents();

            try
            {
                if (explorationRecord == null)
                {
                    explorationRecord = new ExplorationRecord();
                    explorationRecord.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName();
                }
                explorationRecord.Status = 1;
                SaveData();
                WordDocument doc = new WordDocument("勘验笔录");
                doc.AddField("DocTitle", explorationRecord.DocTitle);
                doc.AddField("BeganTimeYear", explorationRecord.BeganTime.Year.ToString());
                doc.AddField("BeganTimeMonth", explorationRecord.BeganTime.Month.ToString());
                doc.AddField("BeganTimeDay", explorationRecord.BeganTime.Day.ToString());
                doc.AddField("BeganTimeHour", explorationRecord.BeganTime.Hour.ToString());
                doc.AddField("BeganTimeMinute", explorationRecord.BeganTime.Minute.ToString());
                doc.AddField("ToTimeDay", explorationRecord.ToTime.Day.ToString());
                doc.AddField("ToTimeHour", explorationRecord.ToTime.Hour.ToString());
                doc.AddField("ToTimeMinute", explorationRecord.ToTime.Minute.ToString());
                doc.AddField("Address", explorationRecord.Address);
                doc.AddField("Weather", explorationRecord.Weather);
                doc.AddField("EUserName1", explorationRecord.EUserName1);
                doc.AddField("ECompanyName1", explorationRecord.ECompanyName1);
                doc.AddField("EUserName2", explorationRecord.EUserName2);
                doc.AddField("ECompanyName2", explorationRecord.ECompanyName2);
                doc.AddField("TheEPeopleName1", explorationRecord.TheEPeopleName1);
                doc.AddField("TheECompanyName1", explorationRecord.TheECompanyName1);
                doc.AddField("TheEPeopleName2", explorationRecord.TheEPeopleName2);
                doc.AddField("TheECompanyName2", explorationRecord.TheECompanyName2);
                doc.AddField("InvitedEPeopleName", explorationRecord.InvitedEPeopleName);
                doc.AddField("InvitedECompanyName", explorationRecord.InvitedECompanyName);
                doc.AddField("RecordUserName", explorationRecord.RecordUserName);
                doc.AddField("RecordCompanyName", explorationRecord.RecordCompanyName);
                doc.AddField("QFirstPerson1", explorationRecord.QFirstPerson1);
                doc.AddField("QFirstPersonUser1", explorationRecord.QFirstPersonUser1);
                doc.AddField("QFirstPerson2", explorationRecord.QFirstPerson2);
                doc.AddField("QFirstPersonIDC1", explorationRecord.QFirstPersonIDC1);
                doc.AddField("QFirstPerson2IDC2", explorationRecord.QFirstPerson2IDC2);
                doc.AddField("ESituation", explorationRecord.ESituation);
                //doc.AddFootField("FirstPageTest", "测试");
                //doc.AddFootField("Test", "测试");

                OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt",
                    new object[] { doc, "EnforceForm.frmExplorationRecords", explorationRecord.FilePath }));
            }
            catch (Exception ex)
            {
                CommonInvoke.ErrorMessageBox(ex);
            }

            UseWaitCursor = false;
        }
예제 #2
0
 public frmExplorationRecord(ExplorationRecord explorationRecord)
     : this()
 {
     this.explorationRecord = explorationRecord;
 }
예제 #3
0
        private void SaveData()
        {
            if (explorationRecord == null)
            {
                explorationRecord = new ExplorationRecord();
                explorationRecord.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName();
            }
            ToTime.Value = DateTime.Parse(BeganTime.Value.ToString("yyyy-MM-dd") + ToTime.Value.ToString(" HH:mm:ss"));

            GetEntity(explorationRecord);

            InvokeUtil.SystemService.EntityUpdate(explorationRecord);
        }