public PartialViewResult ChartDraw5(string[] checkedValues, int min, int max) { ReasonsChart cart = new ReasonsChart(); int[] all = null; cart.Values_per_reasons_for5graph(min, max, checkedValues, out all); // <Sort> for (int i = 0; i < all.Length - 1; i++) { for (int j = 0; j < all.Length - 1; j++) { if (all[j] < all[j + 1]) { int temp = all[j]; all[j] = all[j + 1]; all[j + 1] = temp; string t = checkedValues[j]; checkedValues[j] = checkedValues[j + 1]; checkedValues[j + 1] = t; } } } // <Sort/> ViewBag.All = all; ViewBag.Titles = checkedValues; return(PartialView("Chart45")); }
public PartialViewResult Formatting(int min, int max, string division, DateTime date) { ViewBag.date = date; ViewBag.min = min; ViewBag.max = max; int[] ALLWeekvalues = null; int[] GoodWeekvalues = null; string[] titles = null; string[] titlesM = { "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" }; titles = new string[max - min + 1]; for (int i = 0; i < max - min + 1; i++) { titles[i] = "W" + (min + i).ToString(); } ViewBag.Titles = titles; // --- 1 ---- FirstTypeChart chart = new FirstTypeChart(37); chart.return_all_values_weekly(min, max, out ALLWeekvalues); chart.return_good_values_weekly(min, max, out GoodWeekvalues); ViewBag.all1 = ALLWeekvalues; ViewBag.good1 = GoodWeekvalues; // ---- 2 ------- chart = new FirstTypeChart(38); chart.return_all_values_weekly(min, max, out ALLWeekvalues); chart.return_good_values_weekly(min, max, out GoodWeekvalues); ViewBag.all2 = ALLWeekvalues; ViewBag.good2 = GoodWeekvalues; // ---- 3-------- chart = new FirstTypeChart(39); chart.return_all_values_weekly(min, max, out ALLWeekvalues); chart.return_good_values_weekly(min, max, out GoodWeekvalues); ViewBag.all3 = ALLWeekvalues; ViewBag.good3 = GoodWeekvalues; // -----4-------- chart.return_good_values_per_month(1, 12, out GoodWeekvalues); chart.return_all_values_per_month(1, 12, out ALLWeekvalues); ViewBag.all4 = ALLWeekvalues; ViewBag.good4 = GoodWeekvalues; ViewBag.titlesM = titlesM; // ------ 5-------- ReasonsChart reasonChart = new ReasonsChart(); IEnumerable <string> reasons = null; int local_min = max - 1, local_max = max; if (max <= 1) { local_min = 1; } reasons = reasonChart.Return_all_reasons4(local_min, local_max); string[] r = reasons.ToArray(); reasonChart.Values_per_reasons_for4graph(local_min, local_max, reasons.ToArray(), out ALLWeekvalues); for (int i = 0; i < ALLWeekvalues.Length - 1; i++) { for (int j = 0; j < ALLWeekvalues.Length - 1; j++) { if (ALLWeekvalues[j] < ALLWeekvalues[j + 1]) { int temp = ALLWeekvalues[j]; ALLWeekvalues[j] = ALLWeekvalues[j + 1]; ALLWeekvalues[j + 1] = temp; string t = r[j]; r[j] = r[j + 1]; r[j + 1] = t; } } } ViewBag.all5 = ALLWeekvalues; ViewBag.titlesR = r; // ------ 6 ---------- reasons = reasonChart.Return_all_reasons5(local_min, local_max); reasonChart.Values_per_reasons_for5graph(local_min, local_max, reasons.ToArray(), out ALLWeekvalues); r = reasons.ToArray(); for (int i = 0; i < ALLWeekvalues.Length - 1; i++) { for (int j = 0; j < ALLWeekvalues.Length - 1; j++) { if (ALLWeekvalues[j] < ALLWeekvalues[j + 1]) { int temp = ALLWeekvalues[j]; ALLWeekvalues[j] = ALLWeekvalues[j + 1]; ALLWeekvalues[j + 1] = temp; string t = r[j]; r[j] = r[j + 1]; r[j + 1] = t; } } } ViewBag.all6 = ALLWeekvalues; ViewBag.titlesR2 = r; // ------- 7 ---------- //string[] cities = null; //if (division == divisions[0]) //{ // cities = Cities; //} //if (division == divisions[1]) //{ // cities = DivisionJug; //} //else if (division == divisions[2]) //{ // cities = DivisionDalniiVostok; //} //else if (division == divisions[3]) //{ // cities = DivisionZapadnayaSibir; //} //else if (division == divisions[4]) //{ // cities = DivisionSeveroZapad; //} //else if (division == divisions[5]) //{ // cities = DivisionUral; //} //else if (division == divisions[6]) //{ // cities = DivisionMoskva; //} //else if (division == divisions[7]) //{ // cities = DivisionPovolje; //} //else if (division == divisions[8]) //{ // cities = DivisionCentr; //} //List<int> all = null; //List<int> good = null; //ChartFormat7 chart7 = new ChartFormat7(); //all = chart7.return_all_values_per_week_COUNT(min, max, cities); //good = chart7.return_good_values_per_week_COUNT(min, max, cities); //ALLWeekvalues = new int[all.Count]; //GoodWeekvalues = new int[good.Count]; //for (int i = 0; i < ALLWeekvalues.Length; i++) //{ // ALLWeekvalues[i] = all[i]; // GoodWeekvalues[i] = good[i]; //} //ViewBag.all7 = ALLWeekvalues; //ViewBag.good7 = GoodWeekvalues; //ViewBag.TitlesC = cities; Chart7WithoutDivisions chart7 = new Chart7WithoutDivisions(); List <int> all = new List <int>(), good = new List <int>(); ViewBag.OyTitle = "Количество кодовых номеров"; good = chart7.return_good_values_per_week_SUM(min, max, null); all = chart7.return_all_values_per_week_SUM(min, max, null); ALLWeekvalues = new int[all.Count]; GoodWeekvalues = new int[good.Count]; for (int i = 0; i < ALLWeekvalues.Length; i++) { ALLWeekvalues[i] = all[i]; GoodWeekvalues[i] = good[i]; } ViewBag.all7 = ALLWeekvalues; ViewBag.good7 = GoodWeekvalues; // ------ 7_2----------------- ViewBag.OyTitle = "Количество задач"; all = chart7.return_all_values_per_week_COUNT(min, max, null); good = chart7.return_good_values_per_week_COUNT(min, max, null); ALLWeekvalues = new int[all.Count]; GoodWeekvalues = new int[good.Count]; for (int i = 0; i < ALLWeekvalues.Length; i++) { ALLWeekvalues[i] = all[i]; GoodWeekvalues[i] = good[i]; } ViewBag.all72 = ALLWeekvalues; ViewBag.good72 = GoodWeekvalues; return(PartialView()); }