public ActionResult DeleteConfirmed(int id) { usersType usersType = db.usersType.Find(id); db.usersType.Remove(usersType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name")] usersType usersType) { if (ModelState.IsValid) { db.Entry(usersType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(usersType)); }
public ActionResult Create([Bind(Include = "id,name")] usersType usersType) { if (ModelState.IsValid) { db.usersType.Add(usersType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(usersType)); }
// GET: Cingo/UsersTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } usersType usersType = db.usersType.Find(id); if (usersType == null) { return(HttpNotFound()); } return(View(usersType)); }
public List <usersType> p_usesType_select() { SqlDataReader reader = DBHelper.SectionRoomSelect("p_usesType_select"); List <usersType> type = new List <usersType>(); while (reader.Read()) { usersType cd = new usersType(); cd.Type = (reader[1] + ""); cd.Peodom = reader[2] + ""; type.Add(cd); } DBHelper.con.Close(); DBHelper.con.Dispose(); DBHelper.cmd.Dispose(); return(type); }