public ListIngridientViewModel() : base()
        {
            listIngridientModel = ListIngridientModel.GetInstance();
            listIngridientModel.LoadAllIngridient();
            //listDetailImportation = ListDetailImportationModel.GetInstance();
            listDetailImportation = new ListDetailImportationModel();

            // command init
            IngridientSelectionChangeCommand = new DelegateCommand <IngridientModel>(SelectedIngridientChange);
            ShortcutKeysCommand        = new DelegateCommand <string>(HandleShortcutKeys);
            CreateImportationCommand   = new DelegateCommand(CreateImportation);
            CheckoutImportationCommand = new DelegateCommand(CheckoutImportation);
            PrintImportationCommand    = new DelegateCommand(PrintImportation);
            ClearImportationCommand    = new DelegateCommand(ClearImportation);
            CancelCommand = new DelegateCommand(Cancel);
            DetailSelectionChangeCommand = new DelegateCommand <DetailImportationItemViewModel>(SelectedDetailChange);
            RemoveItemCommand            = new DelegateCommand <DetailImportationItemViewModel>(RemoveDetailItem);


            // =============> !!!! [WARNING] DO NOT DELETE THIS CODE !!!! <==============
            SelectedIndex = 0;
            SelectedIndex = -1;
            NotifyChanged("SelectedIndex");
            // ==================================> <======================================
        }
Пример #2
0
        public DetailImportationViewModel() : base()
        {
            // list item in detail importation
            //listDetailImportation = ListDetailImportationModel.GetInstance();
            listDetailImportation            = new ListDetailImportationModel();
            IngridientSelectionChangeCommand = new DelegateCommand <IngridientModel>(SelectedIngridientChange);

            // =============> !!!! [WARNING] DO NOT DELETE THIS CODE !!!! <==============
            SelectedIndex = 0;
            SelectedIndex = -1;
            NotifyChanged("SelectedIndex");
            // ==================================> <======================================
        }
Пример #3
0
        public AddImportationViewModel() : base()
        {
            listExpenditureModel             = ListExpenditureModel.GetInstance();
            listDetailImportation            = new ListDetailImportationModel();
            IngridientSelectionChangeCommand = new DelegateCommand <IngridientModel>(IngridientChange);
            CreateImportationCommand         = new DelegateCommand(CreateImportation);
            ClearImportationCommand          = new DelegateCommand(ClearImportation);

            newImportation    = new ImportationModel();
            newImportation.ID = ImportationModel.GenerateID(ListImportationModel.GetInstance().List);

            SelectedIndex = 0;
            SelectedIndex = -1;
            NotifyChanged("SelectedIndex");
        }
        public ListIngridientViewModel(Action <object, object[]> navigate, object[] parameters) : this()
        {
            this.navigate = navigate;

            if (parameters == null)
            {
                newImportation    = new ImportationModel();
                newImportation.ID = ImportationModel.GenerateID(ListImportationModel.GetInstance().List);
            }
            else
            {
                index                 = (int)parameters[0];
                newImportation        = (ImportationModel)ListGeneralImportationModel.GetInstance().List[index].Importation;
                listDetailImportation = (ListDetailImportationModel)ListGeneralImportationModel.GetInstance().List[index].ListDetailImportation;
            }
        }
Пример #5
0
 public GeneralImportationModel(ImportationModel importation, ListDetailImportationModel list)
 {
     this.Importation           = importation;
     this.ListDetailImportation = list;
 }
Пример #6
0
 public GeneralImportationModel()
 {
     Importation           = new ImportationModel();
     ListDetailImportation = new ListDetailImportationModel();
 }