private void btnCapNhat_Click(object sender, EventArgs e)
 {
     try
     {
         FrmNhapNCC frmNhapNCC = new FrmNhapNCC();
         frmNhapNCC.btnThem.Tag = "up";
         string strMaNCC = dgvNhaCungCap.Rows[intIndex].Cells["colMaNhaCungCap"].Value.ToString();
         frmNhapNCC.txtMaNCC.Text = strMaNCC;
         string strTenNCC = dgvNhaCungCap.Rows[intIndex].Cells["colTenNhaCungCap"].Value.ToString();
         frmNhapNCC.txtTenNCC.Text = strTenNCC;
         string strMaSoThue = dgvNhaCungCap.Rows[intIndex].Cells["colMaSoThue"].Value.ToString();
         frmNhapNCC.txtMaSoThue.Text = strMaSoThue;
         string strSoTaiKhoan = dgvNhaCungCap.Rows[intIndex].Cells["colSoTaiKhoan"].Value.ToString();
         if (strSoTaiKhoan == "")
         {
             strSoTaiKhoan = " Không có thông tin.";
             frmNhapNCC.txtSoTaiKhoan.Text = strSoTaiKhoan;
         }
         else
         {
             frmNhapNCC.txtSoTaiKhoan.Text = strSoTaiKhoan;
         }
         string strNganHang = dgvNhaCungCap.Rows[intIndex].Cells["colNganHang"].Value.ToString();
         if (strNganHang == "")
         {
             strNganHang = " Không có thông tin.";
             frmNhapNCC.txtNganHang.Text = strNganHang;
         }
         else
         {
             frmNhapNCC.txtNganHang.Text = strNganHang;
         }
         string strDienThoai = dgvNhaCungCap.Rows[intIndex].Cells["colDienThoai"].Value.ToString();
         frmNhapNCC.txtDienThoai.Text = strDienThoai;
         string strDiaChi = dgvNhaCungCap.Rows[intIndex].Cells["colDiaChi"].Value.ToString();
         frmNhapNCC.txtDiaChi.Text = strDiaChi;
         string strEmail = dgvNhaCungCap.Rows[intIndex].Cells["colEmail"].Value.ToString();
         if (strEmail == "")
         {
             strEmail = " Không có thông tin.";
             frmNhapNCC.txtEmail.Text = strEmail;
         }
         else
         {
             frmNhapNCC.txtEmail.Text = strEmail;
         }
         string strGhiChu = dgvNhaCungCap.Rows[intIndex].Cells["colGhiChu"].Value.ToString();
         if (strGhiChu == "")
         {
             strGhiChu = " Không có thông tin.";
             frmNhapNCC.txtGhiChu.Text = strGhiChu;
         }
         frmNhapNCC.txtGhiChu.Text = strGhiChu;
         frmNhapNCC.ShowDialog();
         LoadNhaCungCap();
     }
     catch { }
 }
 private void btnCapNhat_Click(object sender, EventArgs e)
 {
     try
     {
         FrmNhapNCC frmNhapNCC = new FrmNhapNCC();
         frmNhapNCC.btnThem.Tag = "up";
         string strMaNCC = dgvNhaCungCap.Rows[intIndex].Cells["colMaNhaCungCap"].Value.ToString();
         frmNhapNCC.txtMaNCC.Text = strMaNCC;
         string strTenNCC = dgvNhaCungCap.Rows[intIndex].Cells["colTenNhaCungCap"].Value.ToString();
         frmNhapNCC.txtTenNCC.Text = strTenNCC;
         string strMaSoThue = dgvNhaCungCap.Rows[intIndex].Cells["colMaSoThue"].Value.ToString();
         frmNhapNCC.txtMaSoThue.Text = strMaSoThue;
         string strSoTaiKhoan = dgvNhaCungCap.Rows[intIndex].Cells["colSoTaiKhoan"].Value.ToString();
         if ( strSoTaiKhoan == "")
         {
             strSoTaiKhoan = " Không có thông tin.";
             frmNhapNCC.txtSoTaiKhoan.Text = strSoTaiKhoan;
         }
         else
         {
             frmNhapNCC.txtSoTaiKhoan.Text = strSoTaiKhoan;
         }
         string strNganHang = dgvNhaCungCap.Rows[intIndex].Cells["colNganHang"].Value.ToString();
         if (strNganHang == "")
         {
             strNganHang = " Không có thông tin.";
             frmNhapNCC.txtNganHang.Text = strNganHang;
         }
         else
         {
             frmNhapNCC.txtNganHang.Text = strNganHang;
         }
         string strDienThoai = dgvNhaCungCap.Rows[intIndex].Cells["colDienThoai"].Value.ToString();
         frmNhapNCC.txtDienThoai.Text = strDienThoai;
         string strDiaChi = dgvNhaCungCap.Rows[intIndex].Cells["colDiaChi"].Value.ToString();
         frmNhapNCC.txtDiaChi.Text = strDiaChi;
         string strEmail = dgvNhaCungCap.Rows[intIndex].Cells["colEmail"].Value.ToString();
         if (strEmail == "")
         {
             strEmail = " Không có thông tin.";
             frmNhapNCC.txtEmail.Text = strEmail;
         }
         else
         {
             frmNhapNCC.txtEmail.Text = strEmail;
         }
         string strGhiChu = dgvNhaCungCap.Rows[intIndex].Cells["colGhiChu"].Value.ToString();
         if (strGhiChu == "")
         {
             strGhiChu = " Không có thông tin.";
             frmNhapNCC.txtGhiChu.Text = strGhiChu;
         }
         frmNhapNCC.txtGhiChu.Text = strGhiChu;
         frmNhapNCC.ShowDialog();
         LoadNhaCungCap();
     }
     catch { }
 }
Exemple #3
0
        private void btnThemNhaCungCap_Click(object sender, EventArgs e)
        {
            FrmNhapNCC frmNhapNCC = new FrmNhapNCC();

            frmNhapNCC.btnThem.Tag = "add";
            string strMaNCC = cf.CreateId("CCA", "NHACUNGCAP");

            frmNhapNCC.txtMaNCC.Text = strMaNCC;
            frmNhapNCC.ShowDialog();
            LoadCMBNhaCungCap();
        }
 private void btnThemNhaCungCap_Click(object sender, EventArgs e)
 {
     FrmNhapNCC frmNhapNCC = new FrmNhapNCC();
     frmNhapNCC.btnThem.Tag = "add";
     string strMaNCC = cf.CreateId("CCA", "NHACUNGCAP");
     frmNhapNCC.txtMaNCC.Text = strMaNCC;
     frmNhapNCC.ShowDialog();
     LoadCMBNhaCungCap();
 }