Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Myemployee myemployee = db.Myemployees.Find(id);

            db.Myemployees.Remove(myemployee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Gender,City,Photo,AlternateText")] Myemployee myemployee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(myemployee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(myemployee));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Name,Gender,City,Photo,AlternateText")] Myemployee myemployee)
        {
            if (ModelState.IsValid)
            {
                db.Myemployees.Add(myemployee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(myemployee));
        }
Exemplo n.º 4
0
        // GET: Home/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Myemployee myemployee = db.Myemployees.Find(id);

            if (myemployee == null)
            {
                return(HttpNotFound());
            }
            return(View(myemployee));
        }
Exemplo n.º 5
0
        // GET: Home/Details/5
        public PartialViewResult Details(int?id)
        {
            if (id == null)
            {
                // return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Myemployee myemployee = db.Myemployees.Find(id);

            if (myemployee == null)
            {
                //  return HttpNotFound();
            }
            return(PartialView("~/Shared/_My", myemployee));
        }