public MainWindowViewModel() { ComboOptions.Add("Red"); ComboOptions.Add("Blue"); ComboOptions.Add("Both"); var timer = new System.Timers.Timer(1000); timer.Elapsed += Timer_Elapsed; timer.Start(); }
public AtawComboOptionCreator() { fComboOptions = new ComboOptions(); BaseOptions = fComboOptions; }
private void AddChildProducts() { GridItemCollection collection = grdProducts.Items; int MainProductID = 0; bool validate = true; if (!string.IsNullOrEmpty(QueryStringParamID)) { MainProductID = int.Parse(QueryStringParamID); } else if (ViewStateID != null) { MainProductID = (int)ViewStateID; } ICollection <ProductsChildRelationship> comboItems = new List <ProductsChildRelationship>(); foreach (GridItem item in collection) { GridEditableItem editableItem = item as GridEditableItem; int id = (int)editableItem.GetDataKeyValue("ProductID"); CheckBox chk = item.FindControl("OptionCheckBox") as CheckBox; RadNumericTextBox quantity = item.FindControl("Quantity") as RadNumericTextBox; RadNumericTextBox unitPrice = item.FindControl("UnitPrice") as RadNumericTextBox; RadNumericTextBox FreeTopping = item.FindControl("FreeTopping") as RadNumericTextBox; CheckBox isCustomizable = item.FindControl("AllowCustomization") as CheckBox; if (chk.Checked) { if (!String.IsNullOrEmpty(quantity.Text) && !String.IsNullOrEmpty(unitPrice.Text)) { ProductsChildRelationship childProduct = new ProductsChildRelationship(); childProduct.ParentProductsId = MainProductID; childProduct.ChildProductId = id; childProduct.Quantity = Convert.ToInt16(quantity.Text); childProduct.UnitPrice = Convert.ToDouble(unitPrice.Text); childProduct.IsCustomizable = isCustomizable.Checked; if (!String.IsNullOrEmpty(FreeTopping.Text)) { childProduct.NumberOfFreeTopping = Convert.ToInt16(FreeTopping.Text); } comboItems.Add(childProduct); } else { validate = false; break; } } } if (validate) { if (comboItems.Count > 0) { int result = productManager.AddComboDealProducts(comboItems); ShowMessage("Combo items are saved successfully.", MessageType.Success); GetDealOptionsByProductId(MainProductID); GetOptionsForDeal(); ComboOptions.DataBind(); //GetAdonsForDeal(); //ComboAdons.DataBind(); RadTabStrip1.Tabs[2].Visible = true; RadTabStrip1.Tabs[2].Selected = true; RadMultiPage1.PageViews[2].Selected = true; } else { ShowMessage("You have selected no option for combo deal.", MessageType.Error); } } else { ShowMessage("Error! Missing values. Please fill out Quantity and Unit price when adding as combo deal.", MessageType.Error); } }
/// <summary> /// A single handler to operate the logic for when any Menu Item Button is clicked /// </summary> /// <param name="sender">button</param> /// <param name="e">mouse event</param> private void Button_Click(object sender, RoutedEventArgs e) { Button button = (Button)sender; string name = button.Name; switch (name) { case "uxCombo": screens.Remove(Screen.Combo); ComboOptions cmbo = new ComboOptions(this); screens.Add(Screen.Combo, cmbo); SwitchScreen(Screen.Combo); break; //entrees case "uxBB": screens.Remove(Screen.BBOptions); BBOptions bbop = new BBOptions(this); screens.Add(Screen.BBOptions, bbop); SwitchScreen(Screen.BBOptions); break; case "uxDD": screens.Remove(Screen.DDOptions); screens.Add(Screen.DDOptions, new DDOptions(this)); SwitchScreen(Screen.DDOptions); break; case "uxTT": screens.Remove(Screen.TTOptions); screens.Add(Screen.TTOptions, new TTBOptions(this)); SwitchScreen(Screen.TTOptions); break; case "uxTTB": screens.Remove(Screen.TTBOptions); screens.Add(Screen.TTBOptions, new TTBOptions(this)); SwitchScreen(Screen.TTBOptions); break; case "uxPP": screens.Remove(Screen.PPOptions); screens.Add(Screen.PPOptions, new PPOptions(this)); SwitchScreen(Screen.PPOptions); break; case "uxSS": screens.Remove(Screen.SSOptions); screens.Add(Screen.SSOptions, new SSOptions(this)); SwitchScreen(Screen.SSOptions); break; case "uxGORC": screens.Remove(Screen.GORCOptions); screens.Add(Screen.GORCOptions, new GORCOptions(this)); SwitchScreen(Screen.GORCOptions); break; //sides case "uxDWF": screens.Remove(Screen.DWFOptions); screens.Add(Screen.DWFOptions, new DWFOptions(this)); SwitchScreen(Screen.DWFOptions); break; case "uxFM": screens.Remove(Screen.FMOptions); screens.Add(Screen.FMOptions, new FMOptions(this)); SwitchScreen(Screen.FMOptions); break; case "uxMOG": screens.Remove(Screen.MOGOptions); screens.Add(Screen.MOGOptions, new MOGOptions(this)); SwitchScreen(Screen.MOGOptions); break; case "uxVS": screens.Remove(Screen.VSOptions); screens.Add(Screen.VSOptions, new VSOptions(this)); SwitchScreen(Screen.VSOptions); break; //drinks case "uxWW": screens.Remove(Screen.WWOptions); screens.Add(Screen.WWOptions, new WWOptions(this)); SwitchScreen(Screen.WWOptions); break; case "uxAAJ": screens.Remove(Screen.AAJOptions); screens.Add(Screen.AAJOptions, new AAJOptions(this)); SwitchScreen(Screen.AAJOptions); break; case "uxCC": screens.Remove(Screen.CCOptions); screens.Add(Screen.CCOptions, new CCOptions(this)); SwitchScreen(Screen.CCOptions); break; case "uxMM": screens.Remove(Screen.MMOptions); screens.Add(Screen.MMOptions, new MMOptions(this)); SwitchScreen(Screen.MMOptions); break; case "uxSSODA": screens.Remove(Screen.SSODAOptions); screens.Add(Screen.SSODAOptions, new SSODAOptions(this)); SwitchScreen(Screen.SSODAOptions); break; default: break; } }