Example #1
0
        public ViewModel()
        {
            this.Expenditure = new List <Model>();

            Expenditure.Add(new Model()
            {
                Expense = "E-Mail", Amount = 20d
            });
            Expenditure.Add(new Model()
            {
                Expense = "Skype", Amount = 23d
            });
            Expenditure.Add(new Model()
            {
                Expense = "Phone", Amount = 12d
            });
            Expenditure.Add(new Model()
            {
                Expense = "Sms", Amount = 19d
            });
            Expenditure.Add(new Model()
            {
                Expense = "Facebook", Amount = 10d
            });
            Expenditure.Add(new Model()
            {
                Expense = "Twitter", Amount = 10d
            });
            Expenditure.Add(new Model()
            {
                Expense = "LinkedIn", Amount = 9d
            });
        }
Example #2
0
 public PieChartViewModel()
 {
     this.Expenditure = new List <CompanyExpense>();
     Expenditure.Add(new CompanyExpense()
     {
         Expense = "Seeds", Amount = 20d
     });
     Expenditure.Add(new CompanyExpense()
     {
         Expense = "Fertilizers ", Amount = 23d
     });
     Expenditure.Add(new CompanyExpense()
     {
         Expense = "Insurance", Amount = 12d
     });
     Expenditure.Add(new CompanyExpense()
     {
         Expense = "Labor", Amount = 25d
     });
     Expenditure.Add(new CompanyExpense()
     {
         Expense = "Warehousing", Amount = 10d
     });
     Expenditure.Add(new CompanyExpense()
     {
         Expense = "Taxes", Amount = 10d
     });
     Expenditure.Add(new CompanyExpense()
     {
         Expense = "Truck", Amount = 10d
     });
 }
Example #3
0
        public ViewModel_4()
        {
            this.Expenditure = new List <Model_4>();

            double total = 0;

            try
            {
                string        conString = "Data Source=THEPUNISHER;Initial Catalog=OeuvresSociales2;Integrated Security=True";
                SqlConnection connect   = new SqlConnection(conString);

                if (connect.State == ConnectionState.Closed)
                {
                    connect.Open();
                }

                string Query = "SELECT  count(*) AS 'Nombre Demandes'";
                Query += " FROM DemandePrime D INNER JOIN TypePrime T";
                Query += " ON D.CodePrime=T.CodePrime";
                Query += " INNER JOIN PV P";
                Query += " ON D.pv_codepv = P.CodePV";
                Query += " WHERE D.EtatDem = 'A' AND P.DatePV BETWEEN ";
                Query += " '" + dateConvert(Diagram.DEBUT) + "' AND '" + dateConvert(Diagram.FIN) + "'";
                Query += " GROUP BY T.CodePrime,T.désignationPrime";



                SqlCommand mycommand = new SqlCommand(Query, connect);



                SqlDataReader reader = mycommand.ExecuteReader();

                while (reader.Read())
                {
                    total += double.Parse(reader["Nombre Demandes"].ToString());
                }
                reader.Close();


                Query  = "SELECT T.CodePrime, T.DésignationPrime, count(*) AS 'Nombre Demandes'";
                Query += " FROM DemandePrime D INNER JOIN TypePrime T";
                Query += " ON D.CodePrime=T.CodePrime";
                Query += " INNER JOIN PV P";
                Query += " ON D.pv_codepv = P.CodePV";
                Query += " WHERE D.EtatDem = 'A' AND P.DatePV BETWEEN ";
                Query += " '" + dateConvert(Diagram.DEBUT) + "' AND '" + dateConvert(Diagram.FIN) + "'";
                Query += " GROUP BY T.CodePrime,T.désignationPrime";

                mycommand = new SqlCommand(Query, connect);



                reader = mycommand.ExecuteReader();

                int i = 1;

                while (reader.Read())
                {
                    Expenditure.Add(new Model_4()
                    {
                        Expense = getType(i), Amount = double.Parse(reader["Nombre Demandes"].ToString()) / total * 100
                    });
                    i++;
                }

                if (connect.State == ConnectionState.Open)
                {
                    connect.Close();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }



            //Expenditure.Add(new Model_4() { Expense = getType(1), Amount = nbLigne("DemandePrime", "CodePrime=1") / total * 100 });
            //Expenditure.Add(new Model_4() { Expense = getType(2), Amount = nbLigne("DemandePrime", "CodePrime=2") / total * 100 });
            //Expenditure.Add(new Model_4() { Expense = getType(3), Amount = nbLigne("DemandePrime", "CodePrime=3") / total * 100 });
            //Expenditure.Add(new Model_4() { Expense = getType(4), Amount = nbLigne("DemandePrime", "CodePrime=4") / total * 100 });
            //Expenditure.Add(new Model_4() { Expense = getType(5), Amount = nbLigne("DemandePrime", "CodePrime=5") / total * 100 });
            //Expenditure.Add(new Model_4() { Expense = getType(6), Amount = nbLigne("DemandePrime", "CodePrime=6") / total * 100 });
            //Expenditure.Add(new Model_4() { Expense = getType(7), Amount = nbLigne("DemandePrime", "CodePrime=7") / total * 100 });
        }
Example #4
0
        public PieChartViewModel()
        {
            this.Expenditure = new List <CompanyExpense>();
            Expenditure.Add(new CompanyExpense()
            {
                Expense = "Seeds", Amount = 7658d
            });
            Expenditure.Add(new CompanyExpense()
            {
                Expense = "Fertilizers", Amount = 7090d
            });
            Expenditure.Add(new CompanyExpense()
            {
                Expense = "Insurance", Amount = 3577d
            });
            Expenditure.Add(new CompanyExpense()
            {
                Expense = "Labor", Amount = 1473d
            });
            Expenditure.Add(new CompanyExpense()
            {
                Expense = "Warehousing", Amount = 820d
            });
            Expenditure.Add(new CompanyExpense()
            {
                Expense = "Taxes", Amount = 571d
            });
            Expenditure.Add(new CompanyExpense()
            {
                Expense = "Truck", Amount = 462d
            });

            CompanyDetails = new List <CompanyDetail>();
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Rolls Royce", CompanyTurnover = 750000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Benz", CompanyTurnover = 500000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Audi", CompanyTurnover = 450000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "BMW", CompanyTurnover = 700000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Mahindra", CompanyTurnover = 350000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Jaguar", CompanyTurnover = 650000
            });
            CompanyDetails.Add(new CompanyDetail()
            {
                CompanyName = "Hero Honda", CompanyTurnover = 250000
            });

            Metric = new List <Metrics>();
            Metric.Add(new Metrics()
            {
                ResponseTime = 43, Utilization = 32
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 20, Utilization = 34
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 67, Utilization = 41
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 52, Utilization = 42
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 71, Utilization = 48
            });
            Metric.Add(new Metrics()
            {
                ResponseTime = 30, Utilization = 45
            });

            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 = "UP", 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
            });

            AdornmentsFac   = new ResourceFactory();
            AdornmentInfo   = new ChartAdornmentInfo();
            AdornmentInfo1  = new ChartAdornmentInfo();
            AdornmentInfo2  = new ChartAdornmentInfo();
            AdornmentInfo3  = new ChartAdornmentInfo();
            AdornmentInfo4  = new ChartAdornmentInfo();
            AdornmentInfo5  = new ChartAdornmentInfo();
            AdornmentInfo6  = new ChartAdornmentInfo();
            AdornmentInfo7  = new ChartAdornmentInfo();
            AdornmentInfo8  = new ChartAdornmentInfo();
            AdornmentInfo9  = new ChartAdornmentInfo();
            AdornmentInfo10 = new ChartAdornmentInfo();
            AdornmentInfo11 = new ChartAdornmentInfo();

            AdornmentInfo.HorizontalAlignment = HorizontalAlignment.Center;
            AdornmentInfo.VerticalAlignment   = VerticalAlignment.Center;
            AdornmentInfo.ShowConnectorLine   = true;
            AdornmentInfo.UseSeriesPalette    = true;
            AdornmentInfo.ConnectorHeight     = 30;
            AdornmentInfo.ShowLabel           = true;
            AdornmentInfo.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo.LabelTemplate       = AdornmentsFac.labelTemplate8;

            AdornmentInfo1.ShowLabel           = true;
            AdornmentInfo1.FontSize            = 10;
            AdornmentInfo1.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo1.LabelTemplate       = AdornmentsFac.labelTemplate21;

            AdornmentInfo2.ShowLabel           = true;
            AdornmentInfo2.FontSize            = 10;
            AdornmentInfo2.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo2.LabelTemplate       = AdornmentsFac.labelTemplate22;

            AdornmentInfo3.ShowLabel           = true;
            AdornmentInfo3.FontSize            = 10;
            AdornmentInfo3.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo3.LabelTemplate       = AdornmentsFac.labelTemplate23;

            AdornmentInfo4.ShowLabel           = true;
            AdornmentInfo4.SegmentLabelContent = LabelContent.Percentage;
            AdornmentInfo4.SegmentLabelFormat  = "##.#";
            AdornmentInfo4.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo4.HorizontalAlignment = HorizontalAlignment.Center;
            AdornmentInfo4.ConnectorHeight     = 30;
            AdornmentInfo4.VerticalAlignment   = VerticalAlignment.Center;
            AdornmentInfo4.ShowConnectorLine   = true;
            AdornmentInfo4.UseSeriesPalette    = true;

            AdornmentInfo5.ShowLabel        = true;
            AdornmentInfo5.UseSeriesPalette = true;

            AdornmentInfo6.ShowLabel           = true;
            AdornmentInfo6.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo6.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo6.LabelTemplate       = AdornmentsFac.labelTemplate21;

            AdornmentInfo7.ShowLabel           = true;
            AdornmentInfo7.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo7.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo7.LabelTemplate       = AdornmentsFac.labelTemplate22;

            AdornmentInfo8.ShowLabel           = true;
            AdornmentInfo8.SegmentLabelContent = LabelContent.LabelContentPath;
            AdornmentInfo8.AdornmentsPosition  = AdornmentsPosition.Bottom;
            AdornmentInfo8.LabelTemplate       = AdornmentsFac.labelTemplate23;

            AdornmentInfo9.ShowLabel         = true;
            AdornmentInfo9.ShowConnectorLine = true;
            AdornmentInfo9.UseSeriesPalette  = true;
            AdornmentInfo9.ConnectorHeight   = 17;

            AdornmentInfo10.ShowLabel = true;
            AdornmentInfo11.ShowLabel = true;
        }