public void LoginTest()
        {
            l.Login login = new l.Login
            {
                Name     = "Lin",
                Password = 1234
            };

            Assert.Equal("Lin", login.Name);
            Assert.Equal(1234, login.Password);
        }
Exemple #2
0
        public ActionResult Index(GStoreApp.Library.Login login)
        {
            int pass = iRepo.Login(login);

            if (pass == 1)
            {
                return(View("Menu"));
            }
            else
            {
                return(View("Index"));
            }
        }
Exemple #3
0
 public int Login(l.Login login)
 {
     try
     {
         d.Login pass = dbcontext.Login.Where(p => p.Name == login.Name &&
                                              p.Password == login.Password).First();
     }
     catch (InvalidOperationException ex)
     {
         logger.Error("(Repo.Login)Invalid Name and/or Password");
         return(0);
     }
     return(1);
 }