protected void ObjectDataSource2_Filtering(object sender, ObjectDataSourceFilteringEventArgs e)
        {
            string consultar;

                e.ParameterValues.Clear();
                consultar = "select c.id as id, c.razon_social as 'Razon Social', c.direccion as 'Direccion', c.cuit as 'Cuit', c.confianza as 'Confianza', u.nombre as 'Operario Favorito', i.descripcion as 'Condicion Fiscal', email as 'E-Mail' from cliente c, usuario u, condicion_iva i  where c.operario_favorito=u.id and c.condicion_iva=i.id and c.id="+this.DropDownList1.SelectedValue.ToString();
                e.ParameterValues.Add("consulta", consultar);
                Label1.Text = consultar;
        }
 protected virtual new void OnFiltering(ObjectDataSourceFilteringEventArgs e)
 {
 }
		public void DoOnFiltering (ObjectDataSourceFilteringEventArgs e)
		{
			base.OnFiltering (e);
		}
		void view_Filtering (object sender, ObjectDataSourceFilteringEventArgs e)
		{
			event_checker = true;
		}
Example #5
0
 protected void ObjectDataSource1_Filtering(object sender, ObjectDataSourceFilteringEventArgs e)
 {
     if (FiltrBuilding.SelectedValue.ToString() == "")
     {
         e.ParameterValues.Clear();
         e.ParameterValues.Add(FiltrBuilding.SelectedValue.ToString(), "");
     }
 }
 private void gridDS_Filtering(object sender, ObjectDataSourceFilteringEventArgs e)
 {
     ViewState["FilterExpression"] = ((ObjectDataSourceView)sender).FilterExpression;
     Session["CLRQuestionFilterExpression"] = ViewState["FilterExpression"];
 }
		protected internal override IEnumerable ExecuteSelect (DataSourceSelectArguments arguments)
		{
			arguments.RaiseUnsupportedCapabilitiesError (this);

			IOrderedDictionary paramValues = MergeParameterValues (SelectParameters, null, null);
			ObjectDataSourceSelectingEventArgs args = new ObjectDataSourceSelectingEventArgs (paramValues, arguments, false);

			object result = null;

			if (owner.EnableCaching)
				result = owner.Cache.GetCachedObject (SelectMethod, SelectParameters);

			if (result == null) {
				OnSelecting (args);
				if (args.Cancel)
					return new ArrayList ();
				
				if (CanPage) {
					if (StartRowIndexParameterName.Length == 0)
						throw new InvalidOperationException ("Paging is enabled, but the StartRowIndexParameterName property is not set.");
					if (MaximumRowsParameterName.Length == 0)
						throw new InvalidOperationException ("Paging is enabled, but the MaximumRowsParameterName property is not set.");
					paramValues [StartRowIndexParameterName] = arguments.StartRowIndex;
					paramValues [MaximumRowsParameterName] = arguments.MaximumRows;
				}

				if (SortParameterName.Length > 0)
					paramValues [SortParameterName] = arguments.SortExpression;

				result = InvokeSelect (SelectMethod, paramValues);

				if (CanRetrieveTotalRowCount && arguments.RetrieveTotalRowCount)
					arguments.TotalRowCount = QueryTotalRowCount (MergeParameterValues (SelectParameters, null, null), arguments);
				
				if (owner.EnableCaching)
					owner.Cache.SetCachedObject (SelectMethod, SelectParameters, result);
			}

			if (FilterExpression.Length > 0 && !(result is DataGrid || result is DataView || result is DataTable))
				throw new NotSupportedException ("The FilterExpression property was set and the Select method does not return a DataSet, DataTable, or DataView.");

			if (owner.EnableCaching && result is IDataReader)
				throw new NotSupportedException ("Data source does not support caching objects that implement IDataReader");
			
			if (result is DataSet) {
				DataSet dset = (DataSet) result;
				if (dset.Tables.Count == 0)
					throw new InvalidOperationException ("The select method returnet a DataSet which doesn't contain any table.");
				result = dset.Tables [0];
			}
			
			if (result is DataTable) {
				DataView dview = new DataView ((DataTable)result);
				if (arguments.SortExpression != null && arguments.SortExpression.Length > 0) {
					dview.Sort = arguments.SortExpression;
				}
				if (FilterExpression.Length > 0) {
					IOrderedDictionary fparams = FilterParameters.GetValues (context, owner);
					ObjectDataSourceFilteringEventArgs fargs = new ObjectDataSourceFilteringEventArgs (fparams);
					OnFiltering (fargs);
					if (!fargs.Cancel) {
						object[] formatValues = new object [fparams.Count];
						for (int n=0; n<formatValues.Length; n++) {
							formatValues [n] = fparams [n];
							if (formatValues [n] == null) return dview;
						}
						dview.RowFilter = string.Format	(FilterExpression, formatValues);
					}
				}
				return dview;
			}
			
			if (result is IEnumerable)
				return (IEnumerable) result;
			else
				return new object[] {result};
		}
		protected virtual void OnFiltering (ObjectDataSourceFilteringEventArgs e)
		{
			if (Events != null) {
				ObjectDataSourceFilteringEventHandler eh = (ObjectDataSourceFilteringEventHandler) Events [FilteringEvent];
				if (eh != null) eh (this, e);
			}
		}
 protected virtual new void OnFiltering(ObjectDataSourceFilteringEventArgs e)
 {
 }
 /// <devdoc>
 /// Creates a filtered DataView with optional filtering.
 /// </devdoc>
 private IEnumerable CreateFilteredDataView(DataTable dataTable, string sortExpression, string filterExpression) {
     IOrderedDictionary parameterValues = FilterParameters.GetValues(_context, _owner);
     if (filterExpression.Length > 0) {
         ObjectDataSourceFilteringEventArgs filterArgs = new ObjectDataSourceFilteringEventArgs(parameterValues);
         OnFiltering(filterArgs);
         if (filterArgs.Cancel) {
             return null;
         }
     }
     return FilteredDataSetHelper.CreateFilteredDataView(dataTable, sortExpression, filterExpression, parameterValues);
 }
 protected virtual void OnFiltering(ObjectDataSourceFilteringEventArgs e) {
     ObjectDataSourceFilteringEventHandler handler = Events[EventFiltering] as ObjectDataSourceFilteringEventHandler;
     if (handler != null) {
         handler(this, e);
     }
 }
Example #12
0
		static void odc_Filtering (object sender, ObjectDataSourceFilteringEventArgs e)
		{
			filtering = true;
		}
 private IEnumerable CreateFilteredDataView(DataTable dataTable, string sortExpression, string filterExpression)
 {
     IOrderedDictionary values = this.FilterParameters.GetValues(this._context, this._owner);
     if (filterExpression.Length > 0)
     {
         ObjectDataSourceFilteringEventArgs e = new ObjectDataSourceFilteringEventArgs(values);
         this.OnFiltering(e);
         if (e.Cancel)
         {
             return null;
         }
     }
     return FilteredDataSetHelper.CreateFilteredDataView(dataTable, sortExpression, filterExpression, values);
 }