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 QueryAccountSaleGoodsRpt(MTPClient.Data.Model.Account.TradeAccount tradeAccount, string goodCode, int MarketId) { throw new NotImplementedException(); } public List QuerySaleApplyRpt(MTPClient.Data.Model.Account.TradeAccount tradeAccount, string goodsCode) { throw new NotImplementedException(); } public List QueryParameterRule(int contRightCode, uint goodsID, string loginCode) { throw new NotImplementedException(); } public List QueryStrategicInvestor(MTPClient.Data.Model.Account.TradeAccount tradeAccount) { throw new NotImplementedException(); } /// /// 发售下单 /// /// /// /// public void SaleEntrurstOrder(Data.Model.NewEntrustOrder saleOrder, Action successAction, Action errorAction) { return; //var reqeust = _saleAdapter.ToSaleEntrustOrder(saleOrder); //var packgage = new TCPPackage() { Content = reqeust, FunCode = FuncCode.FID_IMOrderReq }; //LinkManager.Instance.TradeTcpLinkProxy.SendPackage(packgage, new Action((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((errorCode, errorDesc) => //{ ////通信错误 // if (errorAction != null) // { // //RequestFunc = "发售下单" // errorAction(new ErrorEntity() { ReturnCode = errorCode, ReturnDesc = errorDesc, RequestFunc = Client_Resource.Resources_Service_SaleEntrurstOrder }); // } //})); } /// /// 查询发行商品 /// /// /// /// /// public void QueryAccountSaleGoodsRpt(string statement, List queryCommonParams, Action> successAction, Action errorAction) { QueryCommonHelper.QueryCommon(statement, queryCommonParams, new Action>((orderDetails) => { if (successAction != null) { successAction(orderDetails); } }), (error) => { if (errorAction != null) { //RequestFunc = "查询发行商品" error.RequestFunc = Client_Resource.Resources_Service_QueryAccountSaleGoodsRpt; errorAction(error); } }); } public void QueryAccountDistributeBallot(List queryCommonParams, Action> successAction, Action errorAction) { QueryCommonHelper.QueryCommon(QueryStatement.QueryDistributeBallot, queryCommonParams, new Action>((orders) => { if (successAction != null) { successAction(orders); } }), (error) => { if (errorAction != null) { //RequestFunc = "查询配号中签" error.RequestFunc = Client_Resource.Resources_Service_QueryAccountDistributeBallot; errorAction(error); } }); } } }