| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- using System.Linq;
- using Muchinfo.MTPClient.Adapter.Abstract;
- using Muchinfo.MTPClient.Data;
- using Muchinfo.MTPClient.Data.Model.Account;
- using Muchinfo.MTPClient.Data.Model.Sale;
- using Muchinfo.MTPClient.Infrastructure.LinkProxy;
- using Muchinfo.MTPClient.Infrastructure.Utilities;
- using Muchinfo.MTPClient.IService;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using Muchinfo.MTPClient.NetworkCore;
- using Muchinfo.MTPClient.Service.Utilities;
- using Muchinfo.MTPClient.Resources;
- namespace Muchinfo.MTPClient.Service
- {
- public class SaleService : ISaleService
- {
- private SaleAdapter _saleAdapter;
- public SaleService()
- {
- _saleAdapter = LinkManager.Instance.TradeAdapterFactory.CreateSaleAdapter();
- }
- public ObservableCollection<MTPClient.Data.Model.Sale.SaleGoods> QueryAccountSaleGoodsRpt(MTPClient.Data.Model.Account.TradeAccount tradeAccount, string goodCode, int MarketId)
- {
- throw new NotImplementedException();
- }
- public List<MTPClient.Data.Model.Sale.SaleApply> QuerySaleApplyRpt(MTPClient.Data.Model.Account.TradeAccount tradeAccount, string goodsCode)
- {
- throw new NotImplementedException();
- }
- public List<MTPClient.Data.Model.ParameterRule> QueryParameterRule(int contRightCode, uint goodsID, string loginCode)
- {
- throw new NotImplementedException();
- }
- public List<MTPClient.Data.Model.Sale.StrategicInvestor> QueryStrategicInvestor(MTPClient.Data.Model.Account.TradeAccount tradeAccount)
- {
- throw new NotImplementedException();
- }
- /// <summary>
- /// 发售下单
- /// </summary>
- /// <param name="saleOrder"></param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void SaleEntrurstOrder(Data.Model.NewEntrustOrder saleOrder, Action<Data.Model.Account.OrderDetail> successAction, Action<Data.ErrorEntity> errorAction)
- {
- return;
- //var reqeust = _saleAdapter.ToSaleEntrustOrder(saleOrder);
- //var packgage = new TCPPackage() { Content = reqeust, FunCode = FuncCode.FID_IMOrderReq };
- //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action<TCPPackage>((revPackgage) =>
- //{
- // var responeEntrity = _saleAdapter.ToSaleOrder(revPackgage.Content);
- // if (responeEntrity.RetCode == 0)
- // {
- // //todo:生成委托单
- // successAction(responeEntrity.Entity);
- // }
- // else
- // {
- // if (errorAction != null)
- // {
- // errorAction(new ErrorEntity() { ReturnCode = responeEntrity.RetCode, ReturnDesc = responeEntrity.RetMessage, RequestFunc = Client_Resource.Resources_Service_SaleEntrurstOrder });
- // }
- // }
- //}), new Action<int, string>((errorCode, errorDesc) =>
- //{ ////通信错误
- // if (errorAction != null)
- // {
- // //RequestFunc = "发售下单"
- // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_SaleEntrurstOrder });
- // }
- //}));
- }
- /// <summary>
- /// 查询发行商品
- /// </summary>
- /// <param name="statement"></param>
- /// <param name="queryCommonParams"></param>
- /// <param name="successAction"></param>
- /// <param name="errorAction"></param>
- public void QueryAccountSaleGoodsRpt(string statement, List<QueryCommonParam> queryCommonParams, Action<List<Data.Model.Sale.SaleGoods>> successAction, Action<Data.ErrorEntity> errorAction)
- {
- QueryCommonHelper.QueryCommon(statement, queryCommonParams, new Action<List<SaleGoods>>((orderDetails) =>
- {
- if (successAction != null)
- {
- successAction(orderDetails);
- }
- }), (error) =>
- {
- if (errorAction != null)
- {
- //RequestFunc = "查询发行商品"
- error.RequestFunc = Client_Resource.Resources_Service_QueryAccountSaleGoodsRpt;
- errorAction(error);
- }
- });
- }
-
- public void QueryAccountDistributeBallot(List<QueryCommonParam> queryCommonParams, Action<List<DistributeBallot>> successAction, Action<ErrorEntity> errorAction)
- {
- QueryCommonHelper.QueryCommon(QueryStatement.QueryDistributeBallot, queryCommonParams, new Action<List<DistributeBallot>>((orders) =>
- {
- if (successAction != null)
- {
- successAction(orders);
- }
- }), (error) =>
- {
- if (errorAction != null)
- {
- //RequestFunc = "查询配号中签"
- error.RequestFunc = Client_Resource.Resources_Service_QueryAccountDistributeBallot;
- errorAction(error);
- }
- });
- }
- }
- }
|