Exemplo n.º 1
0
        private void fmLogin_Load(object sender, EventArgs e)
        {
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            try
            {
                //đoạn này dùng để khởi tạo record thống kê, lương
                //nhân viên login => không có quyền truy cập thống kê => không tạo được tk
                // khi chưa có thống kê tuownwng ứng => hóa đơn được tạo sẽ không được cập nhật vào thống kê
                // trigger on hóa đơn => update thống kê
                // TH xảy ra:
                //  Đầu tháng: nhân viên đăng nhập => không có quyền tạo tk => không có thống kê tương ứng với tháng mới
                //  nhân viên đặt hóa đơn => không được cộng vào thống kê tương ứng
                // do windows
                Global.global_datacontext = new QLBH_FastFoodDataContext();
                Global.global_datacontext.Connection.Open();
                int        month = DateTime.Now.Month;
                int        year  = DateTime.Now.Year;
                BLLThongKe bltk  = new BLLThongKe();
                string     err;
                bltk.Insert(year, month, out err);
                BLLuong           bLLuong    = new BLLuong();
                BLNhanVien        bLNhanvien = new BLNhanVien();
                List <v_NhanVien> dsnv       = bLNhanvien.dsVNhanVien();
                foreach (v_NhanVien nv in dsnv)
                {
                    bLLuong.Insert(DateTime.Now, nv.MaNV, out err);
                }

                Global.global_datacontext.Connection.Close();
            }
            catch
            {
                MessageBox.Show("Data error (from fmLogin.cs line 42)");
            }
        }
Exemplo n.º 2
0
        public Revenue()
        {
            InitializeComponent();
            blTK = new BLLThongKe();
            string err;

            blTK.Insert(DateTime.Now.Year, DateTime.Now.Month, out err);
            dateTimePicker1.CustomFormat = "YYYY";
            try
            {
                getRevenueByYearTableAdapter.Fill(dataSet_Report.GetRevenueByYear, dateTimePicker1.Value.Year);
                reportViewer1.RefreshReport();
            }
            catch
            {
                reportViewer1.RefreshReport();
            }
        }
Exemplo n.º 3
0
 public void Prestart()
 {
     try
     {
         int        month = DateTime.Now.Month;
         int        year  = DateTime.Now.Year;
         BLLThongKe bltk  = new BLLThongKe();
         string     err;
         bltk.Insert(year, month, out err);
         BLLuong           bLLuong    = new BLLuong();
         BLNhanVien        bLNhanvien = new BLNhanVien();
         List <v_NhanVien> dsnv       = bLNhanvien.dsVNhanVien();
         foreach (v_NhanVien nv in dsnv)
         {
             bLLuong.Insert(DateTime.Now, nv.MaNV, out err);
         }
     }
     catch
     {
         MessageBox.Show("Data error (from Form1.cs line 156)");
     }
 }