Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            usersType usersType = db.usersType.Find(id);

            db.usersType.Remove(usersType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "id,name")] usersType usersType)
        {
            if (ModelState.IsValid)
            {
                db.usersType.Add(usersType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(usersType));
        }
Esempio n. 4
0
        // 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));
        }
Esempio n. 5
0
        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);
        }