public static List<InstrumentQuotationSet> UpdateQuotePolicyDetails(string exchangeCode, string originCodes, string action, int value)
 {
     List<InstrumentQuotationSet> QuotePolicyChangeDetails = new List<InstrumentQuotationSet>();
     string sql = "[dbo].[SetQuotePolicyDetail]";
     using (SqlConnection con = DataAccess.GetInstance(exchangeCode).GetSqlConnection())
     {
         using (SqlTransaction tran = con.BeginTransaction())
         {
             using (SqlCommand command = con.CreateCommand())
             {
                 command.Transaction = tran;
                 command.CommandText = sql;
                 command.CommandType = CommandType.StoredProcedure;
                 command.Parameters.Add(new SqlParameter("@XmlOriginCode", originCodes));
                 command.Parameters.Add(new SqlParameter("@Action", action));
                 command.Parameters.Add(new SqlParameter("@changeValue", value));
                 command.Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int) { Direction = ParameterDirection.ReturnValue });
                 using (SqlDataReader reader = command.ExecuteReader())
                 {
                     while (reader.Read())
                     {
                         InstrumentQuotationSet quotePolicyChange = new InstrumentQuotationSet();
                         quotePolicyChange.ExchangeCode = exchangeCode;
                         quotePolicyChange.QoutePolicyId = (Guid)reader["QuotePolicyID"];
                         quotePolicyChange.InstrumentId = (Guid)reader["instrumentId"];
                         if (action == "AdjustUp" || action == "AdjustDn" || action == "AdjustReplace")
                         {
                             quotePolicyChange.type = InstrumentQuotationEditType.AutoAdjustPoints;
                         }
                         else
                         {
                             quotePolicyChange.type = InstrumentQuotationEditType.SpreadPoints;
                         }
                         quotePolicyChange.Value = (int)reader["ChangeValue"];
                         QuotePolicyChangeDetails.Add(quotePolicyChange);
                     }
                 }
                 int returnValue = (int)command.Parameters["@RETURN_VALUE"].Value;
                 if (returnValue == 0)
                 {
                     tran.Commit();
                 }
                 else
                 {
                     QuotePolicyChangeDetails.Clear();
                 }
             }
         }
     }
     return QuotePolicyChangeDetails;
 }
 private void IsOriginHiLoCheckBox_Click(object sender, RoutedEventArgs e)
 {
     CheckBox cb = sender as CheckBox;
     InstrumentQuotation instrumentQuotation = cb.Tag as InstrumentQuotation;
     if (instrumentQuotation != null)
     {
         InstrumentQuotationSet set = new InstrumentQuotationSet();
         set.ExchangeCode = instrumentQuotation.ExchangeCode;
         set.QoutePolicyId = instrumentQuotation.QuotationPolicyId;
         set.InstrumentId = instrumentQuotation.InstruemtnId;
         set.type = InstrumentQuotationEditType.IsOriginHiLo;
         set.Value = (bool)cb.IsChecked ? 1 : 0;
         ConsoleClient.Instance.UpdateExchangeQuotation(set);
     }
 }
 private void UpdateInstrument(InstrumentQuotationEditType type, InstrumentQuotation instrumentQuotation,int value)
 {
     InstrumentQuotationSet set = new InstrumentQuotationSet();
     set.ExchangeCode = instrumentQuotation.ExchangeCode;
     set.QoutePolicyId = instrumentQuotation.QuotationPolicyId;
     set.InstrumentId = instrumentQuotation.InstruemtnId;
     set.type = type;
     set.Value = value;
     ConsoleClient.Instance.UpdateInstrument(set);
 }
 public bool UpdateInstrument(InstrumentQuotationSet set)
 {
     Guid[] instruments = new Guid[1];
     instruments[0] = set.InstrumentId;
     iExchange.Common.Manager.ParameterUpdateTask task = new iExchange.Common.Manager.ParameterUpdateTask();
     task.Instruments = instruments;
     string value = string.Empty;
     if (set.type == InstrumentQuotationEditType.IsPriceEnabled || set.type == InstrumentQuotationEditType.IsOriginHiLo || set.type == InstrumentQuotationEditType.IsAutoFill || set.type == InstrumentQuotationEditType.IsAutoEnablePrice)
     {
         value = XmlConvert.ToString((bool)set.Value);
     }
     else
     {
         value = set.Value.ToString();
     }
     task.ExchangeSettings.Add(new iExchange.Common.Manager.ExchangeSetting { Id = set.InstrumentId, ParameterKey = Enum.GetName(typeof(InstrumentQuotationEditType), set.type), ParameterValue = value });
     return this._ExchangeSystems[set.ExchangeCode].UpdateInstrument(task);
 }
 public void UpdateInstrument(InstrumentQuotationSet set)
 {
     this._ServiceProxy.BeginUpdateInstrument(set, delegate(IAsyncResult ar)
     {
         this._ServiceProxy.EndUpdateInstrument(ar);
     }, null);
 }
 public void UpdateExchangeQuotation(InstrumentQuotationSet set)
 {
     this._ServiceProxy.BeginUpdateQuotationPolicy(set, delegate(IAsyncResult ar)
     {
         this._ServiceProxy.EndUpdateQuotationPolicy(ar);
     }, null);
 }
 private void SetQuotePolicyDetail(InstrumentQuotationEditType type, int value)
 {
     InstrumentQuotationSet set = new InstrumentQuotationSet();
     set.ExchangeCode = this._Source.ExchangeCode;
     set.QoutePolicyId = this._Source.QuotationPolicyId;
     set.InstrumentId = this._Source.InstruemtnId;
     set.Value = value;
     set.type = type;
     ConsoleClient.Instance.UpdateExchangeQuotation(set);
 }
 private void SetInstrument(InstrumentQuotationEditType type, object value)
 {
     if (this._IsInit)
     {
         InstrumentQuotationSet set = new InstrumentQuotationSet();
         set.ExchangeCode = this._Source.ExchangeCode;
         set.InstrumentId = this._Source.InstruemtnId;
         set.Value = value;
         set.type = type;
         ConsoleClient.Instance.UpdateInstrument(set);
     }
 }