Exemple #1
0
    /// <summary>
    /// GDP
    /// </summary>
    public void GDP()
    {
        objEconomicPredict.intYear = Convert.ToInt16(txt1.Text);
        ArrayList FindGDP = objEconomicPredict.FindGDP(objEconomicPredict);

        // --- xml Graph---
        StringBuilder xmlDataGDP = new StringBuilder();

        xmlDataGDP.Append("<chart caption='Year-National GDP Report' subCaption='' Column3DSliceDepth='10' showBorder='1' formatNumberScale='0' numberSuffix=' '>");

        int Get = FindGDP.Count;

        for (int i = 0; i < Get; i++)
        {
            BL.ArrayEconomic objEcono  = (BL.ArrayEconomic)(FindGDP[i]);
            string           NationGDP = objEcono.strNationalGDP;
            //string TransGDP = objEcono.strTransportGDP;
            int yr = objEcono.intYear;

            //int Yr = objEcono.intYear;

            xmlDataGDP.AppendFormat("<set label='{0}' value='{1}' />", yr.ToString(), NationGDP.ToString());
        }
        xmlDataGDP.Append("</chart>");
        GDPGraph.Text = FusionCharts.RenderChart("FusionCharts/Column3D.swf", "", xmlDataGDP.ToString(), "Pie3DGDP", "400", "300", false, true);
    }
Exemple #2
0
        public ArrayList FindGDP(EconomicPredict myEconomicPredict)
        {
            // --- DB Connection ---
            SqlConnection sqlConn = new SqlConnection(DL.SQL.conn);
            SqlDataReader sqlRdr  = null;

            EconomicPredict objEconomicPredict = new EconomicPredict();

            try
            {
                sqlConn.Open();
                // -----------------
                SqlCommand sqlCom = new SqlCommand("GDPPredictor", sqlConn);
                sqlCom.CommandType = CommandType.StoredProcedure;
                sqlCom.Parameters.Add("@InsetedYear", myEconomicPredict.intYear);
                sqlRdr = sqlCom.ExecuteReader();
                // -----------------

                while (sqlRdr.Read())
                {
                    ArrayEconomic objArrayEconomic = new ArrayEconomic();

                    objArrayEconomic.intYear         = Convert.ToInt16(sqlRdr["Year"]);
                    objArrayEconomic.strNationalGDP  = sqlRdr["NationalGDP"].ToString();
                    objArrayEconomic.strTransportGDP = sqlRdr["TransportGDP"].ToString();

                    myArrayGDP.Insert(indexGDP, objArrayEconomic);
                    indexGDP = indexGDP + 1;
                }
            }
            catch (Exception ex)
            {
            }
            return(myArrayGDP);
        }