示例#1
0
        public int ValidateAdmin(string AdminName, string AdminPassword)
        {
            try
            {
                dalComponent.SetParameters("@adminName", SqlDbType.VarChar, 50, AdminName);
                dalComponent.SetParameters("@adminPassword", SqlDbType.VarChar, 50, AdminPassword);
                dalComponent.SqlCommandText = "ValidateAdmin";
                object y = dalComponent.SelectRecordValue();
                if (int.Parse(y.ToString()) > 0)
                {
                    return(int.Parse(y.ToString()));
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(0);
        }