Ejemplo n.º 1
0
        public PyramidChartViewModel()
        {
            this.Tax = new List <PyramidChartModel>();


            Tax.Add(new PyramidChartModel()
            {
                Category = "Total License", Percentage = 20d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Other", Percentage = 23d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Sales and Gross Receipt", Percentage = 12d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Corporation Net Income", Percentage = 28d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Individual Income", Percentage = 10d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Sales", Percentage = 10d
            });
        }
Ejemplo n.º 2
0
        public ViewModel()
        {
            this.Tax = new List <Model>();


            Tax.Add(new Model()
            {
                Category = "Total License", Percentage = 15d
            });
            Tax.Add(new Model()
            {
                Category = "Other", Percentage = 18d
            });
            Tax.Add(new Model()
            {
                Category = "Sales and Gross Receipt", Percentage = 14d
            });
            Tax.Add(new Model()
            {
                Category = "Corporation Net Income", Percentage = 16d
            });
            Tax.Add(new Model()
            {
                Category = "Individual Income", Percentage = 14d
            });
            Tax.Add(new Model()
            {
                Category = "Sales", Percentage = 15d
            });
        }
Ejemplo n.º 3
0
        public PyramidChartViewModel()
        {
            this.Tax = new List <PyramidChartModel>();


            Tax.Add(new PyramidChartModel()
            {
                Category = "Total License", Percentage = 15d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Sales and Gross Receipt", Percentage = 14d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Corporation Net Income", Percentage = 16d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Individual Income", Percentage = 14d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Intergovernmental transfers", Percentage = 21d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Sales", Percentage = 15d
            });
            Tax.Add(new PyramidChartModel()
            {
                Category = "Other", Percentage = 18d
            });
        }
Ejemplo n.º 4
0
        public bool UpdateTax()
        {
            string description;
            double percentage;

            try
            {
                description = GetDescription();
                percentage  = GetPercentage();
            }
            catch (Exception ex)
            {
                // Message the user regarding the first invalid field
                MessageBox.Show(ex.Message + Environment.NewLine + Environment.NewLine + ex.InnerException.Message, Strings.Exception);
                return(false);
            }

            // Is there an ActiveCategory?
            if (ActiveTax == null)
            {
                ActiveTax = Tax.Add(description, percentage);
            }
            else
            {
                // Update the category values for the ActiveCategory
                ActiveTax.SetTaxName(description);
                ActiveTax.SetPercentage(percentage);

                // Update the database
                ActiveTax.Update();
            }

            return(true);
        }
