Example #1
0
 public UserVM(WebApplication2.Models.User u)
 {
     userID    = u.userID;
     firstName = u.firstName;
     lastName  = u.lastName;
     age       = u.age;
 }
Example #2
0
        public ActionResult Login(User f)
        {
            if (ModelState.IsValid)
            {
                string user = f.UserName;

                D.Open();
                bool check = D.DataSearch("SELECT * FROM Admtable WHERE Admin = '" + f.UserName + "' AND Password= '******' ");
                D.Close();
                if (check == true)
                {

                    FormsAuthentication.SetAuthCookie(f.UserName, false);

                   return RedirectToAction("Index", "Dashboard");

                }
            }
            return RedirectToAction("Index", "Home");
        }