Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MyAcuaintance myAcuaintance = db.MyAcuaintances.Find(id);

            db.MyAcuaintances.Remove(myAcuaintance);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Surname,Email,Phone,Description")] MyAcuaintance myAcuaintance)
 {
     if (ModelState.IsValid)
     {
         db.Entry(myAcuaintance).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(myAcuaintance));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Surname,Email,Phone,Description")] MyAcuaintance myAcuaintance)
        {
            if (ModelState.IsValid)
            {
                db.MyAcuaintances.Add(myAcuaintance);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(myAcuaintance));
        }
Beispiel #4
0
        //! GET: MyAcuaintances/Edit/5. return View of acuaintance edition;
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyAcuaintance myAcuaintance = db.MyAcuaintances.Find(id);

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