Exemplo n.º 1
0
        public ActionResult MaintenanceByStatus()
        {
            var obj = new MaintenanceByStatusRepo();
            List <MaintenanceByStatusDto> model = obj.getMaintenanceByStatusCount();

            //MaintenanceByStatusDto model = obj.getMaintenanceByStatusCount();

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult AllMaintenanceByStatusList()
        {
            var statusLst = new MaintenanceByStatusRepo().getMaintenanceByStatusCount().Where(x => x.MaintStatusId == 1 || x.MaintStatusId == 2 || x.MaintStatusId == 3 || x.MaintStatusId == 7 || x.MaintStatusId == 5 || x.MaintStatusId == 6).ToList();

            statusLst.Insert(0, new MaintenanceByStatusDto()
            {
                Description = "-All-", MaintStatusId = 0
            });
            ViewBag.Organisations = new SelectList(statusLst, "MaintStatusId", "Description");
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult BindMaintenanceDetail(int id, int mainId, int statusId)
        {
            var obj       = new MaintenanceByIdRepo();
            var statusLst = new MaintenanceByStatusRepo().getMaintenanceByStatusCount();

            var schduledAndCompletedStatusId = new int[] { 3, 5 };
            AssetMaintenanceDetailDto model  = obj.getAssetMaintenanceDetailbyID(id, mainId);

            if (model.Category.ToLower() == "Maintenance".ToLower() || model.Category.ToLower() == "UNPLANNED MAINTENANCE".ToLower())
            {
                ViewBag.lstStatus = statusLst.Where(x => x.MaintStatusId == 3);
            }
            else if (statusId == 1 || statusId == 2 || statusId == 5)
            {
                ViewBag.lstStatus = statusLst.Where(x => schduledAndCompletedStatusId.Contains(x.MaintStatusId));
            }
            else if (statusId == 3)
            {
                ViewBag.lstStatus = statusLst.Where(x => x.MaintStatusId == 5);
            }
            else if (statusId == 7)
            {
                ViewBag.lstStatus = statusLst.Where(x => x.MaintStatusId == 6);
            }

            var filePaths = Directory.GetFiles(Server.MapPath("/Uploaded_File"))
                            .Where(f => Path.GetFileNameWithoutExtension(f).ToLower() == model.URI.ToString().ToLower()).Select(f => Path.GetFileName(f));

            if (TempData["CostPartDetails"] != null)
            {
                TempData.Remove("CostPartDetails");
            }

            TempData["CostPartDetails"] = model.lstParts;
            TempData.Keep("CostPartDetails");

            if (filePaths.Count() > 0)
            {
                model.FileName = "~/Uploaded_File/" + filePaths.FirstOrDefault();
            }
            return(View(model));
        }