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

            try
            {
                if (enquireQuestion == null)
                {
                    enquireQuestion = new EnquireQuestion();

                    enquireQuestion.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName();
                }
                enquireQuestion.Status = 1;
                SaveData();
                WordDocument doc = new WordDocument("询问笔录");

                OnNavigationRequest(new Maleos.NavigationRequestEventArgs("Maleos.Modules.OutputDocuemnt",
                    new object[] { doc, "EnforceForm.frmEnquireQuestions", enquireQuestion.FilePath }));

            }
            catch (Exception ex)
            {
                CommonInvoke.ErrorMessageBox(ex);
            }

            UseWaitCursor = false;
        }
示例#2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            UseWaitCursor = true;
            Application.DoEvents();

            try
            {

                if (enquireQuestion == null)
                {
                    enquireQuestion = new EnquireQuestion();

                    enquireQuestion.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName();
                }
                GetEntity(enquireQuestion);
                NaturalPerson naturalPerson = new NaturalPerson
                {
                    Sex = EnquirePersonSex.Text,
                    Age = EnquirePersonAge.Text,
                    IDcard = EnquirePersonIDC.Text,
                    CompanyName = EnquirePersonUnit.Text,
                    Job = EnquirePersonJob.Text,
                    CompanyAddress = EnquirePersonAddress.Text,
                    CompanyTel = EnquirePersonTel.Text
                };
                InvokeUtil.SystemService.UpdateNaturalPersonByArgs(naturalPerson);

                List<AskAndAnswer> Answers = questionContainer.GetItems();
                enquireQuestion.Items.Clear();
                foreach (AskAndAnswer answer in Answers)
                {
                    enquireQuestion.Items.Add(new EnquireQuestionItem { Anwser = answer.Answer, Question = answer.Question });
                }

                InvokeUtil.SystemService.EntityUpdate(enquireQuestion);
                OnNavigationRequest(new Maleos.NavigationRequestEventArgs("EnforceForm.frmEnquireQuestions"));
            }
            catch (Exception ex)
            {
                CommonInvoke.ErrorMessageBox(ex);
            }

            UseWaitCursor = false;
        }
示例#3
0
        private void SaveData()
        {
            if (enquireQuestion == null)
            {
                enquireQuestion = new EnquireQuestion();

                enquireQuestion.FilePath = Utility.GetFileSavePath() + Utility.BuilderFileName();
            }
            GetEntity(enquireQuestion);

            InvokeUtil.SystemService.EntityUpdate(enquireQuestion);
        }
示例#4
0
 public frmEnquireQuestion(EnquireQuestion enquireQuestion)
     : this()
 {
     this.enquireQuestion = enquireQuestion;
 }
示例#5
0
        private void frmEnquireQuestion_Load(object sender, EventArgs e)
        {
            UseWaitCursor = true;
            Application.DoEvents();

            try
            {
                EnquirePerson.Items.Clear();
                List<SearchWord> Words = InvokeUtil.SystemService.SearchWordGetAll(typeof(NaturalPerson).FullName);
                foreach (SearchWord word in Words)
                {
                    EnquirePerson.Items.Add(new AutoCompleteEntry(word.Words, word, word.ToIndexArray()));
                }
                EnquirerName.Items.Clear();
                WriterName.Items.Clear();
                QFirstPerson1.Items.Clear();
                QFirstPerson2.Items.Clear();
                Words = InvokeUtil.SystemService.SearchWordGetAll(typeof(Officers).FullName);
                foreach (SearchWord word in Words)
                {
                    EnquirerName.Items.Add(new AutoCompleteEntry(word.Words, word, word.ToIndexArray()));
                    WriterName.Items.Add(new AutoCompleteEntry(word.Words, word, word.ToIndexArray()));
                    QFirstPerson1.Items.Add(new AutoCompleteEntry(word.Words, word, word.ToIndexArray()));
                    QFirstPerson2.Items.Add(new AutoCompleteEntry(word.Words, word, word.ToIndexArray()));
                }
                QFirstUnit.Items.Clear();
                Words = InvokeUtil.SystemService.SearchWordGetAll(typeof(AreaCode).FullName);
                foreach (SearchWord word in Words)
                    QFirstUnit.Items.Add(new AutoCompleteEntry(word.Words, word, word.ToIndexArray()));

                questionContainer.Entries = new List<AutoCompleteEntry>();
                questionContainer.Entries.Clear();
                Words = InvokeUtil.SystemService.SearchWordGetAll(typeof(Question).FullName);
                foreach (SearchWord word in Words)
                    questionContainer.Entries.Add(new AutoCompleteEntry(word.Words, word, word.ToIndexArray()));
                if (enquireQuestion != null)
                {
                    enquireQuestion = InvokeUtil.SystemService.EntityInit(enquireQuestion) as EnquireQuestion;
                    SetEntity(enquireQuestion);
                    foreach (EnquireQuestionItem item in enquireQuestion.Items)
                        questionContainer.Add(new AskAndAnswer { Question = item.Question, Answer = item.Anwser });
                }

                if (questionContainer.Controls[0].Controls.Count == 0)
                {
                    questionContainer.Init();
                }
            }
            catch (Exception ex)
            {
                CommonInvoke.ErrorMessageBox(ex);
            }

            UseWaitCursor = false;
        }