Ejemplo n.º 1
0
    public static void LoadItems(AjaxResponse prevResponse, IAjaxMng ajaxMng, ComboBox cbx, String bioCode, Params bioParams, Action<ComboBox, AjaxResponse> callback, Boolean addNullItem, Boolean useCache) {
      if ((prevResponse != null) && (!prevResponse.Success)) {
        if (callback != null)
          callback(cbx, prevResponse);
        return;
      }

      var v_cli = new JsonStoreClient {
        AjaxMng = ajaxMng,
        BioCode = bioCode
      };
      CbxItems storedItems = null;
      if (useCache)
        storedItems = _restoreItems(bioCode);
      if (storedItems != null) {
        _loadItems(cbx, storedItems, addNullItem);
        if (callback != null)
          callback(cbx, new AjaxResponse { Success = true });
      } else {
        v_cli.Load(bioParams, (s, a) => {
          if (a.Response.Success) {
            var cbxitems = new CbxItems {metadata = v_cli.JSMetadata, ds = v_cli.DS};
            if (useCache)
              _storeItems(bioCode, cbxitems);
            _loadItems(cbx, cbxitems, addNullItem);
          }
          if (callback != null)
            callback(cbx, a.Response);
        });
      }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Конструктор класса.
 /// </summary>
 /// <param name="ajaxMng">ссылка на AjaxMng</param>
 /// <param name="bioCode">Код объекта - описание курсора</param>
 /// <param name="execBioCode">Код объекта - описание скрипта</param>
 /// <param name="title">Заголовок</param>
 public DSFetchClient(IAjaxMng ajaxMng, String bioCode, String execBioCode, String title)
   : base(ajaxMng, bioCode, title) {
   this.requestType = RequestType.DSFetch;
   this.ExecBioCode = execBioCode;
 }
Ejemplo n.º 3
0
 public static void LoadItems(AjaxResponse prevResponse, IAjaxMng ajaxMng, ComboBox cbx, String bioCode, Params bioParams, Action<ComboBox, AjaxResponse> callback) {
   LoadItems(prevResponse, ajaxMng, cbx, bioCode, bioParams, callback, false, false);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Конструктор класса.
 /// </summary>
 /// <param name="ajaxMng">ссылка на AjaxMng</param>
 /// <param name="bioCode">Код</param>
 /// <param name="title">Заголовок</param>
 public RptClient(IAjaxMng ajaxMng, String bioCode, String title)
   : base(ajaxMng, bioCode, title) {
   this.requestType = RequestType.Rpt;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Конструктор класса.
 /// </summary>
 /// <param name="ajaxMng">ссылка на AjaxMng</param>
 /// <param name="bioCode">Код</param>
 /// <param name="title">Заголовок</param>
 public ExpClient(IAjaxMng ajaxMng, String bioCode, String title):base(ajaxMng, bioCode, title) {
   this.requestType = RequestType.DS2XL;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Конструктор класса.
 /// </summary>
 /// <param name="ajaxMng">ссылка на AjaxMng</param>
 /// <param name="bioCode">Код</param>
 /// <param name="title">Заголовок</param>
 public LongOpClient(IAjaxMng ajaxMng, String bioCode, String title)
   : base(ajaxMng, bioCode, title) {
   this.requestType = RequestType.srvLongOp;
 }