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; } }
public FiscalTestForm() { fiscal = new services.Fiscal(new drivers.FiscalAbstractFabric()); InitializeComponent(); labelStatus.Text = fiscal.GetStatus().ToString(); }
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(); }