Ejemplo n.º 5
0
        public ViewModel()
        {
            this.Tax = new List <Model>();

            Tax.Add(new Model()
            {
                Category = "Total License", Percentage = 20d
            });
            Tax.Add(new Model()
            {
                Category = "Other", Percentage = 23d
            });
            Tax.Add(new Model()
            {
                Category = "Sales and Gross Receipt", Percentage = 12d
            });
            Tax.Add(new Model()
            {
                Category = "Corporation Net Income", Percentage = 28d
            });
            Tax.Add(new Model()
            {
                Category = "Individual Income", Percentage = 10d
            });
            Tax.Add(new Model()
            {
                Category = "Sales", Percentage = 10d
            });

            this.Population = new List <Populations>();

            Population.Add(new Populations()
            {
                Continent = "Asia", Countries = "China", States = "Taiwan", PopulationinContinents = 50.02, PopulationinCountries = 26.02, PopulationinStates = 18.02
            });
            Population.Add(new Populations()
            {
                Continent = "Africa", Countries = "India", States = "Shandong", PopulationinContinents = 20.81, PopulationinCountries = 24, PopulationinStates = 8
            });
            Population.Add(new Populations()
            {
                Continent = "Europe", Countries = "Nigeria", States = "Uttar Pradesh", PopulationinContinents = 15.37, PopulationinCountries = 12.81, PopulationinStates = 14.5
            });
            Population.Add(new Populations()
            {
                Countries = "Ethiopia", States = "Maharashtra", PopulationinCountries = 8, PopulationinStates = 9.5
            });
            Population.Add(new Populations()
            {
                Countries = "Germany", States = "Kano", PopulationinCountries = 8.37, PopulationinStates = 7.81
            });
            Population.Add(new Populations()
            {
                Countries = "Turkey", States = "Lagos", PopulationinCountries = 7, PopulationinStates = 5
            });
            Population.Add(new Populations()
            {
                States = "Oromia", PopulationinStates = 5
            });
            Population.Add(new Populations()
            {
                States = "Amhara", PopulationinStates = 3
            });
            Population.Add(new Populations()
            {
                States = "Hessen", PopulationinStates = 5.37
            });
            Population.Add(new Populations()
            {
                States = "Bayern", PopulationinStates = 3
            });
            Population.Add(new Populations()
            {
                States = "Istanbul", PopulationinStates = 4.5
            });
            Population.Add(new Populations()
            {
                States = "Ankara", PopulationinStates = 2.5
            });

            ExpenditureData = new List <Populations>
            {
                new Populations()
                {
                    Category = "Vehicle", Expenditure = 62.7, Image = new Uri(@"\Image\Car.png", UriKind.RelativeOrAbsolute)
                },
                new Populations()
                {
                    Category = "Education", Expenditure = 29.5, Image = new Uri(@"\Image\Chart_Book.png", UriKind.RelativeOrAbsolute)
                },
                new Populations()
                {
                    Category = "Home", Expenditure = 85.2, Image = new Uri(@"\Image\House.png", UriKind.RelativeOrAbsolute)
                },
                new Populations()
                {
                    Category = "Personal", Expenditure = 45.6, Image = new Uri(@"\Image\Personal.png", UriKind.RelativeOrAbsolute)
                },
            };
        }
        public ViewModelHinhTronHinhTron()
        {
            this.Tax = new List <ModelHinhTron>();
            var db = new MyDatabaseEntities();



            if (TrangThongKe.KieuThongKe == 0)
            {
                int YearXet  = TrangThongKe.Year;
                int MonthXet = TrangThongKe.Month;
                int DayXet   = TrangThongKe.Day;
                //Tong SLL SP
                int TongSLDaBan = 0;

                List <GioHang> data = new List <GioHang>();
                foreach (var DH in db.DonHangs.ToList())
                {
                    DateTime dateTime = (DateTime)DH.NgayTao;
                    if (dateTime.Year == YearXet && dateTime.Month == MonthXet && dateTime.Day == DayXet)
                    {
                        foreach (var GH in db.GioHangs.ToList())
                        {
                            if (DH.GioHang.ID == GH.ID)
                            {
                                data.Add(GH);
                                TongSLDaBan += (int)GH.SoLuong;
                            }
                        }
                    }
                }

                for (int i = 0; i < data.Count; ++i)
                {
                    if (data[i].SanPham_ID == 0)
                    {
                        continue;
                    }
                    int TongSL = (int)data[i].SoLuong;
                    for (int j = i + 1; j < data.Count; ++j)
                    {
                        if (data[i].SanPham_ID == data[j].SanPham_ID)
                        {
                            TongSL            += (int)data[j].SoLuong;
                            data[j].SanPham_ID = 0;
                        }
                    }
                    Tax.Add(new ModelHinhTron()
                    {
                        Category = data[i].SanPham.Ten, Percentage = (double)TongSL * 100 / TongSLDaBan
                    });
                }
            }
            else if (TrangThongKe.KieuThongKe == 1)
            {
                int YearXet  = TrangThongKe.Year;
                int MonthXet = TrangThongKe.Month;

                //Tong SLL SP
                int TongSLDaBan = 0;

                List <GioHang> data = new List <GioHang>();
                foreach (var DH in db.DonHangs.ToList())
                {
                    DateTime dateTime = (DateTime)DH.NgayTao;
                    if (dateTime.Year == YearXet && dateTime.Month == MonthXet)
                    {
                        foreach (var GH in db.GioHangs.ToList())
                        {
                            if (DH.GioHang.ID == GH.ID)
                            {
                                data.Add(GH);
                                TongSLDaBan += (int)GH.SoLuong;
                            }
                        }
                    }
                }

                for (int i = 0; i < data.Count; ++i)
                {
                    if (data[i].SanPham_ID == 0)
                    {
                        continue;
                    }
                    int TongSL = (int)data[i].SoLuong;
                    for (int j = i + 1; j < data.Count; ++j)
                    {
                        if (data[i].SanPham_ID == data[j].SanPham_ID)
                        {
                            TongSL            += (int)data[j].SoLuong;
                            data[j].SanPham_ID = 0;
                        }
                    }
                    Tax.Add(new ModelHinhTron()
                    {
                        Category = data[i].SanPham.Ten, Percentage = (double)TongSL * 100 / TongSLDaBan
                    });
                }
            }
            else if (TrangThongKe.KieuThongKe == 2)
            {
                int YearXet = TrangThongKe.Year;

                int QuyXet     = TrangThongKe.Quy;
                int MonthStart = -1;
                int MonthEnd   = -1;
                if (QuyXet == 1)
                {
                    MonthStart = 1;
                    MonthEnd   = 3;
                }
                else if (QuyXet == 2)
                {
                    MonthStart = 4;
                    MonthEnd   = 6;
                }
                else if (QuyXet == 3)
                {
                    MonthStart = 7;
                    MonthEnd   = 9;
                }
                else if (QuyXet == 4)
                {
                    MonthStart = 10;
                    MonthEnd   = 12;
                }

                //Tong SLL SP
                int TongSLDaBan = 0;

                List <GioHang> data = new List <GioHang>();
                foreach (var DH in db.DonHangs.ToList())
                {
                    DateTime dateTime = (DateTime)DH.NgayTao;
                    if (dateTime.Year == YearXet && dateTime.Month >= MonthStart && dateTime.Month <= MonthEnd)
                    {
                        foreach (var GH in db.GioHangs.ToList())
                        {
                            if (DH.GioHang.ID == GH.ID)
                            {
                                data.Add(GH);
                                TongSLDaBan += (int)GH.SoLuong;
                            }
                        }
                    }
                }

                for (int i = 0; i < data.Count; ++i)
                {
                    if (data[i].SanPham_ID == 0)
                    {
                        continue;
                    }
                    int TongSL = (int)data[i].SoLuong;
                    for (int j = i + 1; j < data.Count; ++j)
                    {
                        if (data[i].SanPham_ID == data[j].SanPham_ID)
                        {
                            TongSL            += (int)data[j].SoLuong;
                            data[j].SanPham_ID = 0;
                        }
                    }
                    Tax.Add(new ModelHinhTron()
                    {
                        Category = data[i].SanPham.Ten, Percentage = (double)TongSL * 100 / TongSLDaBan
                    });
                }
            }
            else if (TrangThongKe.KieuThongKe == 3)
            {
                int YearXet = TrangThongKe.Year;

                //Tong SLL SP
                int TongSLDaBan = 0;

                List <GioHang> data = new List <GioHang>();
                foreach (var DH in db.DonHangs.ToList())
                {
                    DateTime dateTime = (DateTime)DH.NgayTao;
                    if (dateTime.Year == YearXet)
                    {
                        foreach (var GH in db.GioHangs.ToList())
                        {
                            if (DH.GioHang.ID == GH.ID)
                            {
                                data.Add(GH);
                                TongSLDaBan += (int)GH.SoLuong;
                            }
                        }
                    }
                }

                for (int i = 0; i < data.Count; ++i)
                {
                    if (data[i].SanPham_ID == 0)
                    {
                        continue;
                    }
                    int TongSL = (int)data[i].SoLuong;
                    for (int j = i + 1; j < data.Count; ++j)
                    {
                        if (data[i].SanPham_ID == data[j].SanPham_ID)
                        {
                            TongSL            += (int)data[j].SoLuong;
                            data[j].SanPham_ID = 0;
                        }
                    }
                    Tax.Add(new ModelHinhTron()
                    {
                        Category = data[i].SanPham.Ten, Percentage = (double)TongSL * 100 / TongSLDaBan
                    });
                }
            }
            else if (TrangThongKe.KieuThongKe == 4)
            {
                DateTime datestart = TrangThongKe.DateStart;
                DateTime dateEnd   = TrangThongKe.DateEnd;
                DateTime dateNow   = datestart;

                //Tong SLL SP
                int TongSLDaBan = 0;

                List <GioHang> data = new List <GioHang>();
                foreach (var DH in db.DonHangs.ToList())
                {
                    DateTime dateTime = (DateTime)DH.NgayTao;
                    if (dateTime >= datestart && dateTime <= dateEnd)
                    {
                        foreach (var GH in db.GioHangs.ToList())
                        {
                            if (DH.GioHang.ID == GH.ID)
                            {
                                data.Add(GH);
                                TongSLDaBan += (int)GH.SoLuong;
                            }
                        }
                    }
                }

                for (int i = 0; i < data.Count; ++i)
                {
                    if (data[i].SanPham_ID == 0)
                    {
                        continue;
                    }
                    int TongSL = (int)data[i].SoLuong;
                    for (int j = i + 1; j < data.Count; ++j)
                    {
                        if (data[i].SanPham_ID == data[j].SanPham_ID)
                        {
                            TongSL            += (int)data[j].SoLuong;
                            data[j].SanPham_ID = 0;
                        }
                    }
                    Tax.Add(new ModelHinhTron()
                    {
                        Category = data[i].SanPham.Ten, Percentage = (double)TongSL * 100 / TongSLDaBan
                    });
                }
            }
        }
        public DoughnutChartViewModel()
        {
            StartAngle = 180;
            EndAngle   = 360;

            this.Tax = new List <DoughnutChartModel>();

            Tax.Add(new DoughnutChartModel()
            {
                Category = "Total License", Percentage = 20d
            });
            Tax.Add(new DoughnutChartModel()
            {
                Category = "Other", Percentage = 23d
            });
            Tax.Add(new DoughnutChartModel()
            {
                Category = "Sales and Gross Receipt", Percentage = 12d
            });
            Tax.Add(new DoughnutChartModel()
            {
                Category = "Corporation Net Income", Percentage = 28d
            });
            Tax.Add(new DoughnutChartModel()
            {
                Category = "Individual Income", Percentage = 10d
            });
            Tax.Add(new DoughnutChartModel()
            {
                Category = "Sales", Percentage = 10d
            });

            this.Population = new List <DoughnutChartPopulations>();

            Population.Add(new DoughnutChartPopulations()
            {
                Continent = "Asia", Countries = "China", States = "Taiwan", PopulationinContinents = 50.02, PopulationinCountries = 26.02, PopulationinStates = 18.02
            });
            Population.Add(new DoughnutChartPopulations()
            {
                Continent = "Africa", Countries = "India", States = "Shandong", PopulationinContinents = 20.81, PopulationinCountries = 24, PopulationinStates = 8
            });
            Population.Add(new DoughnutChartPopulations()
            {
                Continent = "Europe", Countries = "Nigeria", States = "Uttar Pradesh", PopulationinContinents = 15.37, PopulationinCountries = 12.81, PopulationinStates = 14.5
            });
            Population.Add(new DoughnutChartPopulations()
            {
                Countries = "Ethiopia", States = "Maharashtra", PopulationinCountries = 8, PopulationinStates = 9.5
            });
            Population.Add(new DoughnutChartPopulations()
            {
                Countries = "Germany", States = "Kano", PopulationinCountries = 8.37, PopulationinStates = 7.81
            });
            Population.Add(new DoughnutChartPopulations()
            {
                Countries = "Turkey", States = "Lagos", PopulationinCountries = 7, PopulationinStates = 5
            });
            Population.Add(new DoughnutChartPopulations()
            {
                States = "Oromia", PopulationinStates = 5
            });
            Population.Add(new DoughnutChartPopulations()
            {
                States = "Amhara", PopulationinStates = 3
            });
            Population.Add(new DoughnutChartPopulations()
            {
                States = "Hessen", PopulationinStates = 5.37
            });
            Population.Add(new DoughnutChartPopulations()
            {
                States = "Bayern", PopulationinStates = 3
            });
            Population.Add(new DoughnutChartPopulations()
            {
                States = "Istanbul", PopulationinStates = 4.5
            });
            Population.Add(new DoughnutChartPopulations()
            {
                States = "Ankara", PopulationinStates = 2.5
            });

            ExpenditureData = new List <DoughnutChartPopulations>
            {
                new DoughnutChartPopulations()
                {
                    Category = "Vehicle", Expenditure = 62.7, Image = new Uri(@"/syncfusion.chartdemos.wpf;component/Assets/Chart/Car.png", UriKind.RelativeOrAbsolute)
                },
                new DoughnutChartPopulations()
                {
                    Category = "Education", Expenditure = 29.5, Image = new Uri(@"/syncfusion.chartdemos.wpf;component/Assets/Chart/Chart_Book.png", UriKind.RelativeOrAbsolute)
                },
                new DoughnutChartPopulations()
                {
                    Category = "Home", Expenditure = 85.2, Image = new Uri(@"/syncfusion.chartdemos.wpf;component/Assets/Chart/House.png", UriKind.RelativeOrAbsolute)
                },
                new DoughnutChartPopulations()
                {
                    Category = "Personal", Expenditure = 45.6, Image = new Uri(@"/syncfusion.chartdemos.wpf;component/Assets/Chart/Personal.png", UriKind.RelativeOrAbsolute)
                },
            };

            this.Metrics = new List <SemiPieAndDoughnutChartModel>();
            Metrics.Add(new SemiPieAndDoughnutChartModel(43, 32));
            Metrics.Add(new SemiPieAndDoughnutChartModel(20, 34));
            Metrics.Add(new SemiPieAndDoughnutChartModel(67, 41));
            Metrics.Add(new SemiPieAndDoughnutChartModel(52, 42));
            Metrics.Add(new SemiPieAndDoughnutChartModel(71, 48));
            Metrics.Add(new SemiPieAndDoughnutChartModel(30, 45));
        }
