Пример #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();
        }
Пример #2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            textBox1.Text = openFileDialog1.FileName;

            string path = textBox1.Text;

            excelProcess = new ExcelProcess(path);

            dataFexcel = new List <ThuaDat>();

            dataFexcel = excelProcess.ImportAllData();

            dB.InsertDatas("tblLandInf", lst_col_ins, dataFexcel);

            LoadGrid();
        }