Пример #1
0
        public ListProductViewModel() : base()
        {
            listProductModel = ListProductModel.GetInstance();
            listProductModel.LoadAllProduct();
            //listDetailBill = ListDetailBillModel.GetInstance();
            listDetailBill = new ListDetailBillModel();

            // command init
            ProductSelectionChangeCommand = new DelegateCommand <ProductModel>(SelectedProductChange);
            ShortcutKeysCommand           = new DelegateCommand <string>(HandleShortcutKeys);
            CreateBillCommand             = new DelegateCommand(CreateBill);
            CheckoutBillCommand           = new DelegateCommand(CheckoutBill);
            PrintBillCommand             = new DelegateCommand(PrintBill);
            ClearBillCommand             = new DelegateCommand(ClearBill);
            CancelCommand                = new DelegateCommand(Cancel);
            DetailSelectionChangeCommand = new DelegateCommand <DetailBillItemViewModel>(SelectedDetailChange);
            RemoveItemCommand            = new DelegateCommand <DetailBillItemViewModel>(RemoveDetailItem);


            // =============> !!!! [WARNING] DO NOT DELETE THIS CODE !!!! <==============
            SelectedIndex = 0;
            SelectedIndex = -1;
            NotifyChanged("SelectedIndex");
            // ==================================> <======================================
        }
Пример #2
0
        public DetailBillViewModel() : base()
        {
            // list item in detail bill
            //listDetailBill = ListDetailBillModel.GetInstance();
            listDetailBill = new ListDetailBillModel();
            ProductSelectionChangeCommand = new DelegateCommand <ProductModel>(SelectedProductChange);

            // =============> !!!! [WARNING] DO NOT DELETE THIS CODE !!!! <==============
            SelectedIndex = 0;
            SelectedIndex = -1;
            NotifyChanged("SelectedIndex");
            // ==================================> <======================================
        }
Пример #3
0
        public ListProductViewModel(Action <object, object[]> navigate, object[] parameters) : this()
        {
            this.navigate = navigate;

            if (parameters == null)
            {
                newBill    = new BillModel();
                newBill.ID = BillModel.GenerateID(ListBillModel.GetInstance().List);
            }
            else
            {
                index          = (int)parameters[0];
                newBill        = (BillModel)ListGeneralBillModel.GetInstance().List[index].Bill;
                InputDeskNo    = newBill.DeskNo;
                listDetailBill = (ListDetailBillModel)ListGeneralBillModel.GetInstance().List[index].ListDetailBill;
            }
        }
Пример #4
0
 public GeneralBillModel(BillModel bill, ListDetailBillModel list)
 {
     this.Bill           = bill;
     this.ListDetailBill = list;
 }
Пример #5
0
 public GeneralBillModel()
 {
     Bill           = new BillModel();
     ListDetailBill = new ListDetailBillModel();
 }