ERP:

1. Data Layer: (ProductInfoDBHelper.cs)

   /// <summary>
/// 获取门店图片信息
/// </summary>
public static DataTable GetImage(string DeptID)
{
string strSql = string.Empty; strSql += "select AD.ImageURL,A.Minute from officedba.AdvertisementDetail AD";
strSql +=",officedba.Advertisement as A"; strSql += " where ((AD.AdvertisementID like (select '%,' + convert(varchar(10),ID) + ',%' from officedba.Advertisement where DeptID = " + DeptID + "))";
strSql += " or (AD.AdvertisementID like (select '' + convert(varchar(10),ID) + ',%' from officedba.Advertisement where DeptID = " + DeptID + "))";
strSql += " or (AD.AdvertisementID like (select '%,' + convert(varchar(10),ID) + '' from officedba.Advertisement where DeptID = " + DeptID + "))";
strSql += " or (AD.AdvertisementID = (select convert(varchar(10),ID) from officedba.Advertisement where DeptID = " + DeptID + ")))";
strSql += " and A.DeptID=" + DeptID + "";
SqlCommand comm = new SqlCommand();
comm.CommandText = strSql; return SqlHelper.ExecuteSearch(comm);
}

2. Business Layer (ProductInfoBus.cs)

  /// <summary>
/// 获取门店图片信息
/// </summary>
public static DataTable GetImage(string DeptID)
{
return ProductInfoDBHelper.GetImage(DeptID);
}

3. App_Code\ProductInfoService.cs

     /// <summary>
/// 获取门店图片信息
/// </summary>
[WebMethod]
public string GetImage(string DeptID)
{
string str = "";
DataTable dt = ProductInfoBus.GetImage(DeptID);
dt.TableName = "LoginInfo";
if (dt != null && dt.Rows.Count>)
      {
str = XBase.Common.ConverToXML.ConvertDataTableToXML(dt); //把DataSet集合转换成XML文件
}
return str;
}

Winform:

1. Screen.cs

 DataTable dt = null;

         string aa = "";
//图片轮播方法
public void RunImage() //换图片的方法
{
string xml=ws.GetImage(Common.DeptID); if (!string.IsNullOrEmpty(xml))
{
dt = UserBus.ConvertXMLToDataSet(xml).Tables[]; //把XML文件转换成DataSet集合
} if (dt != null && dt.Rows.Count > )
{
while (true) //循环````
{
for (int i = ; i < dt.Rows.Count; i++)
{
pictureBox1.ImageLocation = dt.Rows[i]["ImageURL"].ToString();
// string ccc = dt.Rows[i]["Minute"].ToString();
Thread.Sleep(); //换一次图片让线程休息多少时间具体修改里面的参数例如一秒换一次填1000
}
}
}
else
{
pictureBox1.ImageLocation = "http://erp.ozz99.com.cn/SCImg/新浪微博登陆1.jpg";
}
}

Web References\ProductInfoWS\References.cs

    /// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetImage", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string GetImage(string DeptID) {
object[] results = this.Invoke("GetImage", new object[] {
DeptID});
return ((string)(results[]));
}

我的WebService入门的更多相关文章

  1. RESTful WebService入门(转)

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://lavasoft.blog.51cto.com/62575/229206 REST ...

  2. RESTful WebService入门

    RESTful WebService入门   RESTful WebService是比基于SOAP消息的WebService简单的多的一种轻量级Web服务,RESTful WebService是没有状 ...

  3. WebService入门实例教程

    什么是WebService 通过使用WebService,您的应用程序可以向全世界发布信息,或提供某项功能,它是基于Web的服务,通过Web进行发布.查找和使用. WebService脚本平台需支持X ...

  4. JAVAEE——BOS物流项目07:WebService入门、apache CXF入门、基于CXF发布CRM服务

    1 学习计划 1.WebService入门 n 什么是WebService n 调用网络上的WebService服务 n SOAP和WSDL概念 n 基于JDK1.7发布一个简单的WebService ...

  5. webservice入门简介

    为了梦想,努力奋斗! 追求卓越,成功就会在不经意间追上你 webservice入门简介 1.什么是webservice? webservice是一种跨编程语言和跨操作系统平台的远程调用技术. 所谓的远 ...

  6. RESTful WebService入门【转】

    ESTful WebService是比基于SOAP消息的WebService简单的多的一种轻量级Web服务,RESTful WebService是没有状态的,发布和调用都非常的轻松容易.   下面写一 ...

  7. WebService 入门

    1. 远程调用技术 2. WebService 概述 WebService 是使用 Http 发送 SOAP 协议数据的一种远程调用技术; WebService 需要开发客户端; WebService ...

  8. WebService入门案例

    关于WebService的作用和好处,大家应该都了解.但如何在Asp.Net中添加Web Service等问题一直是新手朋友的一大难题.鉴于网上没有一个像样的实际案例,特将课程设计中运用到的WebSe ...

  9. Apache CXF Webservice入门

    1.步骤一览 关于CXF的介绍请移步官网.百科,这里仅供初次使用者入门. 2.步骤详情 2.1.环境准备 apache-cxf-3.0.0.zip下载 jdk1.7.0_51 Eclipse4.3.0 ...

  10. .NET WebService 入门

    以 前写博客最主要的就是不知道写什么东西,现在感觉能写点东西,就是感觉博客随笔的标题挺难取的,最近工作中刚好用到了WebService,刚好可以写一 篇博客.去年工作的时候自己也用到过,只是知道调用一 ...

随机推荐

  1. dispay属性的block,inline,inline-block

    转自下面的几位大神: http://www.cnblogs.com/KeithWang/p/3139517.html 总体概念 block和inline这两个概念是简略的说法,完整确切的说应该是 bl ...

  2. margin:0 auto在IE中失效的解决方案

    转自:http://www.cnblogs.com/hongchenok/archive/2012/11/29/2795041.html 最近在开发项目的时候,发现在火狐浏览器中设置外容器margin ...

  3. 【转】JVM 堆内存设置原理

    堆内存设置 原理 JVM堆内存分为2块:Permanent Space 和 Heap Space. Permanent 即 持久代(Permanent Generation),主要存放的是Java类定 ...

  4. Hadoop MapReduce编程 API入门系列之薪水统计(三十一)

    不多说,直接上代码. 代码 package zhouls.bigdata.myMapReduce.SalaryCount; import java.io.IOException; import jav ...

  5. IOS App Integrate Google Map Problems and Method to solve them

    1. You must get a key in google developer center, and register it in below function in AppDelegate.m ...

  6. APP弱网测试

    APP弱网测试   App弱网测试方法,常用工具有使用fiddler进行网络模拟,也可以使用Network Emulator Toolkit控制模拟网络,相对来说Network Emulator To ...

  7. 8.9 CSS知识点2

    4.关系选择符 包含选择符(Descendant combinator) E F  选择所有被E元素包含的F元素 <style type="text/css"> h1 ...

  8. 使用Jquery解析xml的两种方法

    第一种方案(最稳妥): 先将String格式的xml转换为xml对象,然后再用Jquery解析xml对象 var returnDataXml = parseXML(returnData); var p ...

  9. HowTo Perform the spatial selection 'Share a line segment with' using ArcObjects

    HowTo  Perform the spatial selection 'Share a line segment with' using ArcObjects Article ID: 26528 ...

  10. VC++ CButton::SetCheck 的使用方法

    CButton::SetCheck void SetCheck(int nCheck); 参数 nCheck 指定检查状态. 此参数可以是下列值之一: 值                        ...