Ejemplo n.º 8
0
        public ViewModel()
        {
            this.Tax = new List <Model>();

            Tax.Add(new Model()
            {
                Category = "Total License", Percentage = 20d
            });
            Tax.Add(new Model()
            {
                Category = "Other", Percentage = 23d
            });
            Tax.Add(new Model()
            {
                Category = "Sales and Gross Receipt", Percentage = 12d
            });
            Tax.Add(new Model()
            {
                Category = "Corporation Net Income", Percentage = 28d
            });
            Tax.Add(new Model()
            {
                Category = "Individual Income", Percentage = 10d
            });
            Tax.Add(new Model()
            {
                Category = "Sales", Percentage = 10d
            });

            this.Population = new List <Populations>();

            Population.Add(new Populations()
            {
                Continent = "Asia", Countries = "China", States = "Taiwan", PopulationinContinents = 50.02, PopulationinCountries = 26.02, PopulationinStates = 18.02
            });
            Population.Add(new Populations()
            {
                Continent = "Africa", Countries = "India", States = "Shandong", PopulationinContinents = 20.81, PopulationinCountries = 24, PopulationinStates = 8
            });
            Population.Add(new Populations()
            {
                Continent = "Europe", Countries = "Nigeria", States = "Uttar Pradesh", PopulationinContinents = 15.37, PopulationinCountries = 12.81, PopulationinStates = 14.5
            });
            Population.Add(new Populations()
            {
                Countries = "Ethiopia", States = "Maharashtra", PopulationinCountries = 8, PopulationinStates = 9.5
            });
            Population.Add(new Populations()
            {
                Countries = "Germany", States = "Kano", PopulationinCountries = 8.37, PopulationinStates = 7.81
            });
            Population.Add(new Populations()
            {
                Countries = "Turkey", States = "Lagos", PopulationinCountries = 7, PopulationinStates = 5
            });
            Population.Add(new Populations()
            {
                States = "Oromia", PopulationinStates = 5
            });
            Population.Add(new Populations()
            {
                States = "Amhara", PopulationinStates = 3
            });
            Population.Add(new Populations()
            {
                States = "Hessen", PopulationinStates = 5.37
            });
            Population.Add(new Populations()
            {
                States = "Bayern", PopulationinStates = 3
            });
            Population.Add(new Populations()
            {
                States = "Istanbul", PopulationinStates = 4.5
            });
            Population.Add(new Populations()
            {
                States = "Ankara", PopulationinStates = 2.5
            });
        }