예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RegistrationWindowViewModel"/> class.
        /// </summary>
        public RegistrationWindowViewModel()
        {
            this.RegistrateCommand = new RelayCommand(cmd => this.Registrate(), cmd => this.CanRegistrate());
            this.CancleCommand     = new RelayCommand(cmd => this.Cancle());

            this.frontServiceClient = FrontServiceDIContainer.Resolve <IFrontServiceClient>();
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SaleWindowViewModel"/> class.
 /// </summary>
 public SaleWindowViewModel()
 {
     this.frontServiceClient       = FrontServiceDIContainer.Resolve <IFrontServiceClient>();
     this.SaleCommand              = new RelayCommand(cmd => this.Sale(), cmd => this.CanSale());
     this.WarehouseGoodsCollection = this.frontServiceClient.GetAllWarehouseGoods().ToObservableCollection();
     this.SelectedIndex            = -1;
 }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoginWindowViewModel"/> class.
        /// </summary>
        public LoginWindowViewModel()
        {
            this.frontServiceClient = FrontServiceDIContainer.Resolve <IFrontServiceClient>();

            this.LoginCommand        = new RelayCommand(cmd => this.Login(), can => this.CanLogin());
            this.RegistrationCommand = new RelayCommand(cmd => this.Registration());
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FindByClassAndPeriodWindowViewModel"/> class.
        /// </summary>
        /// <param name="warehouseWindowViewModel">
        /// The warehouse window view model.
        /// </param>
        public FindByClassAndPeriodWindowViewModel(WarehouseWindowViewModel warehouseWindowViewModel)
        {
            this.warehouseWindowViewModel = warehouseWindowViewModel;
            this.frontServiceClient       = FrontServiceDIContainer.Resolve <IFrontServiceClient>();
            this.GoodsClassCollection     = this.frontServiceClient.GetAllGoodsClass().ToObservableCollection();
            this.FindCommand = new RelayCommand(cmd => this.Find());

            this.SelectedClassIndex = -1;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FindByProviderWindowViewModel"/> class.
        /// </summary>
        /// <param name="viewModel">
        /// The view Model.
        /// </param>
        public FindByProviderWindowViewModel(WarehouseWindowViewModel viewModel)
        {
            var frontServiceClient = FrontServiceDIContainer.Resolve <IFrontServiceClient>();

            this.ProviderCollection = frontServiceClient.GetAllProvider().ToObservableCollection();

            this.FindCommand = new RelayCommand(cmd => this.Find(), cmd => this.CanFind());

            this.SelectedProviderIndex = -1;

            this.viewModel = viewModel;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AddOrModifyProviderWindowViewModel"/> class.
        /// </summary>
        public AddOrModifyProviderWindowViewModel()
        {
            this.frontServiceClient = FrontServiceDIContainer.Resolve <IFrontServiceClient>();
            this.AddGoodsCommand    = new RelayCommand(cmd => this.AddGoods(), cmd => this.CanAddGoods());
            this.AddProviderCommand = new RelayCommand(cmd => this.AddProvider());
            this.ProviderIndeSelectedSelectedChangedCommand = new RelayCommand(cmd => this.ProviderIndeSelectedSelected());
            this.GoodsSelectedChangedCommand = new RelayCommand(cmd => this.GoodsSelectedChanged());
            this.UpdateCommand = new RelayCommand(cmd => this.Update(), cmd => this.CanUpdate());

            this.ProviderCollectionSelectedIndex = -1;
            this.GoodsCollectionSelectionIndex   = -1;

            this.ProviderCollection      = this.frontServiceClient.GetAllProvider().ToObservableCollection();
            this.GoodsClassCollection    = this.frontServiceClient.GetAllGoodsClass().ToObservableCollection();
            this.GoodsCategoryCollection = this.frontServiceClient.GetAllGoodsCategory().ToObservableCollection();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="WarehouseWindowViewModel"/> class.
        /// </summary>
        /// <param name="userId">
        /// The user Id.
        /// </param>
        public WarehouseWindowViewModel(int userId)
        {
            this.userId = userId;

            this.frontServiceClient = FrontServiceDIContainer.Resolve <IFrontServiceClient>();

            this.WarehouseGoodsCollection = this.frontServiceClient.GetAllWarehouseGoods().ToObservableCollection();

            this.WindowCloseCommand               = new RelayCommand(cmd => this.WindowClose());
            this.OnWarehouseCommand               = new RelayCommand(cmd => this.OnWarehouse());
            this.DeliverCommand                   = new RelayCommand(cmd => this.Deliver());
            this.SaleCommand                      = new RelayCommand(cmd => this.Sale());
            this.FindByProviderCommand            = new RelayCommand(cmd => this.FindByProvider());
            this.FindByClassAndPeriodCommand      = new RelayCommand(cmd => this.FindByClassAndPeriod());
            this.ReportByPeriodAndTypeCommand     = new RelayCommand(cmd => this.ReportByPeriodAndType());
            this.ReportSumFromSalesCommand        = new RelayCommand(cmd => this.ReportSumFromSales());
            this.ReportSalesRevenueCommand        = new RelayCommand(cmd => this.ReportSalesRevenue());
            this.ReportByCategoryAndPeriodCommand = new RelayCommand(cmd => this.ReportByCategoryAndPeriod());
        }
예제 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DeliverWindowViewModel"/> class.
        /// </summary>
        public DeliverWindowViewModel()
        {
            this.frontServiceClient = FrontServiceDIContainer.Resolve <IFrontServiceClient>();

            this.ProviderSelectionChangedCommand         = new RelayCommand(cmd => this.ProviderSelectionChanged());
            this.GoodsClassSelectionChangedCommand       = new RelayCommand(cmd => this.GoodsClassSelectionChanged());
            this.GoodsCategorySelectionChangedCommand    = new RelayCommand(cmd => this.GoodsCategorySelectionChanged());
            this.GoodsProviderGridSelectedChangedCommand = new RelayCommand(cmd => this.GoodsProviderGridSelectedChanged());
            this.AddGoodsToDeliveryCommand      = new RelayCommand(cmd => this.AddGoodsToDelivery(), cmd => this.CanAddGoodsToDelivery());
            this.DeleteGoodsFromDeviveryCommand = new RelayCommand(cmd => this.DeleteGoodsFromDevivery(), cmd => this.CanDeleteGoodsFromDevivery());
            this.DeliverCommand             = new RelayCommand(cmd => this.Deliver(), cmd => this.CanDeliver());
            this.NewDeliverCommand          = new RelayCommand(cmd => this.NewDeliver());
            this.AddOrModifyProviderCommand = new RelayCommand(cmd => this.AddOrModifyProvider());

            this.ProviderCollection      = this.frontServiceClient.GetAllProvider().ToObservableCollection();
            this.GoodsCategoryCollection = this.frontServiceClient.GetAllGoodsCategory().ToObservableCollection();
            this.GoodsClassCollection    = this.frontServiceClient.GetAllGoodsClass().ToObservableCollection();

            this.WarehouseGoodsGridSelectedIndex   = -1;
            this.ProviderListBoxSelectedIndex      = -1;
            this.GoodsClassListBoxSelectedIndex    = -1;
            this.GoodsCategoryListBoxSelectedIndex = -1;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportByPeriodAndTypeWindowViewModel"/> class.
 /// </summary>
 public ReportByPeriodAndTypeWindowViewModel()
 {
     this.frontServiceClient = FrontServiceDIContainer.Resolve <IFrontServiceClient>();
     this.ReportCommand      = new RelayCommand(cmd => this.Report());
 }