Example #1
0
 private void InitRepos()
 {
     this.productsRepo      = new ProductsRepo();
     this.unitsRepo         = new UnitsRepo();
     this.categoriesRepo    = new CategoriesRepo();
     this.unitsContentsRepo = new UnitsContentsRepo();
 }
Example #2
0
        public void Start()
        {
            this.dgv_sales.DoubleBuffered(true);
            this.repo         = new SalesRepo();
            this.productsRepo = new ProductsRepo();

            this.lbl_work_day.Text  = this.date_picker_work_day.Value.ToString("ddd") + " " + this.date_picker_work_day.Value.ToString("yyyy/M/d");
            this.WorkDay            = this.date_picker_work_day.Value.ToString("yyyyMMdd");
            this.lbl_day_total.Text = "0";
            this.timer.Interval     = 10;
            this.timer.Tick        += this.TimerTick;
            this.timer.Start();

            this.date_picker_work_day.Value = DateTime.Now.Date;

            this.viewWorkDaySales();
            this.dgv_sales.CellValueChanged += this.dgv_sales_CellValueChanged;

            using (CategoriesRepo categoriesRepo = new CategoriesRepo())
            {
                this.combo_category_name.DataSource = categoriesRepo.GetCategories();
            }

            this.combo_category_name.SelectedValueChanged += this.combo_category_name_SelectedValueChanged;
            this.combo_category_name_SelectedValueChanged(this.combo_category_name, EventArgs.Empty);
            this.combo_product_name.SelectedValueChanged += this.combo_product_name_SelectedValueChanged;
            this.combo_product_name_SelectedValueChanged(this.combo_product_name, EventArgs.Empty);
        }
Example #3
0
        public OrderViewModel(CategoriesRepo categoriesRepo)
        {
            _categoriesRepo = categoriesRepo;
            OrderedProducts = new ObservableCollection <OrderedProductModel>();
            CategoriesList  = new ObservableCollection <Categories>();

            AddProductCommand  = new RelayCommand((parameter) => AddProductToOrder(parameter));
            IncreaseQtyCommand = new RelayCommand((parameter) => IncreaseQty(parameter));
            DecreaseQtyCommand = new RelayCommand((parameter) => DecreaseQty(parameter));

            LoadCategory();
        }
Example #4
0
 public void Start()
 {
     if (this.repo == null)
     {
         this.repo         = new PurchasesRepo();
         this.productsRepo = new ProductsRepo();
         this.dgv_purchases.DoubleBuffered(true);
         using (CategoriesRepo categoriesRepo = new CategoriesRepo())
         {
             this.combo_category_name.DataSource = categoriesRepo.GetCategories();
         }
         this.combo_category_name.SelectedIndexChanged += this.combo_category_name_SelectedIndexChanged;
         this.combo_category_name_SelectedIndexChanged(this.combo_category_name, EventArgs.Empty);
         this.combo_unit_name.SelectedIndexChanged += this.combo_unit_name_SelectedIndexChanged;
         this.combo_years.DataSource = this.repo.GetYears().ColumnToArray(0);
     }
 }
 public FormAllCategoryProducts()
 {
     this.InitializeComponent();
     this.productsRepo   = new ProductsRepo();
     this.categoriesRepo = new CategoriesRepo();
 }
Example #6
0
 public void LoadCategoriesList()
 {
     View.CategoriesListSource = CategoriesRepo.GetCategoriesList();
 }