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"); // ==================================> <====================================== }
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"); // ==================================> <====================================== }
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; } }
public GeneralBillModel(BillModel bill, ListDetailBillModel list) { this.Bill = bill; this.ListDetailBill = list; }
public GeneralBillModel() { Bill = new BillModel(); ListDetailBill = new ListDetailBillModel(); }