public OrderUpdate(String sym, Request.RequestType fill_type, Update.UpdateType upt, String time, int id, double px, double q, String FFT) : base(sym, upt, id, FFT) { m_Price = px; m_FillTime = time; m_FillType = fill_type; m_Qty = q; }
public OrderRequest(String symbol, Request.RequestType request_type, OrderRequest.OrderType order_type, double qty, double price = 0, String FFT = "000") : base(symbol, request_type, 0, FFT) { OrdType = order_type; Price = price; //m_Time = new Time(clock.CurrentTime); Qty = qty; //Debug.WriteLine("START: OrderTime: " + Time.TimeToString( clock.CurrentTime ) + " " + "ActiveTime: " + Time.TimeToString( m_ActiveTime.CurrentTime )); }
public async Task <bool> CreateRequest(Request.RequestType requestType, int fromCityFK, int toCityFK, DateTime dateTime, bool isUrgent, int flexibility, string subject, string itemDescription, string image, int options, bool shareOnFacebook, int willingToPay, string flightInformation) { try { RequestModel request = new RequestModel() { UserFK = App.UserPK, RequestTypeFK = (int)requestType, FromCityFK = fromCityFK, ToCityFK = toCityFK, DateTimeUtc = dateTime, IsUrgent = isUrgent, FlexibilityDays = flexibility, Subject = subject, ItemDescription = itemDescription, Image = image, Options = options, PackageInfoFK = null, AccompanyInfoFK = null, WillingToPay = willingToPay, FlightInformation = flightInformation }; string json = JsonConvert.SerializeObject(request, Formatting.Indented); var content = new StringContent(json, Encoding.UTF8, "application/json"); var response = await m_httpClient.PostAsync(m_uri, content); if (response.IsSuccessStatusCode) { //var content = await response.Content.ReadAsStringAsync(); string res = await response.Content.ReadAsStringAsync(); if (res.Contains("failed")) { return(false); } } } catch (Exception ex) { return(false); } return(true); }
public Response SendRequest(Request.RequestType type, object body) { Response response = null; try { TcpClient client = new TcpClient(); client.Connect(server, port); NetworkStream stream = client.GetStream(); Request request = new Request(type, body); formatter.Serialize(stream, request); response = (Response)formatter.Deserialize(stream); stream.Close(); client.Close(); } catch (Exception ex) { MyMessageBox.Show(ex.Message, App.Current.Windows[0]); } return(response); }
public CancelRequest(String symbol, Request.RequestType request_type, int id, String fft = "000") : base(symbol, request_type, id, fft) { }
public void SendRequest(Request.RequestType type, object body) { Request request = new Request(type, body); formatter.Serialize(stream, request); }