Beispiel #1
0
        public ActionResult MenuLogs(string Selection)
        {
            int Month = 1;

            if (Selection != "" && Selection != null)
            {
                string[] S = Selection.Split(';');
                int      Y = Convert.ToInt16(S[0]);

                Month = Opr.MonthObratno(S[1]);
                List <string> Day = new List <string>();
                for (int i = 1; i <= DateTime.DaysInMonth(Y, Month); i++)
                {
                    Day.Add(i.ToString());
                }
                ViewBag.Day = Day;
            }
            else
            {
                List <string> Day = new List <string>();
                for (int i = 1; i <= DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); i++)
                {
                    Day.Add(i.ToString());
                }
                ViewBag.Day = Day;
            }
            List <string> M = new List <string> {
                "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"
            };

            M.RemoveAt(Month - 1);
            M.Insert(0, Opr.MonthOpred(Month));
            ViewBag.Month = M;
            List <string> Year = new List <string>();

            for (int i = DateTime.Now.Year; i >= 2018; i--)
            {
                Year.Add(i.ToString());
            }

            ViewBag.Year = Year;

            return(View());
        }
Beispiel #2
0
        public ActionResult Index()
        {//Поменять на ОБСД
            List <string>   IPUKI = new List <string>();
            List <string>   Head  = new List <string>();
            List <DateTime> dates = db.IPUs.Select(x => x.Date).Distinct().ToList();//даты загрузок без повторений

            foreach (DateTime D in dates)
            {
                Head.Add(Opr.MonthOpred(D.Month) + " " + D.Year.ToString());
                //доделать вывод по файлам
                IPUKI.Add(db.IPUs.Where(y => y.Date == D).Count().ToString());
            }



            ViewBag.Head  = Head;
            ViewBag.IPUKI = IPUKI;
            return(View());
        }
Beispiel #3
0
        public ActionResult Index()
        {
            List <List <string> > UEVKI = new List <List <string> >();
            List <string>         Head  = new List <string>();
            List <DateTime>       dates = db.UEVs.Select(x => x.Date).Distinct().ToList();//даты загрузок без повторений

            foreach (DateTime D in dates)
            {
                Head.Add(Opr.MonthOpred(D.Month) + " " + D.Year.ToString());
                //доделать вывод по файлам
                UEVKI.Add(db.UEVs.Where(y => y.Date == D).Include(s => s.Adres).Select(z => z.Adres.Adress + " Отопление Гкал.=" + z.OtEnergyGkal + " Вода Гкал.=" + z.HwEnergyGkal + " ВодаМ3=" + z.HwVodaM3).Distinct().ToList());
            }



            ViewBag.Head  = Head;
            ViewBag.UEVKI = UEVKI;
            return(View());
        }
        // GET: Arendators
        public ActionResult Index()
        {
            List <List <string> > ArendatorKI = new List <List <string> >();
            List <string>         Head        = new List <string>();

            List <DateTime> dates = db.Arendators.Select(x => x.Date).Distinct().ToList();//даты загрузок без повторений

            foreach (DateTime D in dates)
            {
                Head.Add(Opr.MonthOpred(D.Month) + " " + D.Year.ToString());
                for (int i = 0; i < db.Arendators.Where(y => y.Date == D).Count(); i++)
                {
                    ArendatorKI.Add(db.Arendators.Where(y => y.Date == D).Include(s => s.Adres).Select(z => z.Adres.Adress + z.Name + " S=" + z.Ploshad).Distinct().ToList());
                }
            }



            ViewBag.Head        = Head;
            ViewBag.ArendatorKI = ArendatorKI;
            return(View());
        }
