Esempio n. 1
0
        public ActionResult Index()
        {
            var model = new HomePageModel();

            model.CanEdit   = CtsAuthorizeProvider.CanEditUser(User.Identity);
            model.CanDelete = CtsAuthorizeProvider.CanDeleteUser(User.Identity);
            model.Locations = EquipmentProvider.GetUserLocations(db, User.Identity);

            @ViewBag.Title = "Главная страница";
            return(View(model));
        }
        public ActionResult Index(int page = 1)
        {
            string userName       = User.Identity.Name ?? "";
            int    pagesize       = 20;
            var    locations      = EquipmentProvider.GetUserLocations(_cdb, User.Identity);
            var    locationsArray = locations.Select(x => x.ID).ToArray();
            var    analysis       = _cdb.MiningAnalyzes.Where(t => locationsArray.Contains(t.LocationID)).Where(v => v.IsValid).ToList();

            @ViewBag.Title = "Анализы по добыче";

            return(View(new MiningAnalysisView
            {
                Locations = locations,
                MiningAnalysis = analysis.OrderByDescending(t => t.AnalysisTimeStamp).ToPagedList(page, pagesize),
                CanEdit = CtsAuthorizeProvider.CanEditUser(User.Identity),
                CanDelete = CtsAuthorizeProvider.CanDeleteUser(User.Identity)
            }));
        }
        public ActionResult Index(int page = 1)
        {
            string userName = User.Identity.Name ?? "";
            int    pagesize = 20;

            var beltScales      = EquipmentProvider.GetUserAuthorizedEquipment <BeltScale>(_cdb, User.Identity);
            var beltScalesArray = beltScales.Select(x => x.ID).ToArray();
            var transfers       = _cdb.InternalTransfers.Where(t => beltScalesArray.Contains((int)t.EquipID))
                                  .Where(v => v.IsValid).Where(d => d.TransferTimeStamp >= DbFunctions.AddDays(System.DateTime.Now, -2));

            @ViewBag.Title = "Анализы для конвейерных весов";

            return(View(new BeltTransfersView
            {
                BeltTransfers = transfers.OrderByDescending(t => t.TransferTimeStamp).ToPagedList(page, pagesize),
                CanEdit = CtsAuthorizeProvider.CanEditUser(User.Identity),
                CanDelete = CtsAuthorizeProvider.CanDeleteUser(User.Identity)
            }));
        }
        public ActionResult Index(int page = 1)
        {
            string userName = User.Identity.Name ?? "";
            int    pagesize = 20;

            var wagonScales      = EquipmentProvider.GetUserAuthorizedEquipment <WagonScale>(_cdb, User.Identity);
            var wagonScalesArray = wagonScales.Select(x => x.ID).ToArray();
            var transfers        = _cdb.WagonTransfers.Where(t => wagonScalesArray.Contains((int)t.EquipID))
                                   .Where(d => d.TransferTimeStamp >= DbFunctions.AddDays(System.DateTime.Now, -2));

            @ViewBag.Title = "Данные вагонных весов";

            return(View(new WagonScales_Transfers
            {
                WagonScales = wagonScales,
                Transfers = transfers.OrderByDescending(t => t.TransferTimeStamp).ToPagedList(page, pagesize),
                CanEdit = CtsAuthorizeProvider.CanEditUser(User.Identity),
                CanDelete = CtsAuthorizeProvider.CanDeleteUser(User.Identity)
            }));
        }
        public ActionResult Index(int page = 1)
        {
            string userName = User.Identity.Name ?? "";
            int    pagesize = 20;

            var rockUtils      = EquipmentProvider.GetUserAuthorizedEquipment <RockUtil>(_cdb, User.Identity);
            var rockUtilsArray = rockUtils.Select(x => x.ID).ToArray();
            var transfers      = _cdb.RockUtilTransfers.Where(t => rockUtilsArray.Contains((int)t.EquipID))
                                 .Where(d => d.TransferTimeStamp >= DbFunctions.AddDays(System.DateTime.Now, -2));

            @ViewBag.Title = "Данные утилизации породы";

            return(View(new RockUtil_Transfer
            {
                RockUtils = rockUtils,
                RockUtilTranfers = transfers.OrderByDescending(t => t.TransferTimeStamp).ToPagedList(page, pagesize),
                CanEdit = CtsAuthorizeProvider.CanEditUser(User.Identity),
                CanDelete = CtsAuthorizeProvider.CanDeleteUser(User.Identity)
            }));
        }
        public ActionResult Index(int page = 1)
        {
            string userName = User.Identity.Name ?? "";
            int    pagesize = 20;

            var wagonScales      = EquipmentProvider.GetUserAuthorizedEquipment <WagonScale>(_cdb, User.Identity);
            var wagonScalesArray = wagonScales.Select(x => x.ID).ToArray();
            var transfers        = _cdb.WagonTransfers.Where(t => wagonScalesArray.Contains((int)t.EquipID))
                                   .Where(v => v.IsValid).Where(d => d.TransferTimeStamp >= DbFunctions.AddDays(System.DateTime.Now, -2));

            transfers.OrderByDescending(o => o.TransferTimeStamp);
            var groups = transfers.GroupBy(l => l.LotName).ToList();
            List <WagonBatch> batches = new List <WagonBatch>();

            foreach (var g in groups)
            {
                WagonBatch batch = new WagonBatch();
                float      netto = transfers.Where(b => b.LotName == g.Key.ToString()).Sum(s => s.Brutto) - transfers.Where(b => b.LotName == g.Key.ToString()).Sum(s => s.Tare);

                batch.LotName           = g.Key.ToString();
                batch.TransferTimeStamp = g.First().TransferTimeStamp;
                batch.WagonQuantity     = g.Count();
                batch.FromDest          = g.First().FromDest.LocationName;
                batch.ToDest            = g.First().ToDest;
                batch.Item            = g.First().Item.Name;
                batch.Netto           = netto;
                batch.WagonAnalysisID = g.First().AnalysisID;
                batch.WagonAnalysis   = g.First().Analysis;

                batches.Add(batch);
            }

            @ViewBag.Title = "Анализы для вагонных весов";

            return(View(new WagonBatchView
            {
                WagonBatches = batches.ToPagedList(page, pagesize),
                CanEdit = CtsAuthorizeProvider.CanEditUser(User.Identity),
                CanDelete = CtsAuthorizeProvider.CanDeleteUser(User.Identity)
            }));
        }
Esempio n. 7
0
        public ActionResult Index(int page = 1)
        {
            string userName = User.Identity.Name ?? "";
            int    pagesize = 20;

            var skips      = EquipmentProvider.GetUserAuthorizedEquipment <Skip>(_cdb, User.Identity);
            var skipsArray = skips.Select(x => x.ID).ToArray();
            var transfers  = _cdb.SkipTransfers.Where(t => skipsArray.Contains((int)t.EquipID))
                             .Where(d => d.TransferTimeStamp >= DbFunctions.AddDays(System.DateTime.Now, -2));

            @ViewBag.Title = "Данные скиповых подъемов";

            return(View(new SkipsAndTransfersModel
            {
                Skips = skips,
                SkipTransfers = transfers.OrderByDescending(t => t.TransferTimeStamp).ToPagedList(page, pagesize),
                Counters = new Dictionary <string, string>(),
                CanEdit = CtsAuthorizeProvider.CanEditUser(User.Identity),
                CanDelete = CtsAuthorizeProvider.CanDeleteUser(User.Identity)
            }));
        }