Beispiel #1
0
        /// <summary>
        /// 计算比对结果
        /// </summary>
        void CalcCompareResult()
        {
            DTV.Passport passport = new DTV.Passport();
            Dictionary <string, DataTable> dictionary = new Dictionary <string, DataTable>();

            dictionary.Add("Report", DgvToTable(dgvPassportReport));
            dictionary.Add("Feedback", DgvToTable(dgvPassportFeedback));
            dictionary.Add("Compare", DgvToTable(dgvPassportCompare));
            Dictionary <string, string> result = passport.CalcResult(dictionary);

            tbReport.Text   = result["hzreport"] + result["gtreport"];
            tbFeedback.Text = result["hzfeedback"] + result["gtfeedback"];
            tbCompare.Text  = result["hzcompare"] + result["gtcompare"];
        }
Beispiel #2
0
        private void tsbSaveResult_Click(object sender, EventArgs e)
        {
            Dictionary <string, DataTable> dictionary = new Dictionary <string, DataTable>();
            DataTable dt = DgvToTable(dgvPassportReport);

            dictionary.Add("Report", dt);
            dt = DgvToTable(dgvPassportFeedback);
            dictionary.Add("Feedback", dt);
            dt = DgvToTable(dgvPassportCompare);
            dictionary.Add("Compare", dt);

            DTV.Passport passport = new DTV.Passport();

            Dictionary <string, string> result = passport.CalcResult(dictionary);

            dt = new DataTable();
            dt.Columns.Add("Type", Type.GetType("System.String"));
            dt.Columns.Add("Report", Type.GetType("System.String"));
            dt.Columns.Add("Feedback", Type.GetType("System.String"));
            dt.Columns.Add("Compare", Type.GetType("System.String"));

            DataRow newRow;

            newRow             = dt.NewRow();
            newRow["Type"]     = "护照";
            newRow["Report"]   = result["hzreport"];
            newRow["Feedback"] = result["hzfeedback"];
            newRow["Compare"]  = result["hzcompare"];
            dt.Rows.Add(newRow);
            newRow             = dt.NewRow();
            newRow["Type"]     = "港澳台通行证";
            newRow["Report"]   = result["gtreport"];
            newRow["Feedback"] = result["gtfeedback"];
            newRow["Compare"]  = result["gtcompare"];
            dt.Rows.Add(newRow);
            dictionary.Add("Result", dt);

            MessageBox.Show(passport.SaveCompareResult(dictionary));
        }