示例#1
0
 public DataTable Authorize(string UserName, string Password)
 {
     try
     {
         if (UserName == "admin" && Password == "admin")
         {
             return(new System.Data.DataTable("admin"));
         }
         else
         {
             DBA = new UserBLL(UserName, Password);
             if (DBA.ValidateFromDB())
             {
                 return(DBA.GetUserFromDB());
             }
             else
             {
                 return(null);
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }