Ejemplo n.º 1
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            if (dsxml.HasChanges())
            {
                butLuu_Click(sender, e);
            }
            DataSet dst = new DataSet();

            dst = dsxml.Copy();
            dst.Tables[0].Columns.Add("chul1");
            //dst.Tables[0].Columns.Add("chul2");
            dst.Tables[0].Columns.Add("chud1");
            //dst.Tables[0].Columns.Add("chud2");
            if (!chkAll.Checked)
            {
                dst.Clear();
                dst.Merge(dsxml.Tables[0].Select("l1+l2+d1+d2>0"));
            }
            foreach (DataRow r in dst.Tables[0].Select("l1+l2+d1+d2>0"))
            {
                r["chul1"] = doiso.doithapphan(r["l1"].ToString());
                //r["chul2"] = doiso.doithapphan(r["l2"].ToString());
                r["chud1"] = doiso.doithapphan(r["d1"].ToString());
                //r["chud2"] = doiso.doithapphan(r["d2"].ToString());
            }
            if (chkXML.Checked)
            {
                if (!System.IO.Directory.Exists("..\\xml"))
                {
                    System.IO.Directory.CreateDirectory("..\\xml");
                }
                dst.WriteXml("..\\xml\\dutrukho.xml", XmlWriteMode.WriteSchema);
            }
            if (dst.Tables[0].Rows.Count > 0)
            {
                frmReport f1 = new frmReport(ttb, dst.Tables[0], (bNam) ? "ttb_dutrukho_nam.rpt" : "ttb_dutrukho.rpt", tieude.Text, s_tennguon, "", "", "", "", "", "", "", "");
                f1.ShowDialog(this);
                f1.Close();
                f1.Dispose();
                if (chkNcc.Checked)
                {
                    frmReport f2 = new frmReport(ttb, dst.Tables[0], (bNam)?"ttb_dutrukho_ncc_nam.rpt":"ttb_dutrukho_ncc.rpt", tieude.Text, s_tennguon, "", "", "", "", "", "", "", "");
                    f2.ShowDialog(this);
                    f2.Close();
                    f2.Dispose();
                }
            }
        }