コード例 #1
0
        /// <summary>
        /// validate() is used to validate the text boxes
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pwd"></param>
        /// <param name="usn"></param>
        /// <param name="email"></param>
        /// <param name="phone"></param>
        /// <returns></returns>

        protected bool validate(String name, String pwd, String usn, String email, String phone)
        {
            bool error = false;

            if (name == string.Empty || pwd == string.Empty || usn == string.Empty || email == string.Empty || phone == string.Empty)
            {
                error = true;
            }

            //if (da.checkUnique(name, 1) == 1)
            //{
            //    Response.Write("<script>alert('Name is not unique.')</script>");
            //    error = true;
            //}

            if (da.checkUnique(email, 2) == 1)
            {
                Response.Write("<script>alert('Email already registered!')</script>");
                error = true;
            }
            if (error)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }