Ejemplo n.º 1
0
        private PeriodsAndMinesReportModel GetPeriodsAndMinesReportModel()
        {
            var model = new PeriodsAndMinesReportModel();

            model.FromDate = DateTime.Today.AddDays(-7);
            model.ToDate   = DateTime.Today.AddDays(1);
            model.Periods  = GetPeriods();
            model.Mines    = _cdb.Locations.Where(l => l.LocationName.ToLower().StartsWith("ш"))
                             .Select(i => new SelectListItem()
            {
                Text  = i.LocationName,
                Value = i.ID
            });
            string lang = getUserLang(Request.Cookies["lang"]);

            if (lang == "en")
            {
                model.Mines.Select(m => m.Text = _cdb.Locations.Where(l => l.ID == m.Value).Select(s => s.LocationNameEng).FirstOrDefault());
            }
            else if (lang == "kk")
            {
                model.Mines.Select(m => m.Text = _cdb.Locations.Where(l => l.ID == m.Value).Select(s => s.LocationNameKZ).FirstOrDefault());
            }

            return(model);
        }
Ejemplo n.º 2
0
        private FileTableModel GetPeriodsAndMinesReportFiles(string author, string reportCode, PeriodsAndMinesReportModel model)
        {
            var selectedfiles = GetFilesByFilter(model.SelectedReportPeriod, author, null, reportCode, model.SelectedMines, model.FromDate, model.ToDate);
            var viewmodel     = new FileTableModel();

            viewmodel.FileList = BuildFileModel(selectedfiles, getUserLang(Request.Cookies["lang"]))?.ToList();
            return(viewmodel);
        }
Ejemplo n.º 3
0
 public ActionResult GetOverallMineProductionReports(PeriodsAndMinesReportModel model)
 {
     return(PartialView("_FileTable", GetPeriodsAndMinesReportFiles("1", "04", model)));
 }
Ejemplo n.º 4
0
 public ActionResult GetAlarmReports(PeriodsAndMinesReportModel model)
 {
     return(PartialView("_FileTable", GetPeriodsAndMinesReportFiles("1", "05", model)));
 }