private void MenuButtonOnClick(object sender, EventArgs args) { Button button = (Button)sender; Model.Menu menu = (Model.Menu)button.Tag; mobileView.LoadView(new TakeOrderView(menu, table)); }
public DeleteMenuForm(Model.Menu menu, DesktopView parent) { this.menu = menu; this.parent = parent; InitializeComponent(); CenterToScreen(); }
public TakeOrderView(Model.Menu menu, Table table) { this.menu = menu; this.table = table; order = new Order(); InitializeComponent(); PopulateMenuItemTypes(); Size = new Size(398, 649); popupDialog.Dock = DockStyle.Fill; confirmationDialog.Dock = DockStyle.Fill; }
private Button GenerateMenuButton(Model.Menu menu) { Button button = new Button(); button.Dock = DockStyle.Fill; button.Text = menu.Name; button.BackColor = Color.White; button.Font = new Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0); button.Tag = menu; button.Click += MenuButtonOnClick; return(button); }
public async Task <IEnumerable <Model.Section> > GetSectionsAsync( Model.Menu menu, [ScopedService] ApplicationDbContext dbContext, SectionByIdDataLoader sectionById, CancellationToken cancellationToken) { Guid[] sectionIds = await dbContext.Sections .Where(s => s.MenuId == menu.Id) .OrderBy(s => s.DisplayOrder) .Select(s => s.Id) .ToArrayAsync(cancellationToken); return(await sectionById.LoadAsync(sectionIds, cancellationToken)); }
public ItemsOnMenuView(Model.Menu selectedMenu, DesktopView parent) { menu = selectedMenu; this.parent = parent; InitializeComponent(); PopulateItemLayout(); //set interval for timer and enable timer. refreshItemsOnMenu.Interval = 5000; refreshItemsOnMenu.Enabled = true; //start the timer refreshItemsOnMenu.Start(); }
private Control GenerateAmountLabel(Model.Menu menu) { Label lbl = new Label(); lbl.Text = menu.Items.Count.ToString(); lbl.Location = new Point(1500, nextLabelYAxis); lbl.ForeColor = Color.White; lbl.BackColor = Color.FromArgb(33, 33, 33); lbl.TextAlign = ContentAlignment.MiddleLeft; lbl.Font = new Font("Microsoft Sans Serif", 20); lbl.Padding = new Padding(0, 5, 0, 0); lbl.AutoSize = true; return(lbl); }
private Control GenerateNameLabel(Model.Menu menu) { Label lbl = new Label(); lbl.Text = menu.Name; lbl.Location = new Point(60, nextLabelYAxis); lbl.ForeColor = Color.White; lbl.BackColor = Color.FromArgb(33, 33, 33); lbl.TextAlign = ContentAlignment.MiddleLeft; lbl.Font = new Font("Microsoft Sans Serif", 25); lbl.Width = 1600; lbl.Height = 50; lbl.Click += (sender, e) => ShowItemsOnMenu(sender, e, menu); return(lbl); }
public AddMenuItemForm(Model.Menu menu) { this.menu = menu; InitializeComponent(); comboBoxBTW.SelectedIndex = 0; if (menu.Name == "Drankenkaart") { comboBoxType.Hide(); LblType.Hide(); type = "drink"; } else { type = "food"; } comboBoxType.SelectedIndex = 0; CenterToScreen(); }
private void ShowItemsOnMenu(object sender, EventArgs e, Model.Menu selectedMenu) { parent.LoadView(new ItemsOnMenuView(selectedMenu, parent)); }
public IList<Menu> GetAllMenus() { var list = new List<Menu>(); foreach (DataRow row in this["Menu"].Rows) { var item = new Menu { Id = (Guid)row["Id"], Name = (string)row["Name"], Description = row["Description"] == DBNull.Value ? null : row["Description"].ToString(), Etag = (byte[])row["Etag"], SortCode = (int)row["SortCode"], AppSystemId = (Guid)row["AppSystemId"], Icon = row["Icon"] == DBNull.Value ? null : row["Icon"].ToString(), Url = row["Url"] == DBNull.Value ? null : row["Url"].ToString(), ParentId = row["ParentId"] == DBNull.Value ? null : (Guid?)row["ParentId"] }; var entity = item as IEntityBase; entity.CreateBy = row["CreateBy"] == DBNull.Value ? null : row["CreateBy"].ToString(); entity.CreateOn = row["CreateOn"] == DBNull.Value ? null : (DateTime?)row["CreateOn"]; entity.CreateUserId = row["CreateUserId"] == DBNull.Value ? null : (Guid?)row["CreateUserId"]; entity.ModifiedBy = row["ModifiedBy"] == DBNull.Value ? null : row["ModifiedBy"].ToString(); entity.ModifiedOn = row["ModifiedOn"] == DBNull.Value ? null : (DateTime?)row["ModifiedOn"]; entity.ModifiedUserId = row["ModifiedUserId"] == DBNull.Value ? null : (Guid?)row["ModifiedUserId"]; list.Add(item); } return list; }
public ActionResult Save() { //Id=0&text=name&iconCls=tools_3&controller=controller&expanded=1&view=view&leaf=1&xtypes=xtypes&sort=1&stated=add Menu m = new Menu(); try { string stated = Request.Form["stated"]; if (stated == "add") m.parent = Convert.ToInt32(Request.Form["Id"]); else if (stated == "update") { m.parent = Convert.ToInt32(Request.Form["parent"]); m.Id = Convert.ToInt32(Request.Form["Id"]); } m.text = Request.Form["text"]; m.iconCls = Request.Form["iconCls"]; m.controller = Request.Form["controller"]; m.expanded = Convert.ToInt32(Request.Form["expanded"])==0?false:true; m.view = Request.Form["view"]; m.leaf = Convert.ToInt32(Request.Form["leaf"]) == 0 ? false : true; m.xtypes = Request.Form["xtypes"]; m.sort = Convert.ToInt32(Request.Form["sort"]); MenuBLL mbll = new MenuBLL(); if (stated == "add") { if (mbll.AddEntity(m)) { return Content("{'success':'ok'}"); } } else if (stated == "update") { if (mbll.ModifyEntity(m)){ return Content("{'success':'ok'}"); } } } catch { } return Content("{}"); }