示例#1
0
        private void bttThem_Click(object sender, EventArgs e)
        {
            string sql;

            if (comboMaTour.Text.Length == 0)
            {
                MessageBox.Show("Bạn phải nhập mã tour", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                comboMaTour.Focus();
                return;
            }
            if (comboMaKH.Text.Length == 0)
            {
                MessageBox.Show("Bạn phải nhập mã khách hàng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                comboMaKH.Focus();
                return;
            }
            txtNgayLapPC.Text = DateTime.Now.ToString();
            txtSoPC.Text      = creakeyDK();

            sql = "INSERT INTO PHIEUCHI$ (SoPC,MSNV,MaKT,MaKH,MATOUR,NgayLap,SoTienHoanTra) values('" + txtSoPC.Text + "', N'" + comboNVT.SelectedValue + "',N'" +
                  comboKT.SelectedValue + "',N'" + comboMaKH.SelectedValue + "',N'" + comboMaTour.SelectedValue + "','" + txtNgayLapPC.Text + "','" + txtTT.Text + "')";
            Functions.RunSQL(sql);
            Phieuchi pc = new Phieuchi();

            pc.StartPosition = FormStartPosition.CenterParent;
            pc.ShowDialog();
            pc.LoadDataGridViewPC();
            Reset_ValuesDK();
        }
示例#2
0
        private void bttXoa_Click(object sender, EventArgs e)
        {
            string sql;


            if (txtSoPC.Text == "")
            {
                MessageBox.Show("Bạn chưa chọn phiếu chi nào", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show("Bạn có muốn xoá không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                sql = "DELETE FROM PHIEUCHI$ WHERE SoPC=N'" + txtSoPC.Text + "'";
                Functions.RunSqlDel(sql);

                Phieuchi pc = new Phieuchi();
                pc.StartPosition = FormStartPosition.CenterParent;
                pc.ShowDialog();
                pc.LoadDataGridViewPC();
                Reset_ValuesDK();
            }
        }
示例#3
0
        private void toolStripMenuItem15_Click(object sender, EventArgs e)
        {
            Phieuchi pc = new Phieuchi();

            pc.ShowDialog();
        }