public ActionResult Delete(int id, social handles)
 {
     try
     {
         using (var db = new SDES_DirectoryEntities())
         {
             var handle = db.socials.Find(id);
             db.Entry(handle).State = EntityState.Deleted;
             db.SaveChanges();
             return RedirectToAction("Details", "office", new { id = handle.officeId });
         }
     }
     catch
     {
         return View();
     }
 }
        public ActionResult Edit(int id, social handle)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    db.Entry(handle).State = EntityState.Modified;
                    db.SaveChanges();
                }

                return RedirectToAction("Details", "office", new { id = handle.officeId });
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Create(social handle)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    db.socials.Add(handle);
                    db.SaveChanges();
                }

                return RedirectToAction("Details", "office", new { id = handle.officeId });
            }
            catch
            {
                return View();
            }
        }
 public ActionResult Delete(int id, staff memberpost)
 {
     try
     {
         using (var db = new SDES_DirectoryEntities())
         {
             var member = db.staffs.Find(id);
             db.Entry(member).State = EntityState.Deleted;
             db.SaveChanges();
             return RedirectToAction("Details", "office", new { id = member.officeId });
         }
     }
     catch
     {
         return View();
     }
 }
        public ActionResult Create(int officeId, hour day)
        {
            try
            {
                using(var db = new SDES_DirectoryEntities())
                {
                    db.hours.Add(day);
                    db.SaveChanges();
                }

                return RedirectToAction("Details", "office", new { id = officeId });
            }
            catch
            {
                return View(day);
            }
        }
        public ActionResult Create(staff member)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    db.staffs.Add(member);
                    db.SaveChanges();
                }

                return RedirectToAction("Details", "office", new { id = member.officeId });
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Create(office office)
        {
            try
            {
                using(var db = new SDES_DirectoryEntities())
                {
                    db.offices.Add(office);
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
 public ActionResult Delete(int id, office office)
 {
     try
     {
         using (var db = new SDES_DirectoryEntities())
         {
             var office1 = db.offices.Find(id);
             db.Entry(office1).State = EntityState.Deleted;
             db.SaveChanges();
             return RedirectToAction("Index");
         }
     }
     catch
     {
         return View(office);
     }
 }
 public ActionResult Delete(int id, hour day)
 {
     try
     {
         using (var db = new SDES_DirectoryEntities())
         {
             var hours = db.hours.Find(id);
             db.Entry(hours).State = EntityState.Deleted;
             db.SaveChanges();
             return RedirectToAction("Details", "office", new { id = hours.officeId });
         }
     }
     catch
     {
         return View(day);
     }
 }
        public ActionResult Create(group addition)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    db.groups.Add(addition);
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult CreateFromOffice(website site)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    db.websites.Add(site);
                    db.SaveChanges();
                }

                return RedirectToAction("Details", "office", new { id = site.officeId });
            }
            catch
            {
                return View(site);
            }
        }
        public ActionResult Delete(int id, group deletion)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    var group = db.groups.Find(id);
                    db.Entry(group).State = EntityState.Deleted;
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Delete(int id, otherLocation location)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    var specific = db.otherLocations.Find(id);
                    db.Entry(specific).State = EntityState.Deleted;
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View(location);
            }
        }
        public ActionResult Create(otherLocation location)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    db.otherLocations.Add(location);
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                ViewBag.officeId = Init.PopulateOfficesDropDownList();
                return View(location);
            }
        }
        public ActionResult Edit(int id, otherLocation location)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    db.Entry(location).State = EntityState.Modified;
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View(location);
            }
        }
 public ActionResult Edit(int id, office office)
 {
     try
     {
         using (var db = new SDES_DirectoryEntities())
         {
             db.Entry(office).State = EntityState.Modified;
             db.SaveChanges();
             return RedirectToAction("Index");
         }
     }
     catch
     {
         return View();
     }
 }
        public ActionResult Delete(int id, website site)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    var website = db.websites.Find(id);
                    db.Entry(website).State = EntityState.Deleted;
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult DeleteFromOffice(int id, website website)
        {
            try
            {
                using (var db = new SDES_DirectoryEntities())
                {
                    var site = db.websites.Find(id);
                    db.Entry(site).State = EntityState.Deleted;
                    db.SaveChanges();
                    return RedirectToAction("Details", "office", new { id = site.officeId });
                }

            }
            catch
            {
                return View();
            }
        }