protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); LoadMenucategory(); if (_id > 0) { var MenuItem = new Service.BLL.BllMenuItem().GetById(_id); FormLoader.SetControlValue(ControlList, MenuItem); CmbCategory.SelectedValue = MenuItem.MenuCategoryId; } }
private void cmbMenuItem_SelectedIndexChanged(object sender, EventArgs e) { int id = 0; try { id = Convert.ToInt32(cmbMenuItem.SelectedValue.ToString()); } catch { id = new BllMenuItem().GetMinimumMenuItemId(); } finally { var MenuItem = new Service.BLL.BllMenuItem().GetById(id); txtPrice.Text = MenuItem.Price.ToString(); } }