Exemple #1
0
 private void Form2_Load(object sender, EventArgs e)
 {
     if (File.Exists(CauHinh.docfile()[0]) == true)
     {
         progressBar1.Hide();
         dex = new Data_Excel(ClConnect.connect(CauHinh.docfile()[0]));
         dataHienThi.DataSource             = dex.getDataTable("select [KyHieu],[YNghia] from [KyHieu$] where [KyHieu]<>''");
         toolduongdan.Text                  = CauHinh.docfile()[0];
         heuristicToolStripMenuItem.Checked = true;
         lbTheo.Text        = "Theo Heuritic";
         textBox1.Text      = "Fe,H2SO4";
         textBox2.Text      = "SO2";
         rtSuyDien.ReadOnly = true;
     }
     else
     {
         this.Show();
         if (MessageBox.Show("Lỗi không tìm thấy tập dữ liệu \n Chọn tập tin", "Error",
                             MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK)
         {
             Form1 t = new Form1();
             t.ShowDialog();
             if (MessageBox.Show("Khởi động lại ứng dụng", "Thông tin", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
             {
                 Application.Restart();
             }
         }
         else
         {
             Application.Exit();
         }
     }
     strsave = new List <string>();
 }
Exemple #2
0
 private void loadData()
 {
     textBox1.Text            = filename;
     connect                  = ClConnect.connect(filename);
     dex                      = new Data_Excel(connect);
     dataGridView1.DataSource = dex.getDataTable("Select [ID] ,[GiaThiet],[KetLuan] from [Luat$] where [ID]<>''");
     dataGridView1.Refresh();
 }
Exemple #3
0
 public ThuatToan(string giathiet, string ketluan)
 {
     connect = ClConnect.connect(CauHinh.docfile()[0]);
     dex = new Data_Excel(connect);
     tapluat = new List<string>();
     this.giathiet = converStringToArray(giathiet, ',');
     this.ketluan = ketluan;
     luat = getTapLuat();
     vet = new List<string>();
     tapgiathiet = new List<string>();
 }
Exemple #4
0
 public ThuatToan(string giathiet, string ketluan)
 {
     connect       = ClConnect.connect(CauHinh.docfile()[0]);
     dex           = new Data_Excel(connect);
     tapluat       = new List <string>();
     this.giathiet = converStringToArray(giathiet, ',');
     this.ketluan  = ketluan;
     luat          = getTapLuat();
     vet           = new List <string>();
     tapgiathiet   = new List <string>();
 }
Exemple #5
0
        private List <List <string> > getTapLuat()
        {
            List <List <string> > tems = new List <List <string> >();
            List <string>         temp;

            dex = new Data_Excel(connect);
            dt  = new DataTable();
            dt  = dex.getDataTable("Select ID,GiaThiet,KetLuan  from [Luat$] where ID<>'' ");
            foreach (DataRow a in dt.Rows)
            {
                temp = new List <string>();
                temp.Add(a[0].ToString());
                temp.Add(a[1].ToString());
                temp.Add(a[2].ToString());
                tems.Add(temp);
            }
            return(tems);
        }
Exemple #6
0
        private void Form2_Load(object sender, EventArgs e)
        {
            if (File.Exists(CauHinh.docfile()[0]) == true)
            {
                progressBar1.Hide();
                dex = new Data_Excel(ClConnect.connect(CauHinh.docfile()[0]));
                dataHienThi.DataSource = dex.getDataTable("select [KyHieu],[YNghia] from [KyHieu$] where [KyHieu]<>''");
                toolduongdan.Text = CauHinh.docfile()[0];
                heuristicToolStripMenuItem.Checked = true;
                lbTheo.Text = "Theo Heuritic";
                textBox1.Text = "Fe,H2SO4";
                textBox2.Text="SO2";
                rtSuyDien.ReadOnly = true;

            }
            else
            {
                this.Show();
                if (MessageBox.Show("Lỗi không tìm thấy tập dữ liệu \n Chọn tập tin","Error",
                    MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    Form1 t = new Form1();
                    t.ShowDialog();
                    if (MessageBox.Show("Khởi động lại ứng dụng", "Thông tin", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
                    {
                        Application.Restart();
                    }
                }
                else Application.Exit();
            }
            strsave = new List<string>();
        }
Exemple #7
0
 private List<List<string>> getTapLuat()
 {
     List<List<string>> tems = new List<List<string>>();
     List<string> temp;
     dex = new Data_Excel(connect);
     dt = new DataTable();
     dt = dex.getDataTable("Select ID,GiaThiet,KetLuan  from [Luat$] where ID<>'' ");
     foreach (DataRow a in dt.Rows)
     {
         temp = new List<string>();
         temp.Add(a[0].ToString());
         temp.Add(a[1].ToString());
         temp.Add(a[2].ToString());
         tems.Add(temp);
     }
     return tems;
 }
Exemple #8
0
 private void loadData()
 {
     textBox1.Text = filename;
         connect = ClConnect.connect(filename);
         dex = new Data_Excel(connect);
         dataGridView1.DataSource = dex.getDataTable("Select [ID] ,[GiaThiet],[KetLuan] from [Luat$] where [ID]<>''");
         dataGridView1.Refresh();
 }