Exemple #1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            if (!pathexcel.Equals(""))
            {
                excelProcess = new ExcelProcess(pathexcel);
                dataFexcel   = new List <ThuaDat>();
                dataFexcel   = excelProcess.ImportAllData();
                dB.InsertDatas("tblLandInf", lst_col_ins, dataFexcel);
            }
            string condition = GenStringQuery();
            string tmp       = $"select {lst_col} from tblLandInf where {condition}";

            if (flag)
            {
                mGetMerge?.Invoke(dB.ToList(tmp));
            }
            else
            {
                if (MessageBox.Show("Không chọn lọc, xuất tất cả các dữ liệu!", "Chú ý!", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return;
                }
                mGetMerge?.Invoke(dB.ToList($"select {lst_col} from tblLandInf"));
            }
            this.Close();
        }
Exemple #2
0
        private void LoadGrid()
        {
            dataAllBoth = dB.ToList($"select {lst_col} from tblLandInf");

            HeapSort hs = new HeapSort(dataAllBoth);

            dataAllBoth = hs.GetListSorted();

            label4.Text = dataAllBoth.Count + " kết quả !";

            dataGridView1.Rows.Clear();
            int i = 1;

            foreach (var item in dataAllBoth)
            {
                dataGridView1.Rows.Add(item.ToArray(i));
                i++;
            }
        }
Exemple #3
0
        private void Frm_insert_Load(object sender, EventArgs e)
        {
            Create_connect();


            type = new List <ThuaDat>();
            aim  = new List <ThuaDat>();
            type = dB.ToList("select [ID],[Name] from tblType");
            aim  = dB.ToList("select [ID],[Name] from tblAim");

            foreach (var item in type)
            {
                comboBox1.Items.Add(item["Name"]);
            }

            foreach (var item in aim)
            {
                comboBox2.Items.Add(item["Name"]);
            }
            comboBox1.SelectedIndex = comboBox2.SelectedIndex = 0;
        }