// GET: Staff
        public ActionResult Index()
        {
            int count = _context.StaffCategory.Count(x => x.CategoryName == "Nurse");

            if (count == 0)
            {
                Staff_Category Category = new Staff_Category();
                Category.Updated      = DateTime.Now;
                Category.UpdatedBy    = "Auto Generated";
                Category.CategoryName = "Nurse";
                _context.StaffCategory.Add(Category); _context.SaveChanges();
                Category.CategoryName = "Ward Boy";
                _context.StaffCategory.Add(Category); _context.SaveChanges();
                Category.CategoryName = "Accountant";
                _context.StaffCategory.Add(Category); _context.SaveChanges();
                Category.CategoryName = "Janitor";
                _context.StaffCategory.Add(Category); _context.SaveChanges();
                Category.CategoryName = "Admin";
                _context.StaffCategory.Add(Category); _context.SaveChanges();
                Category.CategoryName = "Guard";
                _context.StaffCategory.Add(Category); _context.SaveChanges();
            }
            List <Staff_Category> Categoryl = _context.StaffCategory.ToList();

            ViewBag.CategoryList = new SelectList(Categoryl, "CategoryName", "CategoryName");

            DateTime tt    = DateTime.Parse("11/11/2000");
            var      model = _context.Staffs.Where(x => x.RetireDate == tt).OrderByDescending(z => z.Name).ToList();

            return(View(model));
        }
        public ActionResult Delete(int id, Staff_Category collection)
        {
            try
            {
                // TODO: Add delete logic here
                Staff_Category model = _context.StaffCategory.Find(id);
                _context.StaffCategory.Remove(model); _context.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Create(Staff_Category collection)
        {
            try
            {
                // TODO: Add insert logic here
                collection.Updated   = DateTime.Now;
                collection.UpdatedBy = User.Identity.Name;

                _context.StaffCategory.Add(collection); _context.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Edit(int id, Staff_Category collection)
        {
            try
            {
                // TODO: Add update logic here
                collection.Updated   = DateTime.Now;
                collection.UpdatedBy = User.Identity.Name;

                _context.Entry(collection).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }