示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            User user = db.Users.Find(id);

            db.Users.Remove(user);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "UserId,Login,Password,Email,EmailElInvoice,IsLegalEntity,Bin,Kbe,CertSeries,CertNumber,CertDateIssue,Status,CreateDate,UpdateDate,NameOrganization,User1CGuid,Surname,Name,Patronymic")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
示例#3
0
        // GET: Users/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            User user = db.Users.Find(id);

            if (user == null)
            {
                return(HttpNotFound());
            }
            return(View(user));
        }