Esempio n. 1
0
        public Orders(Restaurant _resForm, Ofisant ofisant_name)
        {
            this.ofisant = ofisant_name;
            this.form    = _resForm;
            //logform = _form;
            InitializeComponent();
            product.AddRange(new Product[] {
                new Product
                {
                    name            = "Free",
                    count           = 2,
                    price           = 3,
                    ProductCategory = ProductCategory.Garnet,
                    Ofisant         = Ofisant.Lamia,
                },
                new Product
                {
                    name            = "Pizza",
                    count           = 1,
                    price           = 15,
                    ProductCategory = ProductCategory.MainFood,
                    Ofisant         = Ofisant.Lamia,
                },
                new Product
                {
                    name            = "Chikenburger",
                    count           = 1,
                    price           = 4,
                    ProductCategory = ProductCategory.MainFood,
                    Ofisant         = Ofisant.Zuleyxa,
                },
                new Product
                {
                    name            = "Napaleon",
                    count           = 2,
                    price           = 13,
                    ProductCategory = ProductCategory.Dessert,
                    Ofisant         = Ofisant.Zuleyxa,
                },
                new Product
                {
                    name            = "Juice fresh",
                    count           = 1,
                    price           = 7,
                    ProductCategory = ProductCategory.Drinks,
                    Ofisant         = Ofisant.Ofisant_3
                },
                new Product
                {
                    name            = "Water",
                    count           = 30,
                    price           = 1.30,
                    ProductCategory = ProductCategory.Drinks,
                    Ofisant         = Ofisant.Lamia,
                },
            });

            ShowingArray(product);
            AddListBox();
        }
Esempio n. 2
0
        private void btn_select_Click(object sender, EventArgs e)
        {
            MessageBox.Show(this.selectItem);
            Ofisant gorunmeli_olan = (Ofisant)Enum.Parse(typeof(Ofisant), this.selectItem);
            Orders  order          = new Orders(form, gorunmeli_olan);

            order.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            foreach (Person prs in person)
            {
                if (txt_email.Text == prs.Email)
                {
                    if ((txt_name.Text == prs.Name) && (txt_password.Text == prs.Password))
                    {
                        prs.Role = (Role)Enum.Parse(typeof(Role), cmb_role.SelectedItem.ToString());

                        if (prs.Role == Role.Ofisant)
                        {
                            Ofisant sendedOfisant = (Ofisant)Enum.Parse(typeof(Ofisant), prs.Name);
                            Orders  orders        = new Orders(form, sendedOfisant);
                            orders.Show();
                            this.Hide();
                        }
                        else if (prs.Role == Role.Menecer)
                        {
                            Menecer_name selectedMenecer = (Menecer_name)Enum.Parse(typeof(Menecer_name), prs.Name);
                            Menecer      menecer         = new Menecer(this.form, selectedMenecer);
                            menecer.Show();
                            this.Hide();
                        }
                        else if (prs.Role == Role.Admin)
                        {
                            Admin admin = new Admin(this.form);
                            admin.Show();
                            this.Hide();
                        }

                        MessageBox.Show("You are succesfull Logined");
                        break;
                    }
                    else
                    {
                        MessageBox.Show("Email or password invalid");
                        break;
                    }
                }
            }
        }