Esempio n. 1
0
 public FormAuthorizarion()
 {
     InitializeComponent();
     ctx = new PizzaServiceDataEF.PizzaServiceEntities();
     labelRegister.AutoSize = false;
     labelRegister.Paint   += labelRegister_Paint;
 }
        public FormItemImage(int item)
        {
            InitializeComponent();
            ctx     = new PizzaServiceDataEF.PizzaServiceEntities();
            item_id = item;

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

            this.Text = queryItem.I_NAME;
            if (queryItem.I_IMAGE != null)
            {
                old_image_id = (int)queryItem.I_IMAGE;
            }
            else
            {
                MessageBox.Show("Помилка додавання зображення!", "Увага");
                return;
            }

            var query = (from im in ctx.IMAGES
                         where im.IMG_id == queryItem.I_IMAGE
                         select im.IMG_ImageData).First();

            System.IO.MemoryStream ms = new System.IO.MemoryStream(query);
            var img = System.Drawing.Image.FromStream(ms);

            pictureBox1.Image = img;
        }
Esempio n. 3
0
        public FormCart(List <int> orders)
        {
            InitializeComponent();

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

            var query = (from o in ctx.ORDER_LINES
                         where orderLines.Contains(o.OL_ID)
                         select o);

            try
            {
                foreach (var line in query)
                {
                    var item = ctx.ITEMS.Single(a => a.I_ID == line.OL_ITEM);
                    sum += (double)item.I_PRICE * line.OL_QUANTITY;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Сталася помилка!", "Помилка");
            }

            iTEMSBindingSource.DataSource      = ctx.ITEMS.ToList();
            oRDERLINESBindingSource.DataSource = query.ToList();
            dataGridViewCart.Refresh();
            labelPrice.Text = sum.ToString() + " грн.";
        }
        public FormHistoryLinesAdmin(int header)
        {
            InitializeComponent();
            ctx       = new PizzaServiceDataEF.PizzaServiceEntities();
            header_id = header;

            var query = (from line in ctx.ORDER_LINES
                         where line.OL_ORDER_HEADER == header_id
                         select line);

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

            iTEMSBindingSource.DataSource      = items.ToList();
            oRDERLINESBindingSource.DataSource = query.ToList();
        }
Esempio n. 5
0
        public FormActiveOrdersSelected(int header)
        {
            InitializeComponent();
            ctx        = new PizzaServiceDataEF.PizzaServiceEntities();
            header_id  = header;
            this.Text += " #" + header.ToString();

            var query = (from line in ctx.ORDER_LINES
                         where line.OL_ORDER_HEADER == header_id
                         select line);

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

            iTEMSBindingSource.DataSource      = items.ToList();
            oRDERLINESBindingSource.DataSource = query.ToList();
        }
        public FormHistoryOrders(int user)
        {
            InitializeComponent();
            ctx     = new PizzaServiceDataEF.PizzaServiceEntities();
            user_id = user;

            var customer = (from c in ctx.CUSTOMERS
                            where c.C_USERID == user_id
                            select c).First();

            customer_id = customer.C_ID;

            var query = (from h in ctx.HISTORY_HEADERS
                         where h.HH_CUSTOMER == customer_id
                         select h);

            hISTORYHEADERSBindingSource.DataSource = query.ToList();
        }
        public FormActiveOrders(int user_id)
        {
            InitializeComponent();
            ctx  = new PizzaServiceDataEF.PizzaServiceEntities();
            user = user_id;

            var customer = (from c in ctx.CUSTOMERS
                            where c.C_USERID == user
                            select c).First();

            customer_id = customer.C_ID;

            var query = (from header in ctx.ORDER_HEADERS
                         where header.OH_CUSTOMER == customer_id
                         select header);

            var restaurants = (from r in ctx.STORES
                               select r);

            sTORESBindingSource.DataSource       = restaurants.ToList();
            oRDERHEADERSBindingSource.DataSource = query.ToList();
        }
Esempio n. 8
0
        public FormReviews(int customer_id)
        {
            InitializeComponent();
            ctx      = new PizzaServiceDataEF.PizzaServiceEntities();
            customer = customer_id;

            var reviews = (from r in ctx.REVIEWS
                           select r);

            rEVIEWSBindingSource.DataSource = reviews.ToList();

            if (reviews.Count() != 0)
            {
                richTextBox1.Text = reviews.First().R_TEXT;
            }

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

            cUSTOMERSBindingSource.DataSource = customers.ToList();

            dataGridViewComments.ClearSelection();
        }
Esempio n. 9
0
 public AddImages()
 {
     InitializeComponent();
     ctx = new PizzaServiceDataEF.PizzaServiceEntities();
 }
Esempio n. 10
0
 public FormPizzaService()
 {
     InitializeComponent();
     ctx = new PizzaServiceDataEF.PizzaServiceEntities();
 }