Exemplo n.º 1
0
        public ActionResult InsertFirstResponderAnnotation(Event_Equipment_RootCauseModelView model, FormCollection collection)
        {
            using (MOMSEventFrameInterfaceEntities db = new MOMSEventFrameInterfaceEntities())
            {
                try
                {
                    var result = UpdateMasterDowntimeTable(model.eventModelView.uniqueID);

                    var annotation = new tbl_factMaintenanceAnnotations();
                    annotation.UniqueID = model.eventModelView.uniqueID;
                    annotation.FailureTypeDescription = model.rootCauseModelView.contType;
                    annotation.FailureDescription     = model.rootCauseModelView.contRootCause;
                    annotation.EquipmentType          = model.equipModelView.equipType;
                    annotation.EquipmentName          = model.equipModelView.equipName;
                    annotation.EquipmentNumber        = model.equipModelView.equipNumber;

                    annotation.ModifyStamp = DateTime.Now;

                    db.tbl_factMaintenanceAnnotations.Add(annotation);

                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return(RedirectToAction("Events"));
            }
        }
Exemplo n.º 2
0
        public ActionResult SetFirstResponderPartial(string EventID, string Site)
        {
            using (MOMSEventFrameInterfaceEntities db = new MOMSEventFrameInterfaceEntities())
            {
                //ViewBag.equipTypeList = new SelectList(GetEquipmentTypeList(Site), "elementID", "equipType");
                //ViewBag.contCategoryList = new SelectList(GetContributingDowntimeCategoryList(), "", "contCategory");

                var dtEvent = db.tbl_factFailureDowntimeCMMS.SingleOrDefault(x => x.UniqueID == EventID);

                Event_Equipment_RootCauseModelView parent = new Event_Equipment_RootCauseModelView
                {
                    eventModelView     = new EventModelView(),
                    equipModelView     = new EquipmentModelView(),
                    rootCauseModelView = new RootCauseModelView()
                };

                parent.equipModelView.equipTypeList        = new SelectList(GetEquipmentTypeList(Site), "", "equipType");
                parent.rootCauseModelView.contCategoryList = new SelectList(GetContributingDowntimeCategoryList(), "", "contCategory");

                parent.equipModelView.equipNumberList       = new SelectList("");
                parent.equipModelView.equipNameList         = new SelectList("");
                parent.rootCauseModelView.contTypeList      = new SelectList("");
                parent.rootCauseModelView.contRootCauseList = new SelectList("");

                parent.eventModelView.uniqueID        = dtEvent.UniqueID;
                parent.eventModelView.equipmentName   = dtEvent.EquipmentName;
                parent.eventModelView.equipmentNumber = dtEvent.EquipmentNumber;
                parent.eventModelView.startTime       = dtEvent.StartTime;
                parent.eventModelView.endTime         = dtEvent.EndTime;
                parent.eventModelView.duration        = dtEvent.Duration;
                parent.eventModelView.site            = dtEvent.Site;

                return(PartialView("EventAndRootCausePartialGrid", parent));
            }
        }
Exemplo n.º 3
0
        public ActionResult SetWorkOrderPartial(string EventID, string Site)
        {
            using (MOMSEventFrameInterfaceEntities db = new MOMSEventFrameInterfaceEntities())
            {
                Event_Equipment_RootCauseModelView parent = new Event_Equipment_RootCauseModelView();

                ViewBag.equipTypeList = new SelectList(GetEquipmentTypeList(Site), "equipNumber", "equipType");

                parent.eventModelView = new EventModelView();

                tbl_factFailureDowntimeCMMS dtEvent = db.tbl_factFailureDowntimeCMMS.SingleOrDefault(x => x.UniqueID == EventID);

                parent.eventModelView.uniqueID        = dtEvent.UniqueID;
                parent.eventModelView.equipmentName   = dtEvent.EquipmentName;
                parent.eventModelView.equipmentNumber = dtEvent.EquipmentNumber;
                parent.eventModelView.startTime       = dtEvent.StartTime;
                parent.eventModelView.endTime         = dtEvent.EndTime;
                parent.eventModelView.duration        = dtEvent.Duration;
                parent.eventModelView.site            = dtEvent.Site;

                return(PartialView("AnnotationWorkOrderPartial", parent));
            }
        }