private void buttonLuu_Click(object sender, EventArgs e)
        {
            int      mx  = Convert.ToInt32(cbbMaXe.SelectedValue);
            DateTime ntt = dtpNgayThuTien.Value.Date;

            if (IsNumber(txtTienThu.Text) && txtTienThu.Text != "" && txtTienDua.Text != "" && IsNumber(txtTienDua.Text))
            {
                int stt = Convert.ToInt32(txtTienThu.Text);

                int tienno  = Convert.ToInt32(txtNoCu.Text);
                int tienthu = Convert.ToInt32(txtTienThu.Text);
                if (tienthu > tienno)
                {
                    MessageBox.Show("Số tiền thu lớn hơn số tiền nợ, vui lòng nhập lại!", "Thông báo");
                    return;
                }
                if (dtpNgayThuTien.Value > DateTime.Now)
                {
                    MessageBox.Show("Ngày tiếp nhận chưa hợp lệ!", "Thông báo");
                    return;
                }
                PhieuThuDAO.ThemPhieuThu(mx, dtpNgayThuTien.Text, stt);
            }
            else
            {
                MessageBox.Show("Tiền thu hoặc tiền đưa không hợp lệ, vui lòng nhập lại!", "Thông báo");
            }
        }
Beispiel #2
0
        private void btnprint_Click(object sender, EventArgs e)
        {
            frminphieuthu   f   = new frminphieuthu();
            rptphieuthutien rpt = new rptphieuthutien();

            rpt.SetDataSource(PhieuThuDAO.GetPhieuThuCondition(int.Parse(txtmaphieuthu.Text)));
            f.viewinphieuthu.ReportSource = rpt;
            f.Show();
        }
Beispiel #3
0
 public static bool ThemPhieuThu(PhieuThuDTO pt)
 {
     if (PhieuThuDAO.GetPhieuThuByMa(pt.MaPhieuThu) == null)
     {
         PhieuThuDAO.Insert(pt);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #4
0
 public static bool SuaPhieuThu(PhieuThuDTO pt)
 {
     if (PhieuThuDAO.GetPhieuThuByMa(pt.MaPhieuThu) != null)
     {
         PhieuThuDAO.Update(pt);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #5
0
 public void hienthiphieuthu()
 {
     dgvphieuthutien.DataSource = PhieuThuDAO.GetPhieuThuAll();
 }
 public static Array LoadPhieuThu()
 {
     return(PhieuThuDAO.LoadPhieuThu());
 }
 public static void AddReceipt(string idDocGia, string soTienThu, string tongNo, string conLai)
 {
     PhieuThuDAO.AddReceipt(Int32.Parse(idDocGia), Double.Parse(soTienThu), Double.Parse(tongNo), double.Parse(conLai));
     UpdateNo(idDocGia, conLai);
 }
Beispiel #8
0
 public PhieuThuBUS(PhieuThuDAO pt, HopDongDAO hd)
 {
     _pt = pt;
     _hd = hd;
 }
Beispiel #9
0
 public PhieuThuBUS()
 {
     this.phieuThuDAO = new PhieuThuDAO();
 }