예제 #1
0
 private void frmLateCharge_Load(object sender, EventArgs e)
 {
     label2.Text = Cid.ToString();
     listlc      = lcbll.getLateChargeByCustomerID(Cid);
     LoadDataGridView(dgvLateCharge, listlc);
     txtTotalLateCharge.Text = lcbll.sumLateChargeByCustomerID(cid).ToString();
 }
예제 #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (checkInput() == true)
         {
             decimal lc = latechargebll.sumLateChargeByCustomerID(Convert.ToInt32(cmbCustomerID.Text));
             if (lc <= 0)
             {
                 addrental();
             }
             else
             {
                 DialogResult dialogResult = MessageBox.Show("ban muon thanh toan phi tra tre ko ?", "Late Charge", MessageBoxButtons.YesNoCancel);
                 if (dialogResult == DialogResult.Yes)
                 {
                     frmLateCharge child = new frmLateCharge();
                     child.Cid = Convert.ToInt32(cmbCustomerID.Text);
                     child.Show();
                 }
                 else if (dialogResult == DialogResult.No)
                 {
                     addrental();
                 }
                 else if (dialogResult == DialogResult.Cancel)
                 {
                     //ko lam gi
                 }
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("ko co khach hang nay trong he thong, vui long kiem tra lai");
         cmbCustomerID.Text = "";
         cmbCustomerID.Focus();
     }
 }