You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
3.5 KiB
C#
78 lines
3.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Services;
|
|
using TradeModel;
|
|
using TradeData;
|
|
using NetLibrary.Data;
|
|
using System.Data;
|
|
using NetLibrary.ReportPrint;
|
|
using NetLibrary;
|
|
|
|
namespace TradeManageNew.gp
|
|
{
|
|
/// <summary>
|
|
/// gp_service 的摘要说明
|
|
/// </summary>
|
|
[WebService(Namespace = "http://tempuri.org/")]
|
|
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
|
|
[System.ComponentModel.ToolboxItem(false)]
|
|
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
|
|
[System.Web.Script.Services.ScriptService]
|
|
public class gp_service : System.Web.Services.WebService
|
|
{
|
|
|
|
[WebMethod]
|
|
public string HelloWorld()
|
|
{
|
|
return "Hello World";
|
|
}
|
|
|
|
#region 分页查询
|
|
[WebMethod(EnableSession = true)]
|
|
public JsonModel<List<GP_PriceMd>> GetListPrice(string code, string name, decimal? sprice, decimal? eprice,int tj, decimal? sprice2, decimal? eprice2, DateTime? StartDate, DateTime? StopDate, int off, int PageIndex, int PageSize, string Sort)
|
|
{
|
|
|
|
RefParameterCollection where = new RefParameterCollection();
|
|
if(off==1)
|
|
where.Add(new RefParameter("offdec", ">", 0, DbType.Decimal));
|
|
if (off == 2)
|
|
where.Add(new RefParameter("offdec", "=", 0, DbType.Decimal));
|
|
if (off == 3)
|
|
where.Add(new RefParameter("offdec", "<", 0, DbType.Decimal));
|
|
if (string.IsNullOrEmpty(code) == false) where.Add(new RefParameter("a.code", "like", code, DbType.String));
|
|
if (string.IsNullOrEmpty(name) == false) where.Add(new RefParameter("a.name", "like", name,DbType.String));
|
|
if (sprice != null) where.Add(new RefParameter("a.dec3", ">=", sprice, System.Data.DbType.Decimal));
|
|
if (eprice != null) where.Add(new RefParameter("a.dec3", "<=", eprice, System.Data.DbType.Decimal));
|
|
if (sprice2 != null)
|
|
{
|
|
if(tj==1)
|
|
where.Add(new RefParameter("offdec", ">=", sprice2, System.Data.DbType.Decimal));
|
|
if (tj == 2)
|
|
where.Add(new RefParameter("a.dec8", ">=", sprice2*100, System.Data.DbType.Decimal));
|
|
if (tj == 3)
|
|
where.Add(new RefParameter("a.dec9", ">=", sprice2*10000, System.Data.DbType.Decimal));
|
|
}
|
|
if (eprice2 != null)
|
|
{
|
|
if (tj == 1)
|
|
where.Add(new RefParameter("offdec", "<=", eprice2, System.Data.DbType.Decimal));
|
|
if (tj == 2)
|
|
where.Add(new RefParameter("a.dec8", "<=", eprice2 * 100, System.Data.DbType.Decimal));
|
|
if (tj == 3)
|
|
where.Add(new RefParameter("a.dec9", "<=", eprice2 * 10000, System.Data.DbType.Decimal));
|
|
}
|
|
if (StartDate != null) where.Add(new RefParameter("dataDate", ">=", StartDate, System.Data.DbType.DateTime));
|
|
if (StopDate != null) where.Add(new RefParameter("convert(varchar(10), dataDate, 120)", "<=", StopDate, System.Data.DbType.DateTime));
|
|
JsonModel<List<GP_PriceMd>> resultModel = new JsonModel<List<GP_PriceMd>>();
|
|
int RowCount = 0;
|
|
resultModel.DataSource = DataNew.GetListPrice(where, PageIndex, PageSize, Sort, out RowCount);
|
|
resultModel.RowCount = RowCount;
|
|
return resultModel;
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|