[HttpPost] //aici imi vin valorile celor 2 textboxuri din pagina de login public ActionResult Logina(Loginnn home) { string product = home.ProductId; string pass = home.Parola; //sal return(View()); }
public ActionResult DeleteConfirmed(string id) { Loginnn loginnn = db.Loginuri.Find(id); db.Loginuri.Remove(loginnn); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ProductId,Parola")] Loginnn loginnn) { if (ModelState.IsValid) { db.Entry(loginnn).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(loginnn)); }
public ActionResult Create([Bind(Include = "ProductId,Parola")] Loginnn loginnn) { if (ModelState.IsValid) { db.Loginuri.Add(loginnn); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(loginnn)); }
// GET: Loginnns/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Loginnn loginnn = db.Loginuri.Find(id); if (loginnn == null) { return(HttpNotFound()); } return(View(loginnn)); }
public ActionResult Register(Loginnn account) { if (ModelState.IsValid) { using (BibliotecaContext db = new BibliotecaContext()) { db.Loginuri.Add(account); db.SaveChanges(); } ModelState.Clear(); // ViewBag.Message= account.ProductId + " " + } return(View()); }
public ActionResult Login(Loginnn account) { using (BibliotecaContext db = new BibliotecaContext()) { var usr = db.Loginuri.Single(u => u.ProductId == account.ProductId && u.Parola == u.Parola); if (usr != null) { Session["ProductId"] = usr.ProductId.ToString(); Session["Parola"] = usr.Parola.ToString(); return(RedirectToAction("LoggedIn")); } else { ModelState.AddModelError("", "Ceva e gresit"); } } return(View()); }