Ejemplo n.º 1
0
 void _jsClient_AfterLoadData(CJsonStoreClient sender, AjaxResponseEventArgs args) {
   if ((this._owner != null) && 
         (this._owner._jsClient != null) && 
           (this._owner._jsClient.jsMetadata != null)) {
     var v_pk_fld = this._owner._jsClient.jsMetadata.getPKFields().FirstOrDefault();
     if (v_pk_fld != null)
       this._owner._multiselection.ValueField = v_pk_fld.name;
   }
 }
Ejemplo n.º 2
0
 private void _doAfterPostData(AjaxResponseEventArgs args) {
   var handler = this.AfterPostData;
   if (handler != null)
     handler(this, args);
 }
Ejemplo n.º 3
0
    private void _post(AjaxRequestDelegate callback, String trunsactionID, SQLTransactionCmd cmd) {
      if (this.AjaxMng == null)
        throw new EBioException("Свойство \"ajaxMng\" должно быть определено!");
      if (String.IsNullOrEmpty(this.BioCode))
        throw new EBioException("Свойство \"bioCode\" должно быть определено!");

      var cancel = false;
      this._doBeforPostData(ref cancel);
      if (cancel) {
        return;
      }

      if (this.BioParams == null)
        this.BioParams = new Params();

      var v_rows = this._getChangesAsJSRows();
      if (v_rows.Count > 0) {
        JsonStoreRequest reqst = new JsonStoreRequestPost {
          BioCode = this.BioCode,
          BioParams = this.BioParams,
          Prms = null,
          transactionID = trunsactionID,
          transactionCmd = cmd,
          Packet = new JsonStoreData {
            MetaData = this._metadata,
            Rows = v_rows
          },
          Callback = (sndr, args) => {
            if (args.Response.Success) {
              var rsp = args.Response as JsonStoreResponse;
              if ((rsp != null) && (rsp.packet != null)) {
                this._applyPostingResults(rsp.packet);
              }
              this._clearChanges();
            }
            if (callback != null) callback(this, args);
            this._doAfterPostData(args);
          }
        };
        this.AjaxMng.Request(reqst);
      } else {
        var v_args = new AjaxResponseEventArgs {
          Request = null,
          Response = new AjaxResponse {
            Ex = null,
            Success = true,
            ResponseText = String.Empty
          },
          Stream = null
        };
        if (callback != null) callback(this, v_args);
        this._doAfterPostData(v_args);
      }
    }
Ejemplo n.º 4
0
 private void _doOnAfterLoadData(AjaxResponseEventArgs args) {
   var handler = this.OnAfterLoadData;
   if (handler != null)
     handler(this, args);
 }