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); } } }
public bool SuaCongNo(DTO_BaoCaoCongNo cn) { return(c.SuaCongNo(cn)); }
public bool ThemCongNo(DTO_BaoCaoCongNo cn) { return(c.ThemCongNo(cn)); }