示例#1
0
 public ActionResult reg(sahana obj)
 {
     if (ModelState.IsValid)
     {
         Database1Entities db = new Database1Entities();
         db.sahanas.Add(obj);
         db.SaveChanges();
     }
     return(View());
 }
示例#2
0
 public ActionResult log(sahana obju)
 {
     if (ModelState.IsValid)
     {
         using (Database1Entities db = new Database1Entities())
         {
             var obj = db.sahanas.Where(model => model.email.Equals(obju.email) && model.password.Equals(obju.password)).FirstOrDefault();
             if (obj != null)
             {
                 Session["Id"]    = obj.Id.ToString();
                 Session["email"] = obj.email.ToString();
                 return(RedirectToAction("Exits"));
             }
         }
     }
     return(View(obju));
 }