private void btnKitchenposSettingOK_Click(object sender, EventArgs e) { KitchenPOS kitchenPOS = KitchenPOS.getInstance(); this.Hide(); kitchenPOS.Show(); kitchenPOS.BringToFront(); }
public static KitchenPOS getInstance() { if (uniqueInstance == null) { uniqueInstance = new KitchenPOS(); } return(uniqueInstance); }
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 !!!"); } } }
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); } }
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); } }
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