예제 #1
0
        public CashierChooseForm(CashierForm setCashierForm)
        {
            cashierForm = setCashierForm;

            cashiers = new repositories.Cashier(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillCashiers(cashiers);

            InitializeComponent();
        }
예제 #2
0
        private void Cashier_Load(object sender, EventArgs e)
        {
            BarCodeFocus();

            clients   = new repositories.Client(db);
            cashiers  = new repositories.Cashier(db);
            orders    = new repositories.Order(db);
            cart      = new repositories.Cart();
            discounts = new repositories.Discount(db);

            dataExchanger = new services.DataExchanger(db);

            SetProductsList();
            dataMapper.FillDiscounts(discounts);
            dataMapper.FillClients(clients);
            dataMapper.FillCashiers(cashiers);

            if (Properties.Settings.Default.autoOpenTablet)
            {
                TabletForm tabletWindow = new TabletForm(this);
                tabletWindow.Show();
            }

            if (Properties.Settings.Default.fiscal)
            {
                fiscal = new services.Fiscal(new drivers.FiscalAbstractFabric(), cart);

                if (fiscal.Ready())
                {
                    ActivateFiscal();
                }
                else
                {
                    MessageBox.Show("Не удалось подключиться к ККТ. Попробуйте перезапустить программу.");
                    DeactivateFiscal();
                }

                if (Properties.Settings.Default.fiscalDriverType == 1)
                {
                    discountBox.Enabled = true;
                }

                RenderSession();
            }
            else
            {
                discountBox.Enabled = true;
                DeactivateFiscal();
            }

            cashierForm = new CashierChooseForm(this);
            cashierForm.Show();
        }
예제 #3
0
        private void CashiersBookForm_Load(object sender, EventArgs e)
        {
            cashiers = new repositories.Cashier(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillCashiers(cashiers);

            foreach (entities.Cashier cashier in cashiers.GetList())
            {
                cashiersProvider.Add(cashier);
            }


            if (cashiersProvider.Count > 0)
            {
                SelectFormCashier(cashiersProvider[0]);
            }

            cashiersGridView.DataSource = cashiersProvider;

            cashiersGridView.Update();
        }