示例#1
0
 public SellTransactionViewModel(FilterViewModel filter, UserWrapper user, UserAuthenticationWrapper authenticationUser)
 {
     _authenticationUser = authenticationUser;
     _user         = user;
     _filter       = filter;
     Offers        = new BindableCollection <SellOfferWrapper>();
     SelectedOffer = new SellOfferWrapper(new sell_Offer());
     AcceptCommand = new AsyncRelayCommand(execute => Accept(), canExecute => { return(true); });
 }
 public ProductViewModel(FilterViewModel filter, UserWrapper user, DictionaryViewModel dic, UserAuthenticationWrapper authUser)
 {
     _dictionaryVM       = dic;
     _user               = user;
     _filter             = filter;
     _authenticationUser = authUser;
     Products            = new BindableCollection <ProductWrapper>();
     CreatedProduct      = ProductWrapper.CreateEmptyProduct(_user);
     GenerateXMLReport   = new AsyncRelayCommand(execute => GenerateXML(), canExecute => { return(true); });
     UpdateCommand       = new AsyncRelayCommand(execute => Update(), canExecute => { return(true); });
 }
示例#3
0
 public SellOfferViewModel(FilterViewModel filter, UserWrapper user, UserAuthenticationWrapper authenticationUser)
 {
     _authenticationUser = authenticationUser;
     _user         = user;
     _filter       = filter;
     _products     = new BindableCollection <ProductWrapper>();
     SellOffers    = new BindableCollection <SellOfferWrapper>();
     CreatedOffer  = SellOfferWrapper.CreateSellOffer(_user);
     UpdateCommand = new AsyncRelayCommand(execute => UpdateOffer(), canExecute => CanModifyOffer());
     DeleteCommand = new AsyncRelayCommand(execute => DeleteOffer(), canExecute => CanModifyOffer());
 }
        public BuyOfferViewModel(FilterViewModel filter, UserWrapper user, UserAuthenticationWrapper authenticationUser)
        {
            _authenticationUser = authenticationUser;
            _user        = user;
            BuyOffers    = new BindableCollection <BuyOfferWrapper>();
            CreatedOffer = BuyOfferWrapper.CreateEmptyBuyOffer(_user);

            _filter = filter;

            UpdateCommand = new AsyncRelayCommand(execute => UpdateOffer(), canExecute => CanModifyOffer());
            DeleteCommand = new AsyncRelayCommand(execute => DeleteOffer(), canExecute => CanModifyOffer());
        }
 public AuthenticationViewModel()
 {
     _user = new UserAuthenticationWrapper(new Model.users_Authetication()
     {
         Update_Date = DateTime.Now, Update_Who = 1
     });
     _user.User = new UserWrapper(new Model.users()
     {
         Update_Date = DateTime.Now, Update_Who = 1
     });
     _user.User.Address  = new AddressDto();
     RegisterCommand     = new AsyncRelayCommand(execute => Register(), canExecute => true);
     CancelCommand       = new AsyncRelayCommand(execute => Cancel(), canExecute => true);
     AuthenticateCommand = new AsyncRelayCommand(execute => Authenticate(), canExecute => CanAuthenticate());
     SubmitCommand       = new AsyncRelayCommand(execute => Submit(), canExecute => CanSubmit());
     LoginChoice         = Visibility.Visible;
     RegisterChoice      = Visibility.Collapsed;
 }
 public ManageAccountViewModel(UserAuthenticationWrapper authUser)
 {
     _authUser   = authUser;
     _realSecure = authUser.Password;
     Submit      = new AsyncRelayCommand(execute => SubmitCommand(), canExecute => { return(true); });
 }