예제 #1
0
        private void PictureBoxThongKe_Click(object sender, EventArgs e)
        {
            panelThongKe.Visible = true;
            List <MoneyInMonth> revenues    = ThongKeHelper.GetRevenueInMonths(2020);
            List <MoneyInMonth> salaries    = ThongKeHelper.GetSalaryInMonths(2020);
            List <MoneyInMonth> importCosts = ThongKeHelper.GetImportCostInMonth(2020);
            List <MoneyInMonth> soldMoney   = ThongKeHelper.GetMoneyInMonth(2020);

            foreach (var item in revenues)
            {
                chartThongKeDoanhThu.Series["Lợi Nhuận Trong Tháng"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money);
            }

            foreach (var item in salaries)
            {
                chartThongKeDoanhThu.Series["Lương Nhân Viên"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money);
            }

            foreach (var item in importCosts)
            {
                chartThongKeDoanhThu.Series["Nhập Kho"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money);
            }
            foreach (var item in soldMoney)
            {
                chartThongKeDoanhThu.Series["Bán ra"].Points.AddXY("Tháng " + item.Month.ToString(), item.Money);
            }
        }
예제 #2
0
        public void LoadProgress()
        {
            List <MoneyInMonth> salaries = new List <MoneyInMonth>();

            salaries = ThongKeHelper.GetSalaryInMonths(DateTime.Now.Year);
            decimal thisMonth = 0;
            decimal total     = 0;

            foreach (var salary in salaries)
            {
                if (salary.Month == DateTime.Now.Month)
                {
                    thisMonth = salary.Money;
                    total    += salary.Money;
                }
                else
                {
                    total += salary.Money;
                }
            }
            decimal x = (thisMonth / total);

            x *= 100;
            salaryCircleProgressbar3.Value = (int)x;


            List <MoneyInMonth> importedCosts = new List <MoneyInMonth>();

            importedCosts = ThongKeHelper.GetImportCostInMonth(DateTime.Now.Year);
            decimal thisMonth1 = 0;
            decimal total1     = 0;
            decimal x1         = 0;

            foreach (var imported in importedCosts)
            {
                if (imported.Month == DateTime.Now.Month)
                {
                    thisMonth1 = imported.Money;
                    total1    += imported.Money;
                }
                else
                {
                    total1 += imported.Money;
                }
            }
            if (total1 != 0)
            {
                x1  = (thisMonth1 / total1);
                x1 *= 100;
            }
            importedCircleProgressbar2.Value = (int)x1;

            List <MoneyInMonth> soldValues = new List <MoneyInMonth>();

            soldValues = ThongKeHelper.GetMoneyInMonth(2020);
            decimal thisMonth2 = 0;
            decimal total2     = 0;

            foreach (var value in soldValues)
            {
                if (value.Month == DateTime.Now.Month)
                {
                    thisMonth2 = value.Money;
                    total2    += value.Money;
                }
                else
                {
                    total2 += value.Money;
                }
            }
            decimal x2 = (thisMonth2 / total2);

            x2 *= 100;
            soldCircleProgressbar1.Value = (int)x2;
        }