Ejemplo n.º 1
0
        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");
            // ==================================> <======================================
        }
Ejemplo n.º 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");
            // ==================================> <======================================
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
 public GeneralImportationModel(ImportationModel importation, ListDetailImportationModel list)
 {
     this.Importation           = importation;
     this.ListDetailImportation = list;
 }
Ejemplo n.º 6
0
 public GeneralImportationModel()
 {
     Importation           = new ImportationModel();
     ListDetailImportation = new ListDetailImportationModel();
 }