Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SocialNetWork socialNetWork = db.SocialNetWorks.Find(id);

            db.SocialNetWorks.Remove(socialNetWork);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        // GET: Admin/SocialNetWorks/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SocialNetWork socialNetWork = db.SocialNetWorks.Find(id);

            if (socialNetWork == null)
            {
                return(HttpNotFound());
            }
            return(View(socialNetWork));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Id,Name,Icon,Link,Order,NotShow")] SocialNetWork socialNetWork)
 {
     if (ModelState.IsValid)
     {
         socialNetWork.InsertUser      = "******";
         socialNetWork.InsertDate      = DateTime.Now;
         socialNetWork.UpdateUser      = "******";
         socialNetWork.UpdateDate      = DateTime.Now;
         socialNetWork.IsArchived      = false;
         socialNetWork.IsDeleted       = false;
         db.Entry(socialNetWork).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(socialNetWork));
 }