Exemple #1
0
 private void tinhNoKyCuoi_PhatSinh()
 {
     try
     {
         ngayLapSelected = Convert.ToDateTime(dateEdit_ngayLap.Text);
         if (ngayLapSelected.Month == 1)
         {
             noKyDau = objBCBUS.getNoKyCuoi(maKHSelected, 12, ngayLapSelected.Year - 1);
         }
         else
         {
             noKyDau = objBCBUS.getNoKyCuoi(maKHSelected, ngayLapSelected.Month - 1, ngayLapSelected.Year);
         }
         textEdit_noKyDau.Text = noKyDau.ToString();
         int phatSinhThangNay = objPTBUS.getTongTienNoTrongThang(maKHSelected, ngayLapSelected.Month, ngayLapSelected.Year);
         textEdit_phatSinh.Text = phatSinhThangNay.ToString();
         if (textEdit_phatSinh.Text.Length > 0)
         {
             textEdit_noKyCuoi.Text = (noKyDau + Convert.ToInt32(textEdit_phatSinh.Text)).ToString();
         }
     }
     catch (Exception e)
     {
         XtraMessageBox.Show("Lỗi tính nợ cuối kỳ: " + e.Message);
     }
 }
Exemple #2
0
        private void tinhNoKyCuoi_PhatSinh()
        {
            ngayLapSelected = Convert.ToDateTime(dateEdit_ngayLap.Text);
            if (ngayLapSelected.Month == 1)
            {
                noKyDau = objBCBUS.getNoKyCuoi(maKHSelected, 12, ngayLapSelected.Year - 1);
            }
            else
            {
                noKyDau = objBCBUS.getNoKyCuoi(maKHSelected, ngayLapSelected.Month - 1, ngayLapSelected.Year);
            }
            textEdit_noKyDau.Text = noKyDau.ToString();
            int phatSinhThangNay = objPTBUS.getTongTienNoTrongThang(maKHSelected, ngayLapSelected.Month, ngayLapSelected.Year);

            textEdit_phatSinh.Text = phatSinhThangNay.ToString();
            if (textEdit_phatSinh.Text.Length > 0)
            {
                textEdit_noKyCuoi.Text = (noKyDau + Convert.ToInt32(textEdit_phatSinh.Text)).ToString();
            }
        }