Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            profile profile = db.profiles.Find(id);

            db.profiles.Remove(profile);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "pId,uid,address,city,province,country,pic_url")] profile profile)
 {
     if (ModelState.IsValid)
     {
         db.Entry(profile).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.uid = new SelectList(db.users, "uId", "UName", profile.uid);
     return(View(profile));
 }
Пример #3
0
        // GET: profiles/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            profile profile = db.profiles.Find(id);

            if (profile == null)
            {
                return(HttpNotFound());
            }
            return(View(profile));
        }
Пример #4
0
        // GET: profiles/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            profile profile = db.profiles.Find(id);

            if (profile == null)
            {
                return(HttpNotFound());
            }
            ViewBag.uid = new SelectList(db.users, "uId", "UName", profile.uid);
            return(View(profile));
        }