Пример #1
0
        private void View_Save(object sender, ActionRequestEventArgs args)
        {
            ModelValidator <BomConfigurationModel> validator =
                new BomConfigurationValidator(Model, MessageListener);

            View_Save(this, args, validator);
        }
Пример #2
0
 /// <summary>
 /// Fires user messages from action request event args
 /// Used by derived controllers
 /// </summary>
 /// <param name="args"></param>
 protected void RaiseActionMessage(ActionRequestEventArgs args)
 {
     if (args.UserMessage != null)
     {
         MessageRaised(this, new UserMessageEventArgs(args.UserMessage));
     }
 }
Пример #3
0
 public void NewBomMaster(object sender, ActionRequestEventArgs e)
 {
     PartModel.BomMaster = Scout.Core.Data.CreateEntity <BomMaster>(UnitOfWork);
     BomMaster           = PartModel.BomMaster;
     e.UserMessage       = new UserMessage("Bom Master created.",
                                           UserMessageType.Information);
 }
Пример #4
0
        /// <summary>
        /// Handles the create new bom master action
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Model_NewBomMaster(object sender, ActionRequestEventArgs e)
        {
            NewBomMasterValidator validator = new NewBomMasterValidator(Model,
                                                                        MessageListener);

            ActionService.RunAction(this, validator, Model.NewBomMaster);
        }
Пример #5
0
        private void DoConsumptionActions(ActionRequestEventArgs args)
        {
            // Deduct the consumption qtys
            Model.RemoveConsumedQtys();

            // Write the consumption transactions
            WriteTransactions(Model.ConsumptionRequests);
        }
Пример #6
0
        protected void View_Save(object sender, ActionRequestEventArgs e)
        {
            if (e.Cancel)
            {
                return;
            }

            m_actionService.RunAction(this, m_persistentController.Save);
        }
Пример #7
0
        /// <summary>
        /// Validates and runs the save action
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void View_Save(object sender, ActionRequestEventArgs e)
        {
            // Create validator for save action
            SaveBomMasterValidator validator = new SaveBomMasterValidator(
                Model, MessageListener);

            // Push validator down to base for execution.
            base.View_Save(sender, e, validator);
        }
Пример #8
0
 /// <summary>
 /// Executes Save on the <cref>PersistentController</cref>
 /// </summary>
 /// <typeparam name="TValidator"></typeparam>
 /// <typeparam name="TModel"></typeparam>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <param name="validator"></param>
 protected void View_Save <TModel>(object sender,
                                   ActionRequestEventArgs e,
                                   ModelValidator
                                   <TModel>
                                   validator)
 {
     m_actionService.RunAction(this, validator,
                               m_persistentController.Save);
 }
Пример #9
0
        private void PersistentController_OnSaved(object sender, ActionRequestEventArgs e)
        {
            if (m_persistenceSave != null)
            {
                m_persistenceSave(sender, e);
            }

            PersistentController_OnAction(sender, e);
        }
        private void View_Save(object sender, ActionRequestEventArgs e)
        {
            MapModelFromView();

            if (ModelFieldsAreValid())
            {
                MapPersistentObject();
                View.Close();
            }
        }
Пример #11
0
        protected override void View_Save(object sender, ActionRequestEventArgs args)
        {
            m_localModel.CompleteTask(StationTaskOutcome.Pass, "Task Completed.");

            base.View_Save(sender, args);

            // If there was an error performing the task then
            // undo the completion of the task.
            if (args.Cancel)
            {
                m_localModel.UndoCompleteTask("Task un-done : " +
                                              args.UserMessage);
            }
        }
Пример #12
0
 private void AddConfigurationToConsumptionRequests(ActionRequestEventArgs args)
 {
     try
     {
         foreach (var p in Model.PartsToConsume)
         {
             AddConsumptionRequest(p.Part, p.Qty);
         }
     }
     catch (NoNullAllowedException ex)
     {
         RaiseMessage(ex.Message, UserMessageType.Error);
         args.Cancel = true;
     }
 }
Пример #13
0
        protected virtual void View_Save(object sender, ActionRequestEventArgs args)
        {
            // Adds each configuration item to the consumption request list.
            AddConfigurationToConsumptionRequests(args);

            // Validate
            if (!CanSave())
            {
                args.Cancel = true;
                return;
            }

            DoConsumptionActions(args);

            // Persist
            base.View_Save(this, args);
        }
Пример #14
0
        /// <summary>
        /// Creates a inspection result
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void View_CreateInspectionResult(object sender,
                                                 ActionRequestEventArgs e)
        {
            StationInspectionTaskModel model =
                new StationInspectionTaskModel(Model.Process);

            IStationInspectionTaskView view = View.InspectionTaskView;

            StationInspectionTaskController controller =
                new StationInspectionTaskController(model, view);

            using (controller)
            {
                View.ShowInspectionTaskView();

                if (model.TaskResult != null &&
                    model.TaskResult.Outcome != StationTaskOutcome.NotPerformed)
                {
                    Model.InspectionResults.Add(model.TaskResult);
                }
            }
        }
Пример #15
0
 private void View_RefreshMaterials(object sender, ActionRequestEventArgs e)
 {
     Model.RefreshConsumableMaterials();
 }
Пример #16
0
 /// <summary>
 /// Executes Cancel on the <cref>PersistentController</cref>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void View_Cancel(object sender, ActionRequestEventArgs e)
 {
     m_actionService.RunAction(this, m_persistentController.Cancel);
 }
 private void View_Cancel(object sender, ActionRequestEventArgs e)
 {
     View.Close();
 }
Пример #18
0
 private void Model_NewBomConfiguration(object sender,
                                        ActionRequestEventArgs e)
 {
     View.ManageConfiguration(Model.NewBomConfiguration());
 }