Ejemplo n.º 1
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     if (btnSua.Text == "Sửa")
     {
         LoadDefault(true);
         btnSua.Text           = "Cập nhật";
         btnXoa.Text           = "Hủy";
         btnThemCongNo.Enabled = false;
     }
     else
     {
         DialogResult result = MessageBox.Show("Bạn chắc chắn muốn lưu ?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (result == DialogResult.OK)
         {
             DTO_BaoCaoCongNo bccn = new DTO_BaoCaoCongNo();
             bccn.Id       = long.Parse(txtMa.Text);
             bccn.MaDL     = long.Parse(cbDaiLy.SelectedValue.ToString());
             bccn.NoDau    = uint.Parse(txtNoDau.Text);
             bccn.PhatSinh = uint.Parse(txtPhatSinh.Text);
             bccn.NoCuoi   = uint.Parse(txtNoCuoi.Text);
             bccn.MaTG     = long.Parse(cbThoiGian.SelectedValue.ToString());
             if (cn.SuaCongNo(bccn))
             {
                 MessageBox.Show("Cập nhật công nợ thành công", "Thông báo", MessageBoxButtons.OK);
             }
             else
             {
                 MessageBox.Show("Cập nhật công nợ thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             Reset();
             LoadDefault(false);
         }
     }
 }
Ejemplo n.º 2
0
 public bool SuaCongNo(DTO_BaoCaoCongNo cn)
 {
     return(c.SuaCongNo(cn));
 }
Ejemplo n.º 3
0
 public bool ThemCongNo(DTO_BaoCaoCongNo cn)
 {
     return(c.ThemCongNo(cn));
 }