Ejemplo n.º 1
0
 public void RemoveSelected(CRTObject row, Boolean applyToCheckBox) {
   if (this.CheckSelected(row)) {
     if (applyToCheckBox) {
       var v_cbx = row.ExtObject as CheckBox;
       if (v_cbx != null)
         v_cbx.IsChecked = this.Inversion;
     }
     this.Values.Remove(row.GetValue<String>(this.ValueField));
   }
 }
Ejemplo n.º 2
0
 private void _doOnLocation(CRTObject row, EBioException exception, EventHandler<OnSelectEventArgs> callback) {
   if (callback != null) {
     callback(this, new OnSelectEventArgs {
       ex = exception,
       selection = new VSingleSelection { ValueRow = row }
     });
   }
 }
Ejemplo n.º 3
0
 private static Boolean _checkFilter(CRTObject row, Int64 rowPos, JsonStoreFilter filter) {
   if ((row != null) && (filter != null)) {
     if (rowPos >= filter.FromPosition) {
       return filter.Check(row);
     }
     return false;
   }
   return false;
 }
Ejemplo n.º 4
0
 public JSClientAfterMonRowEventArgs(CRTObject row) {
   this.Row = row;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Преобразует строку со значениями первичного ключа в параметры.
 /// </summary>
 /// <param name="row">Строка со значениями первичного ключа.</param>
 /// <returns></returns>
 public Params GetPK(CRTObject row) {
   var @params = new Params();
   var pkDef = this.GetPKFields();
   foreach (var t in pkDef) {
     var vType = t.GetDotNetType();
     var vValue = row.GetValue(t.Name, vType);
     @params.Add(new Param(t.Name, vValue, vType, ParamDirection.Input));
   }
   return @params;
 }
Ejemplo n.º 6
0
 public Boolean Check(CRTObject row) {
   var rslt = (this.JoinCondition == JSFilterItemSplitterType.And) ? true : false;
   foreach (var c in this.Items) {
     var locRslt = false;
     if (c is JSFilterItemCondition)
       locRslt = c.check(row);
     if (this.JoinCondition == JSFilterItemSplitterType.And)
       rslt = rslt && locRslt;
     else
       rslt = rslt || locRslt;
   }
   return rslt;
 }
Ejemplo n.º 7
0
 public Boolean CheckSelected(CRTObject row) {
   return this.Values.Any((v) => {
     return String.Equals(v, row.GetValue<String>(this.ValueField));
   });
 }
Ejemplo n.º 8
0
 public JSClientRowPropertyChangingEventArgs(Boolean cancel, CRTObject row, String propertyName)
   : base(cancel) {
   this.Row = row;
   this.PropertyName = propertyName;
 }
Ejemplo n.º 9
0
 public void AddRow(CRTObject row) {
   this.InsertRow(-1, row);
 }
Ejemplo n.º 10
0
 private void _doOnAfterDeleteRow(Int32 index, CRTObject row) {
   if (!this._rowMonEventsDisabled) {
     this._regChanges(new JSChangedRow(index, JsonStoreRowChangeType.Deleted, row, row));
     var eve = this.OnAfterDeleteRow;
     if (eve != null) {
       var args = new JSClientAfterMonRowEventArgs(row);
       eve(this, args);
     }
   }
 }
Ejemplo n.º 11
0
    public void InsertRow(Int32 index, CRTObject row) {
      var v_ds = this.DS0 as IList;
      if (v_ds != null) {
        var v_cancel = false;
        this._doOnBeforeInsertRow(ref v_cancel, row);
        if (!v_cancel) {
          if (index >= 0)
            v_ds.Insert(index, row);
          else
            v_ds.Add(row);
          this._doOnAfterInsertRow(row);
        }

      }
    }
Ejemplo n.º 12
0
 private void _doOnBeforeDeleteRow(ref Boolean cancel, CRTObject row) {
   if (!this._rowMonEventsDisabled) {
     var eve = this.OnBeforeDeleteRow;
     if (eve != null) {
       var args = new JSClientBeforeMonRowEventArgs(cancel, row);
       eve(this, args);
       cancel = args.Cancel;
     }
   }
 }
Ejemplo n.º 13
0
 private void _doOnAfterInsertRow(CRTObject newRow) {
   if (!this._rowMonEventsDisabled) {
     var v_indx = this.IndexOf(newRow);
     this._regChanges(new JSChangedRow(v_indx, JsonStoreRowChangeType.Added, newRow, null));
     var eve = this.OnAfterInsertRow;
     if (eve != null) {
       var args = new JSClientAfterMonRowEventArgs(newRow);
       eve(this, args);
     }
   }
 }
Ejemplo n.º 14
0
 public Int32 IndexOf(CRTObject row) {
   var foundItem = this.DS.Select((item, index) => new {
     Item = item,
     Position = index
   }).FirstOrDefault(i => i.Item == row);
   return (foundItem != null) ? foundItem.Position : -1;
 }
Ejemplo n.º 15
0
 public void CancelChanges(CRTObject row) {
   if ((this._dsChanges != null) && (row != null)) {
     var c = this._dsChanges.Where(itm => { return itm.CurRow == row; }).FirstOrDefault();
     if (c != null) {
       c.CurRow.DisableEvents();
       c.OrigRow.DisableEvents();
       try {
         if (c.State == JsonStoreRowChangeType.Modified) {
           c.CurRow.SetValues(c.OrigRow);
         }
         c.MarkUnchanged();
       } finally {
         c.CurRow.EnableEvents();
         c.OrigRow.EnableEvents();
       }
       this._dsChanges.Remove(c);
     }
   }
 }
Ejemplo n.º 16
0
 private void _doOnRowPropertyChanging(Object sender, PropertyChangingEventArgs e) {
   this._lastPreChangedRow = ((CRTObject)sender).Copy();
   var eve = this.OnRowPropertyChanging;
   if (eve != null) {
     var ee = new JSClientRowPropertyChangingEventArgs(false, this._lastPreChangedRow, e.PropertyName);
     eve(this, ee);
   }
 }
Ejemplo n.º 17
0
 public override Boolean check(CRTObject row) {
   var val = row.GetValue<Object>(this.FieldName);
   return this._check(val);
 }
Ejemplo n.º 18
0
 public void RemoveRow(CRTObject row) {
   if (row != null) {
     var v_ds = this.DS0 as IList;
     if (v_ds != null) {
       var v_cancel = false;
       this._doOnBeforeDeleteRow(ref v_cancel, row);
       if (!v_cancel) {
         var v_indx = this.IndexOf(row);
         v_ds.Remove(row);
         this._doOnAfterDeleteRow(v_indx, row);
       }
     }
   }
 }
Ejemplo n.º 19
0
 public virtual Boolean check(CRTObject row) { throw new NotImplementedException(); }
Ejemplo n.º 20
0
 private static void _setFieldValue(CRTObject row, String fldName, Object value) {
   if (row != null) {
     row[fldName] = value;
   }
 }
Ejemplo n.º 21
0
 public void AddSelected(CRTObject row) {
   this.AddSelected(row, true);
 }
Ejemplo n.º 22
0
 public JSClientRowPropertyChangedEventArgs(CRTObject row, String propertyName) {
   this.Row = row;
   this.PropertyName = propertyName;
 }
Ejemplo n.º 23
0
 public void RemoveSelected(CRTObject row) {
   this.RemoveSelected(row, true);
 }
Ejemplo n.º 24
0
 public JSChangedRow(Int32 index, JsonStoreRowChangeType state, CRTObject newRow, CRTObject origRow) {
   this.Index = index;
   this.State = state;
   this.OrigRow = origRow;
   this.CurRow = newRow;
 }
Ejemplo n.º 25
0
 private void _doOnRowCheckedChanged(CRTObject row, Boolean chked) {
   if (this._onRowCheckedChangedEnabled) {
     this._onRowCheckedChangedEnabled = false;
     if (chked) {
       if (!this._owner.Selection.Inversion)
         this._owner.Selection.AddSelected(row, false);
       else
         this._owner.Selection.RemoveSelected(row, false);
     } else {
       if (this._owner.Selection.Inversion)
         this._owner.Selection.AddSelected(row, false);
       else
         this._owner.Selection.RemoveSelected(row, false);
     }
     this._onRowCheckedChangedEnabled = true;
   }
 }
Ejemplo n.º 26
0
 public JSClientBeforeMonRowEventArgs(Boolean cancel, CRTObject row)
   : base(cancel) {
   this.Row = row;
 }