public void UpdateAdministrator(administrator admin)
 {
     using (database content = new database())
     {
         administrator a = content.administrator.FirstOrDefault(i => i.username == admin.username);
         a.password = admin.password;
         content.SaveChanges();
     }
 }
Exemplo n.º 2
0
        private void UpdateDatabase()
        {
            administrator ad = new administrator
            {
                username = adminUsername,
                password = txt_newPw.Text
            };

            db.UpdateAdministrator(ad);
        }
        public bool LoginValidation(String username, String password)
        {
            using (database content = new database())
            {
                administrator admin = content.administrator.Where(i => i.username == username && i.password == password).FirstOrDefault();

                if (admin == null)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
        }