Ejemplo n.º 1
0
        private void cmd_load_Click(object sender, System.EventArgs e)
        {
            frmTaSaveExcel dlg = new frmTaSaveExcel();

            dlg.ketqua  = "1";
            dlg.ketqua1 = cmd_load.Text;
            dlg.Tag     = this.Tag;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                for (int i = 1; i < vs.Rows.Count; i++)
                {
                    vs.Rows[i]["COL"] = T_String.GetDataFromSQL("COL_ID", "GP_EXCEL_DETAIL", "EXC_ID=N'" + dlg.ketqua + "' and "
                                                                + " COL_NM=N'" + vs.Rows[i]["COL_NM"] + "'");
                }
                txt_WID.Text = T_String.GetDataFromSQL("COL_ID", "GP_EXCEL_DETAIL", "EXC_ID=N'" + dlg.ketqua + "' and "
                                                       + " COL_NM=N'EMP_ID'");
                txt_DWID.Text = T_String.GetDataFromSQL("COL_ID", "GP_EXCEL_DETAIL", "EXC_ID=N'" + dlg.ketqua + "' and "
                                                        + " COL_NM=N'EMP_I1'");
            }
        }
Ejemplo n.º 2
0
        private void cmd_save_Click(object sender, System.EventArgs e)
        {
            frmTaSaveExcel dlg = new frmTaSaveExcel();

            dlg.ketqua  = "0";
            dlg.ketqua1 = cmd_save.Text;
            dlg.Tag     = this.Tag;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string sql = "";
                for (int i = 1; i < vs.Rows.Count; i++)
                {
                    sql = "Insert into GP_EXCEL_DETAIL Values(N'"
                          + dlg.txt.Text + "',N'" + vs.Rows[i]["COL_NM"] + "',N'" + vs.Rows[i]["COL"] + "')";
                    PublicFunction.SQL_Execute(sql);
                }
                sql = "Insert into GP_EXCEL_DETAIL Values(N'"
                      + dlg.txt.Text + "',N'EMP_ID',N'" + txt_WID.Text + "')";
                PublicFunction.SQL_Execute(sql);
                sql = "Insert into GP_EXCEL_DETAIL Values(N'"
                      + dlg.txt.Text + "',N'EMP_I1',N'" + txt_DWID.Text + "')";
                PublicFunction.SQL_Execute(sql);
            }
        }