public ActionResult DeleteConfirmed(int id) { pharmacist pharmacist = db.pharmacists.Find(id); db.pharmacists.Remove(pharmacist); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "UserID,FirstName,LastName,EmailID,DateOfBirth,Password,IsEmailVertified,ActivationCode,Username")] pharmacist pharmacist) { if (ModelState.IsValid) { db.Entry(pharmacist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pharmacist)); }
// GET: deletepharmacists/Create //public ActionResult Create() //{ // return View(); //} //// POST: deletepharmacists/Create //// To protect from overposting attacks, please enable the specific properties you want to bind to, for //// more details see https://go.microsoft.com/fwlink/?LinkId=317598. //[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult Create([Bind(Include = "UserID,FirstName,LastName,EmailID,DateOfBirth,Password,IsEmailVertified,ActivationCode")] pharmacist pharmacist) //{ // if (ModelState.IsValid) // { // db.pharmacists.Add(pharmacist); // db.SaveChanges(); // return RedirectToAction("Index"); // } // return View(pharmacist); //} //// GET: deletepharmacists/Edit/5 //public ActionResult Edit(int? id) //{ // if (id == null) // { // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); // } // pharmacist pharmacist = db.pharmacists.Find(id); // if (pharmacist == null) // { // return HttpNotFound(); // } // return View(pharmacist); //} //// POST: deletepharmacists/Edit/5 //// To protect from overposting attacks, please enable the specific properties you want to bind to, for //// more details see https://go.microsoft.com/fwlink/?LinkId=317598. //[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult Edit([Bind(Include = "UserID,FirstName,LastName,EmailID,DateOfBirth,Password,IsEmailVertified,ActivationCode")] pharmacist pharmacist) //{ // if (ModelState.IsValid) // { // db.Entry(pharmacist).State = EntityState.Modified; // db.SaveChanges(); // return RedirectToAction("Index"); // } // return View(pharmacist); //} // GET: deletepharmacists/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } pharmacist pharmacist = db.pharmacists.Find(id); if (pharmacist == null) { return(HttpNotFound()); } return(View(pharmacist)); }
public ActionResult Index(pharmacist objchk) { if (ModelState.IsValid) { using (Pharmacy_DBEntities7 db = new Pharmacy_DBEntities7()) { var obj = db.pharmacists.Where(a => a.Username.Equals(objchk.Username) && a.Password.Equals(objchk.Password)).FirstOrDefault(); if (obj != null) { Session["UserID"] = obj.UserID.ToString(); Session["Password"] = obj.Password.ToString(); return(RedirectToAction("Index", "Home")); } else { ModelState.AddModelError("", "The ID or Password Incorrect"); } } } return(View(objchk)); }