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>(); }
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>(); }
private void Form1_Load(object sender, EventArgs e) { if (File.Exists(CauHinh.docfile()[0]) == true) { loadData(); } else { khoa(false); } }
public static OleDbConnection connect(string name) { if (CauHinh.docfile()[1].CompareTo("0") == 0) { return(new OleDbConnection(stringconnectxls1 + name)); //connect file excel 2003; } return(new OleDbConnection(stringconnectxls2 + name)); //connect file excel 2007; return(new OleDbConnection(stringconnectxls3 + name)); //connect file excel 2010; return(new OleDbConnection(stringconnectxls4 + name)); //connect file excel 2013; }