public ActionResult Edit(CategoryModel category)
        {
            if (ModelState.IsValid)
            {

                Category newCategory = db.Categories.Find(category.CategoryID);
                newCategory.ColourID = category.ColourID;
                newCategory.Name = category.Name;

                db.Entry(newCategory).State = EntityState.Modified;
                db.SaveChanges();

                return RedirectToAction("Index");
            }

            var colours = db.Colours.ToList();
            ViewBag.ColourID = new SelectList(colours, "ColourID", "ColourName", category.ColourID);

            return View();

        }
        public ActionResult AddCategory(CategoryModel Category)
        {
            if (ModelState.IsValid)
            {
                Guid UserID = new Guid(User.Identity.Name);
                Category newCategory = new Category();
                newCategory.CategoryID = Guid.NewGuid();
                newCategory.ColourID = Category.ColourID;
                newCategory.Name = Category.Name;
                newCategory.UserID = UserID;
                db.Categories.Add(newCategory);
                db.SaveChanges();


                return RedirectToAction("Index");
            }

            var colours = db.Colours.ToList();
            ViewBag.ColourID = new SelectList(colours, "ColourID", "ColourName");

            return View();

        }
        public ActionResult Edit(Guid? id)
        {

            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }

            Category category = db.Categories.Find(id);
            CategoryModel newCategory = new CategoryModel();
            newCategory.Name = category.Name;
            newCategory.CategoryID = category.CategoryID;

            var colours = db.Colours.ToList();
            ViewBag.ColourID = new SelectList(colours, "ColourID", "ColourName",category.ColourID);

            return View(newCategory);
        }