public ActionResult First_Tab_Create(first_type tab) { try { if (!string.IsNullOrEmpty(tab.tab_type)) { first_type item = db.first_type.Find(tab.tab_type); if (item != null) { return(new HttpStatusCodeResult(205, "ResetContent")); } db.first_type.Add(tab); db.SaveChanges(); return(new HttpStatusCodeResult(200, "Add First Tab Success")); } else { return(new HttpStatusCodeResult(204, "No Content")); } } catch (Exception err) { return(new HttpStatusCodeResult(400, err.Message)); } }
// GET: Tab/First_Tab_Delete public ActionResult First_Tab_Delete(string tab) { try { first_type item = db.first_type.Find(tab); if (!string.IsNullOrEmpty(item.tab_type)) { db.first_type.Attach(item); db.first_type.Remove(item); db.SaveChanges(); return(new HttpStatusCodeResult(200, "Delete Tab Success")); } else { return(new HttpStatusCodeResult(204, "No Content")); } } catch (Exception err) { return(new HttpStatusCodeResult(400, err.Message)); } }