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

            clients = new repositories.Client(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillClients(clients);

            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
        public ClientsBookForm()
        {
            InitializeComponent();

            clients = new repositories.Client(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillClients(clients);

            foreach (entities.Client client in clients.GetList())
            {
                clientsProvider.Add(client);
            }

            clientsGridView.DataSource = clientsProvider;

            clientsGridView.Update();
        }