Example #1
0
        //Thống kê Price
        private void btnThongKe_Click(object sender, EventArgs e)
        {
            int priceMonth, priceYear, valMonth, valYear;

            if (lbDay.Text == "" || lbMonth.Text == "" || lbYear.Text == "")
            {
                MessageBox.Show("Bạn Chưa Fill Day ,Month ,Year");
            }
            else
            {
                if (gvThongke.Rows.Count > 0)
                {
                    priceMonth       = _thongkeBLL.FillMonth(month, year);
                    tbPrice.Text     = priceMonth.ToString();
                    priceYear        = _thongkeBLL.FillPriceYear(year);
                    tbYearPrice.Text = priceYear.ToString();
                    valMonth         = _thongkeBLL.FillValueMonth(month, year);
                    valYear          = _thongkeBLL.FillValueYear(year);
                    valueMonth.Value = valMonth;
                    PerMonth.Text    = valMonth.ToString();
                    ValueYear.Value  = valYear;
                    PerYear.Text     = valYear.ToString();
                }
                else
                {
                    tbPrice.Text     = "";
                    tbYearPrice.Text = "";
                    valueMonth.Value = 0;
                    ValueYear.Value  = 0;
                    PerMonth.Text    = "0";
                    PerYear.Text     = "0";
                }
            }

            return;
        }