static void Main(string[] args) { // using (var context = new _Usersmagnis2Downloadssqlitetoolsosxx863290000MastersContext()) //{ //var result = context.Model.GetEntityTypes(); /* try * { * using (SqliteConnection con = new SqliteConnection("DataSource=/Users/magnis-2/Downloads/Masters.db,Version=2")) * { * con.Open(); * string stm = "select BCCID from BSECommodityContracts"; * * using (SqliteCommand cmd = new SqliteCommand(stm, con)) * { * using (SqliteDataReader rdr = cmd.ExecuteReader()) * { * while (rdr.Read()) * { * Console.WriteLine(rdr.GetString(1)); * } * } * } * * con.Close(); * } * } * * catch (Exception ex) * { * var ea = ex.Message; * }*/ //} //http IDictionary <int, Type> dictionary = new Dictionary <int, Type>(); dictionary.TryAdd(1, typeof(AddOrderResponse)); JsonResponseConvert jsonResponseConvert = new JsonResponseConvert(); try { var deserialised = jsonResponseConvert.Deserialize(dictionary[1], "|ss|str", '|'); } catch (Exception ex) { var e = ex.Message; } CookieContainer cc = new CookieContainer(); var handler = new HttpClientHandler { CookieContainer = cc }; var client = new HttpClient(handler); //BroadcastHttp(client, jsonResponseConvert).GetAwaiter().GetResult(); //AddTcpOrder(); //CallLogin(client, jsonResponseConvert).GetAwaiter().GetResult(); //AfterMobileLogin(client, jsonResponseConvert, 715787).GetAwaiter().GetResult(); //AddOrder(client, jsonResponseConvert).GetAwaiter().GetResult(); //DoSockets(); }
static async Task AddOrder(HttpClient client, JsonResponseConvert jsonResponseConvert) { string queryAddOrder = "http://membersim.bseindia.com/stocks/AddOrder?"; OrderAndTrade.AddOrder newOrder = new OrderAndTrade.AddOrder(); string queryOrder1 = newOrder.ConcatenatePropertyValue(); string AddOrderResponse = await CallApi(client, queryAddOrder + queryOrder1); AddOrderResponse deserializedAddOrderResponse = (AddOrderResponse)jsonResponseConvert.Deserialize(typeof(AddOrderResponse), AddOrderResponse); //string queryAddOrder = "http://membersim.bseindia.com/stocks/AddOrder?"; //OrderAndTrade.AddOrder newOrder = new OrderAndTrade.AddOrder(); string queryOrder = "OEToken=" + newOrder.OEToken + "&OENSEToken=" + newOrder.OENSEToken + "&OEBSEToken=" + newOrder.OEBSEToken + "&OEDestination=" + newOrder.OEDestination + "&InstrumentType=" + newOrder.InstrumentType + "&OEMarket=" + newOrder.OEMarket + "&OESymbol=" + newOrder.OESymbol + "&OEExpiryDate=" + newOrder.OEExpiryDate + "&OEStrikePrice=" + newOrder.OEStrikePrice + "&OEOptionType=" + newOrder.OEOptionType + "&OESeries=" + newOrder.OESeries + "&OEVolume=" + newOrder.OEVolume + "&OEPrice=" + newOrder.OEPrice + "&OETriggerPrice=" + newOrder.OETriggerPrice + "&OEDisclosedVolume=" + newOrder.OEDisclosedVolume + "&USBackOfficeId=" + newOrder.USBackOfficeId + "&OEFIELD3=" + newOrder.OEFIELD3 + "&OEBuySellIndicator=" + newOrder.OEBuySellIndicator + "&OEAlphaChar=" + newOrder.OEAlphaChar + "&OEActualApproverId=" + newOrder.OEActualApproverId + "&OEVolumeRemaining=" + newOrder.OEVolumeRemaining + "&OEDisclosedVolumeRemaining=" + newOrder.OEDisclosedVolumeRemaining + "&OEAdminUSID=" + newOrder.OEAdminUSID + "&OEStatus=" + newOrder.OEStatus + "&OEProClientIndicator=" + newOrder.OEProClientIndicator + "&OESettlor=" + newOrder.OESettlor + "&OEOrderNumber=" + newOrder.OEOrderNumber + "&OEField1=" + newOrder.OEField1 + "&OEParticipantType=" + newOrder.OEParticipantType + "&OEIntuitionalClient=" + newOrder.OEIntuitionalClient + "&OEName=" + newOrder.OEName + "&OEGoodTillDate=" + newOrder.OEGoodTillDate + ">C=" + newOrder.GTC + "&IOC=" + newOrder.IOC + "&OEBookType=" + newOrder.OEBookType + "&OESegment=" + newOrder.OESegment + "&OEGroup=" + newOrder.OEGroup + "&BlockDeal=" + newOrder.BlockDeal + "&OEReason=" + newOrder.OEReason + "&OEApproverRemarks=" + newOrder.OEApproverRemarks + "&OESolicitorPeriod=" + newOrder.OESolicitorPeriod + "&SessionKey=" + newOrder.SessionKey + "&Thick Client=" + newOrder.ThickClient; /*string queryOrder = "OEToken=" + newOrder.OEToken + "&OENSEToken=&OEBSEToken=" + newOrder.OEBSEToken + "&OEDestination=" + newOrder.OEDestination + "&InstrumentType=" + newOrder.InstrumentType + * "&OEMarket=" + newOrder.OEMarket + "&OESymbol=" + newOrder.OESymbol + "&OEExpiryDate=" + newOrder.OEExpiryDate + * "&OEStrikePrice=" + newOrder.OEStrikePrice + "&OEOptionType=&OESeries=&OEVolume=" + newOrder.OEVolume + * "&OEPrice=" + newOrder.OEPrice + "&OETriggerPrice=" + newOrder.OETriggerPrice + "&OEDisclosedVolume=" + newOrder.OEDisclosedVolume + "&USBackOfficeId=" + newOrder.USBackOfficeId + * "&OEFIELD3=" + newOrder.OEFIELD3 + "&OEBuySellIndicator=" + newOrder.OEBuySellIndicator + "&OEAlphaChar=&OEActualApproverId=&OEVolumeRemaining=&OEDisclosedVolumeRemaining=&OEAdminUSID=" + newOrder.OEAdminUSID + "&OEStatus=" + newOrder.OEStatus + "&OEProClientIndicator=" + newOrder.OEProClientIndicator + "&OESettlor=&OEOrderNumber=&OEField1=&OEParticipantType=&OEIntuitionalClient=" + newOrder.OEIntuitionalClient + + "&OEName=&OEGoodTillDate=>C=" + newOrder.GTC + "&IOC=" + newOrder.IOC + + "&OEBookType=" + newOrder.OEBookType + "&OESegment=&OEGroup=&BlockDeal=&OEReason=&OEApproverRemarks=&OESolicitorPeriod=&SessionKey=" + newOrder.SessionKey + "&Thick Client=" + newOrder.ThickClient; */ bool equal = queryOrder1.Equals(queryOrder); //CheckIdentity(queryOrder, queryOrder1); }
static async Task AfterMobileLogin(HttpClient client, JsonResponseConvert jsonResponseConvert, int OTP) { string queryAuthenticationLogin = "******" + OTP + "&USLOGINID=SER_CT2-T9072&SessionKey=&Thick Client=Y"; string authenticationLoginResponse = await CallApi(client, queryAuthenticationLogin); AuthenticationLoginResponse deserializedAuthenticationLoginResponse = (AuthenticationLoginResponse)jsonResponseConvert.Deserialize(typeof(AuthenticationLoginResponse), authenticationLoginResponse, '|'); Console.WriteLine(authenticationLoginResponse); }