public ActionCodeController(IActionView view, IList actionList)//
 {
     _view            = view;
     _actioncodesList = actionList;
     view.SetController(this);
     actionCodeService = new ActionCodeService();
 }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ActionView        actionView    = new ActionView();
            ActionCodeService actionService = new ActionCodeService();
            IList             actionList    = actionService.getAllActionCodes();
            //actionList.Add(new ActionCode("1","a"));
            //actionList.Add(new ActionCode("2", "b"));
            ActionCodeController controller = new ActionCodeController(actionView, actionList);

            controller.LoadView();
            actionView.ShowDialog();;
        }
        public void SelectedChanged(string actionKey)
        {
            foreach (ActionCode action in this._actioncodesList)
            {
                if (action.Actioncode.CompareTo(actionKey) == 0)
                {
                    _selectedObject = action;

                    // Refresh
                    ActionCodeService actionCodeService = new ActionCodeService();
                    _selectedObject = actionCodeService.getActionCode(_selectedObject.Actioncode);
                    // End Refresh

                    UpdateViewDetailValues(_selectedObject);
                    _view.SetSelectedInGrid(_selectedObject);
                    this._view.CanModifyID = false;
                    break;
                }
            }
        }