Exemplo n.º 1
0
        public int SaveAsk(string token, string id, Ask2 ask, ref string description)
        {
            IRestResponse response = null;
            string        content  = null;

            try
            {
                string      strJsonAsk = JsonConvert.SerializeObject(ask);
                RestClient  client     = new RestClient(Config.BaseReqvesteUrl);
                RestRequest request    = new RestRequest("Mobile/Save/Ansver", Method.POST);
                client.Timeout = 60000;
                request.AddHeader("Accept", "application/json");
                request.AddParameter("token", token);
                request.AddParameter("idVe", id);
                request.AddParameter("jsonStrAsk", Compress(strJsonAsk));
                request.AddParameter("type", 6);
                response = client.Execute(request);
                content  = response.Content;
            }
            catch (Exception e)
            {
                return(4);
            }
            if (content == "" || response.StatusCode == System.Net.HttpStatusCode.NotFound)
            {
                return(4);
            }
            else
            {
                return(GetData(content, ref description));
            }
        }
Exemplo n.º 2
0
        internal void SaveAsk2InDb(string idShiping, Ask2 ask2)
        {
            Shipping shipping = context.Shipping.FirstOrDefault(s => s.Id == idShiping);

            shipping.Ask2 = ask2;
            context.SaveChanges();
        }
Exemplo n.º 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (SecurityCode != null
                                 ? SecurityCode.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (OptionNumber != null
                                 ? OptionNumber.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (OptionCode != null
                                 ? OptionCode.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ Bid.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume.GetHashCode();
         hashCode = (hashCode * 397) ^ Volume.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid2.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume2.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask2.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume2.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid3.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume3.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask3.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume3.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid4.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume4.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask4.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume4.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid5.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume5.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask5.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume5.GetHashCode();
         hashCode = (hashCode * 397) ^ (Greeks != null
                                 ? Greeks.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ OpenInterest.GetHashCode();
         hashCode = (hashCode * 397) ^ Turnover.GetHashCode();
         hashCode = (hashCode * 397) ^ UncoveredPositionQuantity.GetHashCode();
         hashCode = (hashCode * 397) ^ PreviousSettlementPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ OpeningPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ AuctionReferencePrice.GetHashCode();
         hashCode = (hashCode * 397) ^ AuctionReferenceQuantity.GetHashCode();
         hashCode = (hashCode * 397) ^ HighestPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LowestPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LatestTradedPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ Change.GetHashCode();
         hashCode = (hashCode * 397) ^ ChangePercentage.GetHashCode();
         hashCode = (hashCode * 397) ^ PreviousClose.GetHashCode();
         hashCode = (hashCode * 397) ^ (Name != null
                                 ? Name.GetHashCode()
                                 : 0);
         return(hashCode);
     }
 }
Exemplo n.º 4
0
 public async Task SaveAsk(string id, int type, string jsonStrAsk)
 {
     if (type == 1)
     {
         Ask ask = JsonConvert.DeserializeObject <Ask>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskInDb(id, ask);
     }
     else if (type == 2)
     {
         Ask1 ask1 = JsonConvert.DeserializeObject <Ask1>(jsonStrAsk);
         sqlCommandApiMobile.SaveAsk1InDb(id, ask1);
     }
     else if (type == 3)
     {
         AskFromUser askFromUser = JsonConvert.DeserializeObject <AskFromUser>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskFromUserInDb(id, askFromUser);
     }
     else if (type == 4)
     {
         AskDelyvery askDelyvery = JsonConvert.DeserializeObject <AskDelyvery>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskDelyveryInDb(id, askDelyvery);
     }
     else if (type == 5)
     {
         AskForUserDelyveryM askForUserDelyveryM = JsonConvert.DeserializeObject <AskForUserDelyveryM>(jsonStrAsk);
         sqlCommandApiMobile.SaveAskForUserDelyveryInDb(id, askForUserDelyveryM);
     }
     else if (type == 6)
     {
         Ask2 ask2 = JsonConvert.DeserializeObject <Ask2>(jsonStrAsk);
         sqlCommandApiMobile.SaveAsk2InDb(id, ask2);
     }
     else if (type == 7)
     {
         List <Photo> photo = JsonConvert.DeserializeObject <List <Photo> >(jsonStrAsk);
         sqlCommandApiMobile.SavePhotoinTruckInDb(id, photo);
     }
     else if (type == 8)
     {
         List <Photo> photo = JsonConvert.DeserializeObject <List <Photo> >(jsonStrAsk);
         sqlCommandApiMobile.SavePhotoStrapInDb(id, photo);
     }
 }
Exemplo n.º 5
0
 protected bool Equals(OptionViewModel other)
 {
     return(string.Equals(OptionNumber, other.OptionNumber) &&
            Bid.Equals(other.Bid) &&
            BidVolume == other.BidVolume &&
            Ask.Equals(other.Ask) &&
            AskVolume == other.AskVolume &&
            Volume == other.Volume &&
            Bid2.Equals(other.Bid2) &&
            BidVolume2 == other.BidVolume2 &&
            Ask2.Equals(other.Ask2) &&
            AskVolume2 == other.AskVolume2 &&
            Bid3.Equals(other.Bid3) &&
            BidVolume3 == other.BidVolume3 &&
            Ask3.Equals(other.Ask3) &&
            AskVolume3 == other.AskVolume3 &&
            Bid4.Equals(other.Bid4) &&
            BidVolume4 == other.BidVolume4 &&
            Ask4.Equals(other.Ask4) &&
            AskVolume4 == other.AskVolume4 &&
            Bid5.Equals(other.Bid5) &&
            BidVolume5 == other.BidVolume5 &&
            Ask5.Equals(other.Ask5) &&
            AskVolume5 == other.AskVolume5 &&
            Equals(Greeks, other.Greeks) &&
            OpenInterest == other.OpenInterest &&
            Turnover.Equals(other.Turnover) &&
            UncoveredPositionQuantity == other.UncoveredPositionQuantity &&
            PreviousSettlementPrice.Equals(other.PreviousSettlementPrice) &&
            OpeningPrice.Equals(other.OpeningPrice) &&
            AuctionReferencePrice.Equals(other.AuctionReferencePrice) &&
            AuctionReferenceQuantity == other.AuctionReferenceQuantity &&
            HighestPrice.Equals(other.HighestPrice) &&
            LowestPrice.Equals(other.LowestPrice) &&
            LatestTradedPrice.Equals(other.LatestTradedPrice) &&
            Change.Equals(other.Change) &&
            ChangePercentage.Equals(other.ChangePercentage) &&
            PreviousClose.Equals(other.PreviousClose) &&
            string.Equals(Name, other.Name));
 }