public ActionResult CreateProject(Project project)
        {
            var userHireRole = db.Users.All().FirstOrDefault(u => u.UserName == User.Identity.Name).Roles.FirstOrDefault(r => r.Role.Name == "Hire");
            if (userHireRole != null)
            {
                if (!ModelState.IsValid)
                {
                    ViewBag.Categories = db.Categories.All().ToList().Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() });
                    return PartialView("_CreateProjectForm", project);
                }

                project.Owner = db.Users.All().FirstOrDefault(u => u.UserName == User.Identity.Name);
                project.Category = db.Categories.All().FirstOrDefault(c => c.Id == project.Category.Id);
                project.CreatedOn = DateTime.Now;
                project.Deadline = DateTime.Now;
                db.Projects.Add(project);
                db.SaveChanges();
                return null;
            }
            else
            {
                ModelState.AddModelError("User role", "You are not hire");
                ViewBag.Categories = db.Categories.All().ToList().Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() });
                return PartialView("_CreateProjectForm", project);
            }
        }
        public ActionResult ViewProject(Project project)
        {
            if (ModelState.IsValid)
            {
                var oldProject = db.Projects.GetById(project.Id);
                oldProject.Name = project.Name;
                oldProject.Salary = project.Salary;
                oldProject.Summary = project.Summary;
                oldProject.Deadline = project.Deadline;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(project);
        }