public ActionResult AddMenuOption(MenuOptionViewModel menuOptionVM) { try { var menuOptionEntity = _menuOptionMapper.ToEntity(menuOptionVM); _menuOptionService.CreateMenu(menuOptionEntity); var menuOptionList = _menuOptionService.GetAllMenu(); return(Json(new { Status = 1, Data = menuOptionList })); } catch (Exception ex) { return(Json(new { Status = 0 })); } }
public ActionResult EditMenuOption(MenuOptionViewModel menuOptionVM) { try { var menuOptionEntity = _menuOptionMapper.ToEntity(menuOptionVM); bool isSuccess = _menuOptionService.EditMenu(menuOptionEntity); var menuOptionList = _menuOptionService.GetAllMenu(); return(Json(new { Status = (isSuccess) ? 1 : 0, Data = menuOptionList })); } catch (Exception ex) { return(Json(new { Status = 0 })); } }
public AutomationCommand(MenuOptionViewModel parent, IAutomationExtension automation) { this.parent = parent; this.automation = automation; menu = automation as IMenuCommand; status = automation as ICommandStatus ?? new NullQueryStatus(); parent.IsVisible = menu == null || menu.Visible; parent.IsEnabled = menu == null || menu.Enabled; var propertyChanged = automation as INotifyPropertyChanged; if (propertyChanged != null) { propertyChanged.PropertyChanged += OnMenuPropertyChanged; } }