Exemplo n.º 1
0
        private void Initialize()
        {
            Audio   = new AudioCategory(this);
            Process = new ProcessCategory(this);
            Control = new ControlCategory(this);

            _jsonSerializer = new JsonSerializer();
            _jsonSerializer.Converters.Add(new UnixDateTimeConverter());
            _jsonSerializer.Converters.Add(new StringEnumConverter());
        }
        public ActionResult Create(ControlCategory category)
        {
            if (ModelState.IsValid)
            {
                _controlCategoryDao.Create(category);
                return(RedirectToAction("Index", "ControlCategory"));
            }

            ViewBag.categories = _controlCategoryDao.GetAll().ToList();
            return(View("Index"));
        }
Exemplo n.º 3
0
 public static Contracts.ControlCategory.ControlCategory ToContract(this ControlCategory dataItem)
 {
     return(new Contracts.ControlCategory.ControlCategory
     {
         ControlCategoryId = dataItem.ControlCategoryId,
         Name = dataItem.Name,
         Description = dataItem.Description,
         CreatedOn = dataItem.CreatedOn,
         UpdatedOn = dataItem.UpdatedOn,
     });
 }
        public ActionResult Edit(ControlCategory category)
        {
            if (ModelState.IsValid)
            {
                ControlCategory cat = _controlCategoryDao.GetById(category.Id);

                cat.Title       = category.Title;
                cat.Description = category.Description;

                _controlCategoryDao.Update(cat);
                return(RedirectToAction("Index", "ControlCategory"));
            }

            ViewBag.categories = _controlCategoryDao.GetAll().ToList();
            return(View("Index"));
        }
Exemplo n.º 5
0
        private void CreateControlCategoryMenuItem(ControlCategory category)
        {
            // The CategoryPage expects the Category-VM to be displayed as a navigation
            // parameter. If not provided, nothing will be displayed.
            var navParams = new NavigationParameters();

            navParams.Add(CategoryPageViewModel.CategoryParameterName, category);

            var item = new NavigationMenuItemInfo(
                category.Name,
                category.Icon,
                typeof(CategoryPage),
                navParams);

            MenuItems.Add(item);
        }
Exemplo n.º 6
0
 public ControlRenderingStyle(ControlCategory category, int controlType, ControlStateModifier modifiers)
 {
     fControlCategory = category;
     fControlType = controlType;
     fModifiers = modifiers;
 }
        public ActionResult Detail(int id)
        {
            ControlCategory environmentCategory = _controlCategoryDao.GetById(id);

            return(View(environmentCategory));
        }
Exemplo n.º 8
0
 public KeyboardControlViewModel()
 {
     _control = MidgeCore.Instance.Client.Control;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Adds the given control category to the page.
 /// </summary>
 public void Add(ControlCategory category) =>
 GetOrSetMemberFunc(category.ID, (int)ControlPageAccessors.AddCategory);
Exemplo n.º 10
0
 public static void ApplyUpdate(this ControlCategory dataItem, Contracts.ControlCategory.UpdateControlCategory update)
 {
     dataItem.Name        = update.Name;
     dataItem.Description = update.Description;
     dataItem.UpdatedOn   = DateTime.Now;
 }