Ejemplo n.º 1
0
        public ImportationManagementViewModel() : base()
        {
            listGeneralImportationModel = ListGeneralImportationModel.GetInstance();
            listExpenditureModel        = ListExpenditureModel.GetInstance();
            listExpenditureModel.List.Clear();
            listExpenditureModel.LoadAllExpenditure();


            ////test
            //ListImportation.Add(new ImportationModel("1", DateTime.Now, 125000));
            //ListImportation.Add(new ImportationModel("2", DateTime.Now, 5000));
            //ListImportation.Add(new ImportationModel("3", DateTime.Now, 75000));
            //ListImportation.Add(new ImportationModel("4", DateTime.Now, 25000));
            //ListImportation.Add(new ImportationModel("4", DateTime.Now, 25000));
            //ListImportation.Add(new ImportationModel("4", DateTime.Now, 25000));
            //ListImportation.Add(new ImportationModel("4", DateTime.Now, 25000));
            //ListImportation.Add(new ImportationModel("4", DateTime.Now, 25000));
            //ListImportation.Add(new ImportationModel("4", DateTime.Now, 25000));
            //ListImportation.Add(new ImportationModel("4", DateTime.Now, 25000));

            //listGeneralImportationModel.Add(new GeneralImportationModel(new ImportationModel("1", DateTime.Now, 125000), new ListDetailImportationModel()));
            //listGeneralImportationModel.Add(new GeneralImportationModel(new ImportationModel("2", DateTime.Now, 12000), new ListDetailImportationModel()));
            //listGeneralImportationModel.Add(new GeneralImportationModel(new ImportationModel("3", DateTime.Now, 25000), new ListDetailImportationModel()));
            //listGeneralImportationModel.Add(new GeneralImportationModel(new ImportationModel("4", DateTime.Now, 15000), new ListDetailImportationModel()));
            //listGeneralImportationModel.Add(new GeneralImportationModel(new ImportationModel("5", DateTime.Now, 5000), new ListDetailImportationModel()));
            //listGeneralImportationModel.Add(new GeneralImportationModel(new ImportationModel("6", DateTime.Now, 15000), new ListDetailImportationModel()));
            //listGeneralImportationModel.Add(new GeneralImportationModel(new ImportationModel("7", DateTime.Now, 25000), new ListDetailImportationModel()));


            CreateImportationCommand = new DelegateCommand(CreateImportation);
            DetailCommand            = new DelegateCommand(ShowDetail);
            CheckoutCommand          = new DelegateCommand(ShowCheckoutDialog);
        }
Ejemplo n.º 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();
 }