flex调用webservice中的自定义类

浏览:
字体:
发布时间:2013-12-09 23:23:33
来源:

public class ReturnResult    {        public int curIndex { get; set; }        public DataTable idxList { get; set; }    }    //测试数据库连接    [WebMethod(Description = "!!!测试数据库连接,链接字符串在web.config中")]    public bool conectDB()    {        strCon = ConfigurationSettings.AppSettings["sqlConDuke"];        conn = new SqlConnection(strCon);        try        {            conn.Open();            return true;        }        catch (Exception)        {            return false;        }        finally        {            conn.Close();        }    }
[WebMethod(Description = "根据 照片名 获得详细数据(DataTable),strTb,eg:PanView;strImgName,eg:20131019072740-0000150")]    public DataTable getInfoByImgName(string strTb, string strImgName)    {        bool ifCon = conectDB();        if (ifCon)        {            string sql_BfCar = "SELECT * FROM dbo." + strTb + " where ImageName LIKE '%" + strImgName + "%'";            da = new SqlDataAdapter(sql_BfCar, conn);            myds = new DataSet();            da.Fill(myds);            return myds.Tables[0];        }        else        {            return null;        }    }    [WebMethod(Description = "根据 照片名 获得所在Link的所有数据(ReturnResult),strTb,eg:PanView;strImgName,eg:20131019072740-0000150")]    public ReturnResult getLinkDTByImgName(string strTb, string strImgName)    {        ReturnResult returnResult = new ReturnResult();        bool ifCon = conectDB();        if (ifCon)        {            returnResult.curIndex = Convert.ToInt32(getInfoByImgName(strTb, strImgName).Rows[0][0]);            string strLinkGuid = getInfoByImgName(strTb, strImgName).Rows[0][1].ToString();            string sql_BfCar = "SELECT * FROM dbo." + strTb + " where LinkGuid LIKE '%" + strLinkGuid + "%'";            da = new SqlDataAdapter(sql_BfCar, conn);            myds = new DataSet();            da.Fill(myds);            returnResult.idxList = myds.Tables[0];            return returnResult;        }        else        {            return null;        }    }
Flex代码:

															








>更多相关文章
24小时热门资讯
24小时回复排行
资讯 | QQ | 安全 | 编程 | 数据库 | 系统 | 网络 | 考试 | 站长 | 关于东联 | 安全雇佣 | 搞笑视频大全 | 微信学院 | 视频课程 |
关于我们 | 联系我们 | 广告服务 | 免责申明 | 作品发布 | 网站地图 | 官方微博 | 技术培训
Copyright © 2007 - 2024 Vm888.Com. All Rights Reserved
粤公网安备 44060402001498号 粤ICP备19097316号 请遵循相关法律法规
');})();