当前位置: 首页>>代码示例>>C#>>正文


C# Params.Merge方法代码示例

本文整理汇总了C#中Params.Merge方法的典型用法代码示例。如果您正苦于以下问题:C# Params.Merge方法的具体用法?C# Params.Merge怎么用?C# Params.Merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Params的用法示例。


在下文中一共展示了Params.Merge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

    public void Init(
      JsonStoreData packet,
      Params bioParams,
      JsonStoreFilter filter,
      JsonStoreSort sorter,
      String selection,
      Int32 timeout
    ) {

      this.rqPacket = packet;
      this._rq_bioParams = bioParams;
      this._rq_filter = filter;
      this._rq_sorter = sorter;
      this._rq_selection = selection;

      if (this.rqPacket == null)
        this.rqPacket = this._creJSData();
      XmlElement SQLtext = detectSQLTextElement(this.CursorIniDoc, this.bioCode);
      _applyParamsTypes((XmlElement)SQLtext.ParentNode, this.rqBioParams);
      this.InitCursorFields();
      if (this.rqBioParams == null)
        this._rq_bioParams = new Params();
      base.Init(SQLtext.InnerText, this.rqBioParams);
      String vSQL = this.preparedSQL;
      Boolean v_filterIsDefined = this._applyFilter(this._rq_filter, ref this._rq_bioParams, ref vSQL);
      Boolean v_sorterIsDefined = this._applySorter(this._rq_sorter, ref vSQL);

      if (String.IsNullOrEmpty(this._rq_selection)) {
        JsonStoreFilter vLocate = (this.rqPacket != null) ? this.rqPacket.Locate : null;
        if (vLocate != null) {
          // ищем запрошенную запись
          var v_min_start = vLocate.FromPosition;
          String vSQLStr = null;
          var v_lprms = new Params();
          vLocate.BuildSQLConditions(ref vSQLStr, v_lprms);
          if (!String.IsNullOrEmpty(vSQLStr))
            vSQLStr = vSQLStr + " AND";
          v_lprms = v_lprms.Merge(this.rqBioParams, true);
          v_lprms.SetValue("loc_start_from", v_min_start);
          vSQLStr = String.Format(csLocateNextSQLTemplate, vSQL, vSQLStr);
          int rnum = Convert.ToInt32(SQLCmd.ExecuteScalarSQL(this.Connection, vSQLStr, v_lprms, timeout));
          if (this.rqPacket.Limit > 0)
            this.rqPacket.Start = Math.Max(((rnum - 1) / this.rqPacket.Limit) * this.rqPacket.Limit, 0);
        }
        this._applyPagging(this.rqPacket, !v_filterIsDefined && !v_sorterIsDefined, ref this._rq_bioParams, ref vSQL, timeout);
      } else {
        this._buildSelectSelectionSQL(this._rq_selection, this.rqBioParams, ref vSQL);
      }
      this.preparedSQL = vSQL;
    }
开发者ID:tormoz70,项目名称:Bio.Framework.8,代码行数:50,代码来源:CJSCursor.cs

示例2: DoDelete

    /*
    /// <summary>
    /// Удаляет запись по признаку первичного ключа.
    /// </summary>
    /// <exception cref="EBioException">Возбуждается, когда операция завершилась с ошибкой.</exception>
    public void DoDelete(Params @params) {
      this.doExecute(@params, "delete");
    }

    /// <summary>
    /// Добавляет/Изменяет запись по признаку первичного ключа.
    /// </summary>
    /// <exception cref="EBioException">Возбуждается, когда операция завершилась с ошибкой.</exception>
    public void DoInsertUpdate(Params @params) {
      this.doExecute(@params, "insertupdate");
    }
    */

    private Params _buildPostParams(JsonStoreMetadata metadata, JsonStoreRow row, Params bioParams) {
      Params v_rslt = new Params();
      for (int i = 0; i < metadata.Fields.Count; i++)
        v_rslt.Add(metadata.Fields[i].Name.ToLower(), row.Values[i]);
      v_rslt = v_rslt.Merge(bioParams, false);
      return v_rslt;

    }
开发者ID:tormoz70,项目名称:Bio.Framework.8,代码行数:26,代码来源:CJSCursor.cs

示例3: _applyFilter

 private Boolean _applyFilter(JsonStoreFilter filter, ref Params bioParams, ref String vSQL) {
   // фильтруем
   String vCondition = null;
   if (filter != null) {
     var v_prms = new Params(); 
     filter.BuildSQLConditions(ref vCondition, v_prms);
     bioParams = v_prms.Merge(bioParams, true);
   }
   Boolean vFilterIsDefined = !String.IsNullOrEmpty(vCondition);
   if (vFilterIsDefined) {
     vSQL = String.Format(csFltrSQLTemplate, vSQL, vCondition);
     return true;
   }
   return false;
 }
开发者ID:tormoz70,项目名称:Bio.Framework.8,代码行数:15,代码来源:CJSCursor.cs


注:本文中的Params.Merge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。