Example #1
0
        private void dataGridView_DoubleClick(object sender, EventArgs e)
        {
            Forms.frmHoadonnhap f = new frmHoadonnhap();
            f.StartPosition = FormStartPosition.CenterScreen;
            if (dataGridView.Rows.Count == 0)
            {
                MessageBox.Show("Không có dữ liệu!", "Thông báo");
                return;
            }
            f.txtMahoadon.Text   = dataGridView.CurrentRow.Cells["MaHDN"].Value.ToString();
            f.dtpNgaynhap.Text   = dataGridView.CurrentRow.Cells["Ngaynhap"].Value.ToString();
            f.cboMaNCC.Text      = dataGridView.CurrentRow.Cells["MaNCC"].Value.ToString();
            f.cboManhanvien.Text = dataGridView.CurrentRow.Cells["MaNV"].Value.ToString();
            f.txtTongtien.Text   = dataGridView.CurrentRow.Cells["Tongtien"].Value.ToString();
            f.lblBangchu.Text    = "Bằng chữ:" + ThucthiSQL.ChuyenSoSangChu(dataGridView.CurrentRow.Cells["Tongtien"].Value.ToString());
            if (dataGridView.CurrentRow.Cells["Trangthai"].Value.ToString() == "Da thanh toan")
            {
                f.chkThanhtoan.Checked = true;
            }
            string    sql   = "select TenNCC, Diachi, SDT from tblNCC where MaNCC=N'" + f.cboMaNCC.Text + "'";
            DataTable table = ThucthiSQL.DocBang(sql);

            if (table.Rows.Count > 0)
            {
                f.txtTenNCC.Text    = table.Rows[0][0].ToString();
                f.txtDiachi.Text    = table.Rows[0][1].ToString();
                f.txtDienthoai.Text = table.Rows[0][2].ToString();
            }
            sql   = "select TenNV from tblNhanvien where MaNV=N'" + f.cboManhanvien.Text + "'";
            table = ThucthiSQL.DocBang(sql);
            if (table.Rows.Count > 0)
            {
                f.txtTennhanvien.Text = table.Rows[0][0].ToString();
            }
            f.Hienthi_Luoi();
            f.Show();
            f.btnThem.Enabled    = false;
            f.grbChitiet.Enabled = true;
        }
Example #2
0
 private void hóaĐơnNhậpToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Forms.frmHoadonnhap f = new frmHoadonnhap();
     f.StartPosition = FormStartPosition.CenterScreen;
     f.Show();
 }