Пример #1
0
 private void btnUpdateSpeciesCommodity_Click(object sender, EventArgs e)
 {
     if (id1 != 0)
     {
         if (ck.checkNullTextbox(txtNameCommodity.Text.ToString()) && ck.checkNullTextbox(txtDistributor.Text.ToString()))
         {
             DTO.HangHoa hh = new DTO.HangHoa();
             hh.id_hh         = id1;
             hh.namecommodity = txtNameCommodity.Text;
             hh.distributor   = txtDistributor.Text;
             hh.unit          = cbUnit.Text;
             bll.updateHH(hh);
             loadDgv();
             reset();
         }
         else
         {
             MessageBox.Show("Thiếu thông tin nhân viên", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("Chưa chọn nhân viên cần sửa", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Пример #2
0
 private void btnDeleteSpeciesCommodity_Click(object sender, EventArgs e)
 {
     if (id1 != 0)
     {
         DialogResult result = MessageBox.Show("Xác nhân xóa loại hàng", "THÔNG BÁO", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
         if (result == DialogResult.Yes)
         {
             DTO.HangHoa hh = new DTO.HangHoa();
             hh.id_hh = id1;
             bll.deleteHH(hh);
             loadDgv();
             reset();
         }
         else
         {
             MessageBox.Show("Hủy xóa loại hàng", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information);
             reset();
         }
     }
     else
     {
         MessageBox.Show("Chưa chọn loại hàng cần xóa", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }