using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web.Script.Serialization;
|
|
using BWP.B3ClientService.BO;
|
|
using BWP.B3ClientService.Rpcs.RpcBO.Bill;
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery;
|
|
using Forks.EnterpriseServices.JsonRpc;
|
|
using Newtonsoft.Json;
|
|
using TSingSoft.WebPluginFramework;
|
|
|
|
namespace BWP.B3ClientService.Rpcs.BillRpc
|
|
{
|
|
[Rpc]
|
|
public static class ClientGoodsSetRpc
|
|
{
|
|
static JavaScriptSerializer serializer = new JavaScriptSerializer();
|
|
|
|
[Rpc]
|
|
public static string GetListByApplyClient(string applyClient)
|
|
{
|
|
var list = GetListDto().Where(x => x.ApplyClient == applyClient).ToList();
|
|
var json = serializer.Serialize(list);
|
|
return json;
|
|
}
|
|
|
|
static List<ClientGoodsSetDto> GetListDto()
|
|
{
|
|
var list = new List<ClientGoodsSetDto>();
|
|
var query = new DmoQuery(typeof(ClientGoodsSet));
|
|
var clist = query.EExecuteList().Cast<ClientGoodsSet>().ToList();
|
|
foreach (ClientGoodsSet set in clist)
|
|
{
|
|
foreach (ClientGoodsSet_Detail setDetail in set.Details)
|
|
{
|
|
var dto = new ClientGoodsSetDto();
|
|
dto.ApplyClient = set.ApplyClient;
|
|
dto.Name = set.Name;
|
|
dto.Goods_ID = setDetail.Goods_ID;
|
|
dto.Goods_Name = setDetail.Goods_Name;
|
|
dto.Goods_Code = setDetail.Goods_Code;
|
|
dto.Goods_Spec = setDetail.Goods_Spec;
|
|
list.Add(dto);
|
|
}
|
|
}
|
|
return list;
|
|
}
|
|
|
|
|
|
[Rpc]
|
|
public static string GetList()
|
|
{
|
|
var list = GetListDto();
|
|
var json = serializer.Serialize(list);
|
|
return json;
|
|
}
|
|
}
|
|
}
|