public FormAddItem()
        {
            InitializeComponent();
            ctx = new PizzaServiceDataEF.PizzaServiceEntities();

            SetTabIndexes(this);
        }
        public FormAdministration()
        {
            InitializeComponent();
            ctx = new PizzaServiceDataEF.PizzaServiceEntities();

            var orderHeaders = (from header in ctx.ORDER_HEADERS
                                select header).OrderByDescending(x => x.OH_DATE);

            var historyHeaders = (from h in ctx.HISTORY_HEADERS
                                  select h).OrderByDescending(x => x.HH_DATE);

            var items = (from i in ctx.ITEMS
                         orderby i.I_CATEGORY, i.I_NAME
                         select i);

            var customers = (from c in ctx.CUSTOMERS
                             select c);

            var users = (from u in ctx.USERS
                         select u);

            var stores = (from s in ctx.STORES
                          select s);

            sTORESBindingSource.DataSource         = stores.ToList();
            uSERSBindingSource.DataSource          = users.ToList();
            iTEMSBindingSource.DataSource          = items.ToList();
            hISTORYHEADERSBindingSource.DataSource = historyHeaders.ToList();
            cUSTOMERSBindingSource.DataSource      = customers.ToList();
            oRDERHEADERSBindingSource.DataSource   = orderHeaders.ToList();
        }
Example #3
0
        public FormTransaction(double sum)
        {
            InitializeComponent();
            ctx = new PizzaServiceEntities();

            labelSum.Text = sum.ToString() + " грн.";
            SetTabIndexes(this);
        }
        public FormPizzaOrder(int user)
        {
            InitializeComponent();
            ctx        = new PizzaServiceDataEF.PizzaServiceEntities();
            orderLines = new List <int>();
            user_id    = user;

            InitializePizza();
        }
Example #5
0
        public FormMaps(int storeID, string address_)
        {
            InitializeComponent();
            store_id = storeID;
            ctx      = new PizzaServiceEntities();
            address  = address_;

            SetMapRoute();
        }
        public FormPizzaAdd(string pizzaName, List <int> orders)
        {
            InitializeComponent();
            pizza      = pizzaName;
            ctx        = new PizzaServiceDataEF.PizzaServiceEntities();
            this.Text  = pizza;
            orderLines = orders;

            var query = (from i in ctx.ITEMS
                         where (i.I_NAME == pizza)
                         select i);

            iTEMSBindingSource.DataSource = query.ToList();

            labelPrice.Text = dataGridViewSizes.Rows[0].Cells["iPRICEDataGridViewTextBoxColumn"].Value.ToString() + " грн.";
        }
Example #7
0
        public FormHistoryOrderSelected(int header, int user)
        {
            InitializeComponent();
            ctx            = new PizzaServiceDataEF.PizzaServiceEntities();
            history_header = header;
            user_id        = user;

            var query = (from line in ctx.HISTORY_LINES
                         where line.HL_ORDER_HEADER == history_header
                         select line);

            var items = (from i in ctx.ITEMS
                         select i);

            iTEMSBindingSource.DataSource        = items.ToList();
            hISTORYLINESBindingSource.DataSource = query.ToList();
        }
        public FormItemAdd(int id, List <int> orders)
        {
            InitializeComponent();

            orderLines = orders;
            item_id    = id;
            ctx        = new PizzaServiceDataEF.PizzaServiceEntities();

            var item = (from i in ctx.ITEMS
                        where i.I_ID == item_id
                        select i).First();

            name     = item.I_NAME;
            price    = (double)item.I_PRICE;
            sumPrice = price * quantity;

            this.Text       = name;
            labelPrice.Text = "Усього: " + sumPrice.ToString() + " грн.";
            labelName.Text  = name;
        }
Example #9
0
        public FormOrderHeader(List <int> orders, int user_id, double s)
        {
            InitializeComponent();
            ctx        = new PizzaServiceDataEF.PizzaServiceEntities();
            orderLines = orders;
            user       = user_id;
            sum        = s;

            o_header_id = 0;

            if (ctx.ORDER_HEADERS.Count() != 0)
            {
                var nonQuery = (from h in ctx.ORDER_HEADERS
                                select h.OH_ID).Max();
                o_header_id = nonQuery;
            }

            labelOrder.Text += (o_header_id + 1).ToString();

            iTEMSBindingSource.DataSource = ctx.ITEMS.ToList();

            SetTabIndexes(this);
        }
Example #10
0
 public FormMaps()
 {
     InitializeComponent();
     ctx = new PizzaServiceEntities();
     SetMap();
 }
 public FormReviewAdding(int customer)
 {
     InitializeComponent();
     ctx         = new PizzaServiceDataEF.PizzaServiceEntities();
     customer_id = customer;
 }