Beispiel #1
0
        [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());
        }
Beispiel #2
0
        public ActionResult DeleteConfirmed(string id)
        {
            Loginnn loginnn = db.Loginuri.Find(id);

            db.Loginuri.Remove(loginnn);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
 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));
 }
Beispiel #4
0
        public ActionResult Create([Bind(Include = "ProductId,Parola")] Loginnn loginnn)
        {
            if (ModelState.IsValid)
            {
                db.Loginuri.Add(loginnn);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(loginnn));
        }
Beispiel #5
0
        // 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));
        }
Beispiel #6
0
        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());
        }
Beispiel #7
0
 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());
 }