private void btnUpdateAgency_Click(object sender, EventArgs e)
 {
     try
     {
         DaiLi_DTO daili = new DaiLi_DTO();
         daili.MaDL   = dtgvAgencyInfoList.CurrentRow.Cells["MaDL"].Value.ToString();
         daili.TenDL  = txtNameAgency.Text;
         daili.DiaChi = txtAddressOfAgency.Text;
         daili.SoDT   = txtNumberPhone.Text;
         daili.TongNo = Convert.ToDouble(txtTotalDebtOfAgency.Text);
         if (txtIDAgency.Text == "" || txtNameAgency.Text == "" || txtAddressOfAgency.Text == "" || txtNumberPhone.Text == "")
         {
             XtraMessageBox.Show("Bạn phải chọn Đại lí cần sửa !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             ClearDisplay();
             return;
         }
         if (DaiLi_BUS.SuaDaiLi(daili))
         {
             XtraMessageBox.Show("Cập nhật Thông tin Đại lí thành công !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             LoadListDaiLi();
             ClearDisplay();
             return;
         }
     }
     catch
     {
         XtraMessageBox.Show("Cập nhật Thông tin Đại lí thất bại !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
예제 #2
0
        private void btnUpdateAgency_Click(object sender, EventArgs e)
        {
            DaiLi_DTO daili = new DaiLi_DTO();

            daili.MaDL   = dtgvAgencyInfoList.CurrentRow.Cells["MaDL"].Value.ToString();
            daili.TenDL  = txtNameAgency.Text;
            daili.DiaChi = txtAddressOfAgency.Text;
            daili.SoDT   = txtNumberPhone.Text;
            if (txtIDAgency.Text == "")
            {
                MessageBox.Show("Bạn phải chọn Đại lí cần sửa !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ClearDisplay();
                return;
            }
            if (DaiLi_BUS.SuaDaiLi(daili))
            {
                MessageBox.Show("Cập nhật tên Đại lí thành công !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadListDaiLi();
                ClearDisplay();
                return;
            }
            MessageBox.Show("Cập nhật tên Đại lí thất bại !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }