Ejemplo n.º 1
0
        private void btnLapBaoCao_Click(object sender, EventArgs e)
        {
            if (!fMainForm.cNullTB(txtMaBaoCao.Text))
            {
                DateTime thang0 = dtmThangLapBaoCao.Value;
                string   maBC   = txtMaBaoCao.Text.Trim();
                if (!DoanhSoDAO.CheckPrimary(maBC))
                {
                    dgvBaoCaoDoanhSo.DataSource = DoanhSoBUS.createBaoCaoDoanhSo(thang0.Month, thang0.Year);
                    DoanhSoBUS.insertBaoCaoDoanhSo(maBC, thang0, thang0.Month, thang0.Year);

                    txtTongDoanhThu.Text = DoanhSoBUS.selectTongDoanhThu(thang0).ToString();
                }
                else
                {
                    MessageBox.Show("Dữ liệu vừa nhập vào không hợp lệ, do bị trùng khóa chính.");
                }
            }
            else
            {
                MessageBox.Show("Hãy nhập mã báo cáo.");
            }
        }
Ejemplo n.º 2
0
 public static DataTable createBaoCaoDoanhSo(int thang, int nam)
 {
     return(DoanhSoDAO.createBaoCaoDoanhSo(thang, nam));
 }
Ejemplo n.º 3
0
 public static bool checkPK(string primaryKey)
 {
     return(DoanhSoDAO.CheckPrimary(primaryKey));
 }
Ejemplo n.º 4
0
 public static DataTable selectTongDoanhThu(DateTime _Thang0)
 {
     return(DoanhSoDAO.selectTongDoanhThu(_Thang0));
 }
Ejemplo n.º 5
0
 public static void insertBaoCaoDoanhSo(string MaBaoCao, DateTime thang0, int thang, int nam)
 {
     DoanhSoDAO.insertBaoCaoDoanhSo(MaBaoCao, thang0, thang, nam);
 }