コード例 #1
0
ファイル: ReportDoanhThu_UI.cs プロジェクト: haodophuc/etak4
        private void LoadDataReport()
        {
            year = (int)spinEdit_Year.Value;

            doanhThuBUS = new DoanhThuBUS();
            gridControl_ViewMode.DataSource = doanhThuBUS.GetDoanhThu(year);
            reportDoanhThuChart             = new Report_DoanhThu_Chart(year);
            reportDoanhThuTable             = new Report_DoanhThu(year);
        }
コード例 #2
0
        private void btTimKiem_Click(object sender, EventArgs e)
        {
            DateTime days = dateThang.Value;
            //DateTime month = Convert.ToDateTime( dateThang.Value.ToString("MM"));
            DoanhThuBUS        doanhThuBus  = new DoanhThuBUS();
            List <DoanhThuDTO> listDoanhThu = doanhThuBus.Select(days.Month, days.Year);

            this.loadDoanhThu(listDoanhThu);
        }
コード例 #3
0
ファイル: BillDAL.cs プロジェクト: AGU18PM/Do-An-Nam-3
        public void submitOrCancelBill(BillDTO bill, DoanhThu doanhThu)
        {
            double discount = 0;
            string sql;

            if (bill.Status == 1)
            {
                if (customerBUS.CheckCustomer(bill.Customer))
                {
                    bill.Customer = customerBUS.getDiscount(bill.Customer);
                    if (bill.Customer.Type == 1)
                    {
                        discount = 20;
                    }
                    bill.TotalPrice = bill.TotalPrice - (bill.TotalPrice * discount / 100);
                }
                sql = "UPDATE BILL_OUT SET TOTALPRICE = " + bill.TotalPrice.ToString() + " , STATUS = 1 , ID_CUSTOMER = " + bill.Customer.ID + " WHERE ID = " + bill.ID;
                DataProvider.Instance.ExecuteNonQuery(sql);
                //Them doanh thu
                DoanhThuBUS doanhThuBUS = new DoanhThuBUS();
                double      tg          = bill.TotalPrice;
                tg            -= doanhThu.Value;
                doanhThu.Value = tg;
                doanhThuBUS.UpdateDoanhThu(doanhThu);
                if (customerBUS.CheckCustomer(bill.Customer))
                {
                    customerBUS.UpdatePayCount(bill.Customer, bill);
                }
            }
            else
            {
                sql = "DELETE FROM BILL_INFO WHERE ID_BILL = " + bill.ID;
                DataProvider.Instance.ExecuteNonQuery(sql);
                sql = "DELETE FROM BILL_OUT WHERE ID = " + bill.ID;
                DataProvider.Instance.ExecuteNonQuery(sql);
            }
        }