public ActionResult DeleteConfirmed(int id) { m_Admin m_Admin = db.m_Admin.Find(id); db.m_Admin.Remove(m_Admin); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,loginid,password,name")] m_Admin m_Admin) { if (ModelState.IsValid) { db.Entry(m_Admin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(m_Admin)); }
public ActionResult Create([Bind(Include = "ID,loginid,password,name")] m_Admin m_Admin) { if (ModelState.IsValid) { db.m_Admin.Add(m_Admin); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(m_Admin)); }
// GET: m_Admin/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } m_Admin m_Admin = db.m_Admin.Find(id); if (m_Admin == null) { return(HttpNotFound()); } return(View(m_Admin)); }
static m_AdminController() { m_AdminContext db = new m_AdminContext(); if (db.m_Admin.Count() == 0) { var obj = new m_Admin(); obj.loginid = "*****@*****.**"; obj.password = Helper.AESHelper.Encrypt("admin"); obj.name = "Tsual Gwenix"; db.m_Admin.Add(obj); db.SaveChanges(); } }