Beispiel #1
0
        /// <summary>
        /// 移除ApiUser
        /// </summary>
        /// <returns></returns>
        public string removeApiUser(removeApiUserObj removeApiUser)
        {
            string  aspnetUserId = getApiUserIdFromId(removeApiUser.id);
            account acc          = new account();
            bool    bresult      = acc.DeleteUserOnlyASPNET(aspnetUserId);

            if (bresult)
            {
                SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);
                SqlCommand    cmd  = new SqlCommand("DELETE sys_apiUser Where id=@id", conn);
                conn.Open();
                cmd.Parameters.AddWithValue("@id", removeApiUser.id);
                SqlDataReader dr = cmd.ExecuteReader();
                dr.Close(); dr.Dispose(); conn.Close(); conn.Dispose();
                return("ok");
            }
            else
            {
                return("error");
            }
        }