示例#1
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));
        }