Beispiel #1
0
        public OrdersForm(services.Fiscal setFiscal, string setCashierName = "Unknow")
        {
            fiscal      = setFiscal;
            cashierName = setCashierName;

            InitializeComponent();

            orders = new repositories.Order(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillOrders(orders);

            foreach (entities.Order order in orders.GetList())
            {
                ordersProvider.Add(order);
            }

            ordersListGridView.DataSource = ordersProvider;

            if (orders.GetList().Count() > 0)
            {
                orderElementsBox.Visible = true;

                entities.Order order = orders.GetList()[0];

                elementsProvider = new tools.OrderElementProvider();

                foreach (entities.OrderElement orderElement in order.GetElements())
                {
                    elementsProvider.Add(orderElement);
                }

                elementsListGridView.DataSource = elementsProvider;
            }
        }
Beispiel #2
0
        public void SetProductsList()
        {
            products   = new repositories.Product(db);
            categories = new repositories.Category(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillCategories(categories);
            dataMapper.FillProducts(products, categories);
        }
        public CashierChooseForm(CashierForm setCashierForm)
        {
            cashierForm = setCashierForm;

            cashiers = new repositories.Cashier(db);

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

            InitializeComponent();
        }
Beispiel #4
0
        public SettingsForm(CashierForm setCashierForm)
        {
            cashierForm = setCashierForm;

            cashboxes = new repositories.Cashbox(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillCashboxes(cashboxes);

            InitializeComponent();
        }
        public DiscountsBookForm()
        {
            InitializeComponent();

            discounts = new repositories.Discount(db);

            dataMapper = new services.DataMapper(db);
            dataMapper.FillDiscounts(discounts);

            foreach (entities.Discount discount in discounts.GetList())
            {
                discountsProvider.Add(discount);
            }

            discountsGridView.DataSource = discountsProvider;
        }
Beispiel #6
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();
        }
Beispiel #7
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();
        }