Exemple #1
0
        public ActionResult MassUnassign()
        {
            var model = new DispatcherBulkUpdateModel();

            model.WorkOrderIds = GetActionableWorkOrderIds();
            if (model.WorkOrderIds == null)
            {
                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Exemple #2
0
        public ActionResult MassAssign()
        {
            ////get the saved work order ids that we are working with
            var model = new DispatcherBulkUpdateModel();

            model.WorkOrderIds = GetActionableWorkOrderIds();
            if (model.WorkOrderIds == null)
            {
                return(RedirectToAction("Index"));
            }
            model.AvailableTechnicians = (new DispatcherWorkOrderFactory(CurrentCity)).GetMaintenanceGroupTechnicians(CurrentCity);
            return(View(model));
        }
Exemple #3
0
        public ActionResult MassUnassign(DispatcherBulkUpdateModel model)
        {
            //unassign all of the actionable items
            var factory = (new DispatcherWorkOrderFactory(CurrentCity));
            var woIds   = GetActionableWorkOrderIds();

            if (woIds != null)
            {
                foreach (var woId in woIds)
                {
                    int woID;
                    if (int.TryParse(woId, out woID))
                    {
                        factory.UnassignWorkOrder(woID);
                    }
                }
            }
            //now clear actionablework order ids
            ClearActionableWorkOrderIds();
            //send them back to the indexx page
            return(RedirectToAction("Index"));
        }