예제 #1
0
        public ActionResult About()
        {
            FinanceToolEntities financetoolentities = new FinanceToolEntities();

            var           data = financetoolentities.Usp_GetForecastValues().ToList();
            List <string> lstforecastvalues = new List <string>();
            List <string> QuaterName        = new List <string>();

            //ViewBag.Message = "Your application description page.";
            foreach (var item in data)
            {
                //var value = item.GetType().GetProperty(item.QuaterName);
                //var Quartervalue = value.GetValue(item, null).ToString();
                var qvalue = MyCustomFormat(Convert.ToDouble(item.ForecastValues));
                lstforecastvalues.Add(qvalue);
                QuaterName.Add(item.QuaterName);
            }

            string names        = QuaterName[0] + "," + QuaterName[1] + "," + QuaterName[2] + "," + QuaterName[3];
            var    quarternames = names;

            Session["QuarterNames"] = quarternames;
            string forecastvalues = lstforecastvalues[0] + "," + lstforecastvalues[1] + "," + lstforecastvalues[2] + "," + lstforecastvalues[3];

            //var forecastvaluesarr = forecastvalues.Split(',');
            Session["forecastvalues"] = forecastvalues;

            return(View());
        }