Exemple #1
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);
        }
 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);
     }
 }