Beispiel #1
0
        protected void Wizard1_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
        {
            if (e.CurrentStepIndex == (int)StepsEnum.Refine_Shipments &&
                e.NextStepIndex == (int)StepsEnum.Define_Criteria)
            {
                ////get all shipments that have been lock for routing  during this wizard and change their status back to Mapped
                ////therefore unlocking them
                //List<TDCShipment> shipmentsToRemove = null;
                //try
                //{
                //   shipmentsToRemove = RoutingController.GetShipmentsByRoutingHistoryId(RoutingHistoryId.Value, false);
                //}
                //catch (Exception ex)
                //{
                //    Console.WriteLine(ex);
                //}

                if (!RoutingController.RemoveItemsFromRouting(null, User.Identity.Name,
                                                              RoutingHistoryId.Value))
                {
                    DisplayMessage("There was a problem un-locking the Shipments.");
                    e.Cancel = true;
                }
            }
            else if (e.CurrentStepIndex == (int)StepsEnum.Merge_Delivery_Points &&
                     e.NextStepIndex == (int)StepsEnum.Refine_Shipments)
            {
                siteCodesToMerge.Clear();
                GridViewShipmentsToRefine.DataBind();
            }
        }
Beispiel #2
0
        private bool RemoveItemsFromRouting(List <TDCShipment> shipmentsToRemoveFromRouting)
        {
            bool success = false;

            try
            {
                success = RoutingController.RemoveItemsFromRouting(shipmentsToRemoveFromRouting, User.Identity.Name,
                                                                   RoutingHistoryId.Value);
            }
            catch (Exception e)
            {
                if (ExceptionPolicy.HandleException(e, "User Interface"))
                {
                    DisplayMessage("There was a problem removing the selected Shipments.");
                }
            }
            if (!success)
            {
                DisplayMessage("There was a problem removing the selected Shipments.");
            }
            else
            {
                ShipmentIdsToRemoveFromRouting.Clear();
            }
            return(success);
        }