コード例 #1
0
        private void SaveToDatabase()
        {
            // save importation
            ImportationModel.SaveToDatabase(newImportation);

            // save detail importation
            foreach (DetailImportationItemViewModel item in ListDetailImportation)
            {
                DetailImportationModel.SaveToDatabase(item.DetailImportationModel);
            }
        }
コード例 #2
0
 public void CreateImportation()
 {
     InitImportation();
     (new ConfirmDialog("XÁC NHẬN", "Thêm phiếu nhập hàng?", (Action) delegate
     {
         ImportationModel.SaveToDatabase(newImportation);
         foreach (DetailImportationItemViewModel item in ListDetailImportation)
         {
             DetailImportationModel.SaveToDatabase(item.DetailImportationModel);
         }
     })).ShowDialog();
     listExpenditureModel.List.Clear();
     listExpenditureModel.LoadAllExpenditure();
 }
コード例 #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");
        }
コード例 #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;
            }
        }
コード例 #5
0
 public GeneralImportationModel(ImportationModel importation, ListDetailImportationModel list)
 {
     this.Importation           = importation;
     this.ListDetailImportation = list;
 }
コード例 #6
0
 public GeneralImportationModel()
 {
     Importation           = new ImportationModel();
     ListDetailImportation = new ListDetailImportationModel();
 }