//    [ValidateAntiForgeryToken]
 public ActionResult Login(Trainer_Details model)
 {
     if (ModelState.IsValid)
     {
         Database1Entities1 db = new Database1Entities1();
         var user = (from Mem_Tab in db.Mem_Tab
                     where Mem_Tab.Email == model.TEmail && Mem_Tab.PWD == model.TPWD
                     select new
         {
             model.TEmail,
             model.TName
         }).ToList();
         if (user.FirstOrDefault() != null)
         {
             Session["Email"] = user.FirstOrDefault().TEmail;
             Session["Name"]  = user.FirstOrDefault().TName;
             //return View("Create", "Resumes");
         }
         else
         {
             ModelState.AddModelError("", "Invalid login credentials.");
         }
     }
     return(RedirectToAction("Create", "Resumes"));
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Trainer_Details trainer_Details = db.Trainer_Details.Find(id);

            db.Trainer_Details.Remove(trainer_Details);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "TId,TName,TDOB,TDateofjoin,TSalary,TQualification,TSchedule,TEmail,TPWD")] Trainer_Details trainer_Details)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trainer_Details).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(trainer_Details));
 }
        // GET: Trainer_Details/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Trainer_Details trainer_Details = db.Trainer_Details.Find(id);

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