Exemplo n.º 1
0
 protected virtual void BtOkClick(object sender, EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
     try
     {
         DataSet dataSet;
         CriteriaEventArgs args;
         this.lv_condition.PostEditor();
         this.BindingContext[this.lv_condition.DataSource].EndCurrentEdit();
         this._criteriaBusiness.CheckDtCondition();
         if (!this.IsQueryNode(this.tv_List.SelectedNode) && GetTyQuery() == null )
         {
             DataRow searchXRow = this.GetSearchXRow();
             if (searchXRow != null)
             {
                 dataSet = this._criteriaBusiness.GetDataSet(searchXRow);
                 args = new CriteriaEventArgs();
                 args.DataSet = dataSet;
                 this.Criteria(this, args);
             }
         }
         else
         {
             TyQuery tag = GetTyQuery();// this.tv_List.SelectedNode.Tag as TyQuery;
             string str = string.Format(this._criteriaBusiness.ParsePreCondition(tag.Sql), QueryClientHelper.GetWhereByConditions(this._criteriaBusiness.DtCondition));
             dataSet = RemotingSingletonProvider<CriteriaDAOService>.Instance.Execute(tag.DataSource.Id, new string[] { str }, new string[] { tag.Name });
             dataSet.DataSetName = tag.Name;
             args = new CriteriaEventArgs();
             args.DataSet = dataSet;
             this.Criteria(this, args);
         }
     }
     catch (ConditionInputException exception)
     {
         MessageService.ShowMessage(exception.Message);
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }
Exemplo n.º 2
0
 private void OnCriteria(object sender, CriteriaEventArgs e)
 {
     WaitDialogHelper.Show();
     try
     {
         base.view.OptionsView.ShowFooter = false;
         base.view.GroupSummary.Clear();
         DataSet dataSet = e.DataSet;
         if ((dataSet != null) && (dataSet.Tables.Count > 0))
         {
             DataTable rs = null;
             for (int i = 0; i < dataSet.Tables.Count; i++)
             {
                 rs = dataSet.Tables[i];
                 BoxHelper.SetRsReadOnly(rs);
             }
             DataView defaultView = this.GetMainTable(dataSet).DefaultView;
             base.grid.DataSource = defaultView;
             base.grid.MainView.PopulateColumns();
             this.GridAdjustment(dataSet);
             this.GridEditorsAdjustment();
             base.view.BestFitColumns();
         }
         base.BarStatusUpdate();
     }
     catch (ConditionInputException exception)
     {
         MessageHelper.ShowInfo(exception.Message);
     }
     finally
     {
         WaitDialogHelper.Close();
     }
 }