Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            if (Session["admin"] == null)
            {
                return(RedirectToAction("Index", "adminLogin"));
            }
            ExpertMaster expertMaster = db.ExpertMasters.Find(id);

            db.ExpertMasters.Remove(expertMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "ExpertId,ExpertName,ExpertPassword,ExpertEmailId,ExpertMobile,Occupation,Price")] ExpertMaster expertMaster)
 {
     if (Session["admin"] == null)
     {
         return(RedirectToAction("Index", "adminLogin"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(expertMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(expertMaster));
 }
Пример #3
0
        // GET: admin/ExpertMasters/Edit/5
        public ActionResult Edit(int?id)
        {
            if (Session["admin"] == null)
            {
                return(RedirectToAction("Index", "adminLogin"));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ExpertMaster expertMaster = db.ExpertMasters.Find(id);

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