Files
KJD/KJDService/KJD_WebService/BXXProductService.asmx.cs
T
2025-12-12 13:39:31 +08:00

353 lines
9.9 KiB
C#

using KJD_Web.BLL.BXX;
using KJD_Web.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
namespace KJD_Web
{
/// <summary>
/// ProductService 的摘要说明
/// </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 BXXProductService : System.Web.Services.WebService
{
private string GetRequestJsonString()
{
Context.Response.ContentType = "text/html;charset=utf-8";
Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
using (Stream s = HttpContext.Current.Request.InputStream) // 获得json 字符流
{
// 还原数据流
byte[] b = new byte[s.Length];
s.Read(b, 0, (int)s.Length);
string jsonText = Encoding.UTF8.GetString(b); // JSON字符串
if (string.IsNullOrEmpty(jsonText))
{
var qs = HttpContext.Current.Request.QueryString;
if (qs != null && qs.Keys.Count > 0)
{
jsonText = "{";
foreach (var key in qs.Keys)
{
jsonText += "\"" + key + "\":" + "\"" + qs[key.ToString()] + "\";";
}
jsonText = jsonText.TrimEnd(';') + "}";
}
}
return jsonText;
}
}
[WebMethod]
public void get_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_detail_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_list_random()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductListRandom(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sku_replace_img_list_random()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetSkuReplaceImgListRandom(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().DelDbProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
//[WebMethod]
//public void mdy_product()
//{
// string jsontext = GetRequestJsonString();
// var result = jsontext;
// //result = new BXXProductManage().MdyShop(jsontext);
// Context.Response.Write(result);
// Context.Response.End();
//}
[WebMethod]
public void mdy_product_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyProductNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_db_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyDBProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_groups()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductGroups(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_product_cates()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetProductCates(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_sku_img_replace()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddSkuImgReplace(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_prod_sku_img_replace_id()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyProdSkuImgReplaceId(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_sku_img_replace()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdySkuImgReplace(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sku_img_replace_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetSkuImgReplaceList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_sku_img_replace_detail_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetSkuImgReplaceList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
//AddSkuImg
[WebMethod]
public void add_sku_img()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddSkuImg(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void add_user_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().AddUserSelectProduct(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_user_select_product_status()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyUserSelectProductStatus(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetUserSelectProductList(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void admin_get_user_select_product_list()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().GetUserSelectProductList(jsontext, true);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void del_select_product()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().DelSelectProd(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void set_select_product_sub_sa()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().SetSelectProductSubSa(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
[WebMethod]
public void mdy_product_select_notes()
{
string jsontext = GetRequestJsonString();
var result = jsontext;
result = new BXXProductManage().MdyProductSelectNotes(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
}
}