Ejemplo n.º 1
0
        private void btnKitchenposSettingOK_Click(object sender, EventArgs e)
        {
            KitchenPOS kitchenPOS = KitchenPOS.getInstance();

            this.Hide();
            kitchenPOS.Show();
            kitchenPOS.BringToFront();
        }
Ejemplo n.º 2
0
 public static KitchenPOS getInstance()
 {
     if (uniqueInstance == null)
     {
         uniqueInstance = new KitchenPOS();
     }
     return(uniqueInstance);
 }
Ejemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //getting user inputs
            entered_userName = txtUserName.Text;
            entered_password = txtPassword.Text;

            //getting the loginId respective to the credentions
            using (DBEntities db = new DBEntities())
            {
                //getting matching username Object
                user = db.UserLogins.Where(x => x.username == entered_userName && x.password == entered_password).ToList();
                int count = user.Count;  //counting the noOf Rows

                //validating the Login
                if (count == 1)
                {
                    MessageBox.Show("Login Successs!!!");

                    //extracting the login ID of the user
                    logged_loginId = user.First().loginID.ToString();

                    //filtering ...
                    if (logged_loginId.StartsWith("M") || logged_loginId.StartsWith("m"))
                    {
                        MessageBox.Show("Welcome Manager !!!");
                        //redirecting to Addmin Panel
                        AdminPanelForm adminPanel = AdminPanelForm.getInstance();
                        adminPanel.Show();
                        this.Hide();
                    }
                    else if (logged_loginId.StartsWith("HF") || logged_loginId.StartsWith("hf"))
                    {
                        MessageBox.Show("Welcome head Chef !!!");
                        KitchenPOS kitchenpos = KitchenPOS.getInstance();
                        kitchenpos.Show();
                        this.Hide();
                    }
                    else if (logged_loginId.StartsWith("R") || logged_loginId.StartsWith("r"))
                    {
                        MessageBox.Show("Welcome Receiptionist");
                        RestaurantPOS restaurantpos = RestaurantPOS.getInstance();
                        restaurantpos.Show();
                        this.Hide();
                    }
                }
                else if (count == 0)
                {
                    MessageBox.Show("Invalid Credentials!!!");
                }
                else
                {
                    MessageBox.Show("Error !!!");
                }
            }
        }
Ejemplo n.º 4
0
        private void ItemCategoryButton_Click(object sender, EventArgs e)
        {
            String        foodCategoryBtnID = txtICBtnCategoryID.Text;
            KitchenPOS    kpos = KitchenPOS.getInstance();
            RestaurantPOS rpos = RestaurantPOS.getInstance();

            if (ItemButtonID.StartsWith("KIc"))
            {
                kpos.filterFoodCards(foodCategoryBtnID);
            }
            else if (ItemButtonID.StartsWith("RPc"))
            {
                rpos.filterFoodCards(foodCategoryBtnID);
            }
        }
Ejemplo n.º 5
0
        private void KitchenposThemeSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            KitchenPOS kitchenPOS = KitchenPOS.getInstance();

            if (KitchenposThemeSelector.Text == "Light")
            {
                ApplyThemes(Color.Black, Color.Black);
                kitchenPOS.changeBackImage(0);
            }
            else if (KitchenposThemeSelector.Text == "Dark")
            {
                ApplyThemes(zColor(228, 63, 90), zColor(228, 63, 90));
                kitchenPOS.changeBackImage(1);
            }
        }
Ejemplo n.º 6
0
        private void btnSave_ItemCategory_Click(object sender, EventArgs e)
        {
            if (validateFormDetails())
            {
                itemCategory.itemCategoryID = txtItemCategoryID.Text;
                itemCategory.categoryName   = txtItemCategoryName.Text;
                itemCategory.description    = txtItemCategoryDescription.Text;


                using (DBEntities db = new DBEntities())
                {
                    if (status == "insert")
                    {
                        db.ItemCategories.Add(itemCategory);

                        MessageBox.Show("Category Added Successfully");
                    }
                    else if (status == "update")
                    {
                        //updating the database
                        db.Entry(itemCategory).State = EntityState.Modified;

                        MessageBox.Show("Category Updated Successfully");
                    }

                    db.SaveChanges();
                    clearTexts();
                }

                //addding new Item to the Restaurant POS as a button
                KitchenPOS.getInstance().loadCategoryButtons();

                ///-------clear the flow layout and re load the category list
                ItemCategories itemcategories = ItemCategories.getInstance();
                itemcategories.clearCatgoryList();
                itemcategories.loadItemCatrgories();
                itemcategories.Show();
                this.Hide();
            } //end of if
        }     //end  of save S