Beispiel #5
0
        // GET: SVNs
        public ActionResult Index()
        {
            List <string>       SVNKI    = new List <string>();
            List <string>       Head     = new List <string>();
            List <TableService> Services = db.TableServices.ToList();
            List <DateTime>     dates    = db.SVNs.Select(x => x.Date).Distinct().ToList();//даты загрузок без повторений

            dates = dates.OrderByDescending(x => x.Date).ToList();
            foreach (DateTime D in dates)
            {
                Head.Add(Opr.MonthOpred(D.Month) + " " + D.Year.ToString());
                for (int i = 1; i < 4; i++)
                {
                    SVNKI.Add("Plan=" + db.SVNs.Where(y => y.Date == D).Where(h => h.Service.Id == i).Sum(x => x.Plan).ToString() + " Fact=" + db.SVNs.Where(y => y.Date == D).Where(h => h.Service.Id == i).Sum(x => x.Fact).ToString());
                }
            }



            ViewBag.Head  = Head;
            ViewBag.SVNKI = SVNKI;
            return(View());
        }
Beispiel #6
0
        public ActionResult IndexPoDomamPartial0()
        {
            List <string> GGEU = new List <string>();

            foreach (GEU G in db.GEUs)
            {
                GGEU.Add(G.Name);
            }
            ViewBag.GEU = GGEU;
            //создаем список годов
            ViewBag.Year = new string[DateTime.Now.Year - 2018 + 1];
            int counter = 0;

            for (int i = DateTime.Now.Year; i >= 2018; i--)
            {
                ViewBag.Year[counter] = i.ToString();
                counter++;
            }
            //формируем список домов в выборку ЖЭУ

            /*
             * List<SelectListItem> Ad = new List<SelectListItem>();
             *
             * foreach (Adres A in db.Adres)
             * {
             *  if (A.GEU != null && A.GEU.Equals(GGEU[0]))
             *  {
             *      SelectListItem AA = new SelectListItem();
             *      string ADR = A.Adress;
             *      int ind = 0;
             *      if (ADR.Contains("БОРОВАЯ ПАРТИЯ")|| ADR.Contains("МУСЫ ДЖАЛИЛЯ") || ADR.Contains("ГЕРОЕВ ТРУДА") || ADR.Contains("АКАДЕМИКА ТРОФИМУКА"))
             *      {
             *          ind = ADR.IndexOf(' ');
             *          string ADR2 = ADR.Remove(0, ind);
             *          ind = ADR2.IndexOf(' ');
             *      }
             *      else
             *      {
             *          ind = ADR.IndexOf(' ');
             *
             *      }
             *      string ADR3 = ADR.Remove(0, ind);
             *      int ind2 = ADR3.IndexOf(' ');
             *      ADR.Remove(ind2);
             *      ADR =ADR.Remove(ind)+","+ADR.Remove(0,ind+1);
             *      AA.Value = ADR;
             *      AA.Text = ADR;
             *      Ad.Add(AA);
             *  }
             * }
             *
             * SelectList SL = new SelectList(Ad, "Value", "Text");
             *
             */
            // ViewBag.Adres = SL;
            //Делаем список месяцев из них первый тот что в куки записан
            List <SelectListItem> Month = new List <SelectListItem>();

            for (int i = 1; i < 13; i++)
            {
                string mon = "";
                mon = Opr.MonthOpred(i);
                SelectListItem SLI = new SelectListItem();
                SLI.Text  = mon;
                SLI.Value = mon;//i.ToString();
                Month.Add(SLI);
            }
            SelectListItem M = new SelectListItem();

            //если в куки что-то есть
            if (HttpContext.Request.Cookies["Month"] != null)
            {
                M.Text           = HttpContext.Request.Cookies["Month"].Value;
                M.Value          = HttpContext.Request.Cookies["Month"].Value;//Opr.MonthObratno(M.Text).ToString();
                ViewBag.TekMonth = M.Value;
                //Month.RemoveAt(Opr.MonthObratno(M.Text) - 1);
                // Month.Insert(0, M);
            }

            M       = new SelectListItem();
            M.Text  = "Год";
            M.Value = "Год";
            Month.Add(M);
            ViewBag.Month = Month;



            ViewBag.Adres = AdresaForGeu(GGEU[0]);
            return(View());
        }