Example #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();
        }
Example #2
0
        private void Button7_Click(object sender, EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            label3.Text = saveFileDialog1.FileName;

            string pathexp = label3.Text;

            //Set custom column name in file export
            col = new ThuaDat("STT,Địa chỉ,Diện tích,Chủ sở hữu hiện tại,Loại nhà,Mục đích sử dụng,Giá tiền");

            ExcelProcess.ExportData(pathexp, dataAllBoth, col);
        }
Example #3
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();
        }