| | |
| | | using System.Data; |
| | | using System.Text; |
| | | using System.Windows.Forms; |
| | | using DevExpress.Utils.DirectXPaint; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors.Controls; |
| | | using DevExpress.XtraGrid.Columns; |
| | | using DevExpress.XtraGrid.Views.Base.ViewInfo; |
| | | using FastReport.MSChart; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace Gs.DevApp.UserControl |
| | | { |
| | | public partial class ShowFilter : XtraForm |
| | | { |
| | | private readonly GridColumnCollection _columns; |
| | | |
| | | private readonly string _fullName; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="Columns">列名</param> |
| | | /// <param name="list">默认值</param> |
| | | /// <param name="FullName">类名</param> |
| | | public ShowFilter(GridColumnCollection Columns, |
| | | List<FilterEntity> list = null) |
| | | List<FilterEntity> list = null, string FullName = "") |
| | | { |
| | | FilterList = list; |
| | | _columns = Columns; |
| | | _fullName = FullName; |
| | | InitializeComponent(); |
| | | repositoryItemComboBox1.TextEditStyle = |
| | | TextEditStyles.DisableTextEditor; |
| | |
| | | btnEsc.Click += BtnEsc_Click; |
| | | btnQuery.Click += BtnQuery_Click; |
| | | getPageList(); |
| | | //下面为查询配置 |
| | | getPageListQuery(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (col.Tag != null && col.Tag.ToString().StartsWith("query")) |
| | | { |
| | | var item = new CboItemEntity(); |
| | | item.Text = col.Tag.ToString().Replace("query_a.", "") + |
| | | item.Text = col.Tag.ToString().Replace("query_", "") + |
| | | "(" + col.Caption + ")"; |
| | | //item.Value = col.FieldName; |
| | | item.Value = col.Tag.ToString().Replace("query_a.", ""); |
| | | item.Value = col.Tag.ToString().Replace("query_", ""); |
| | | repositoryItemComboBox1.Items.Add(item); |
| | | } |
| | | |
| | |
| | | item.Value = kvp.Key; |
| | | repositoryItemComboBox2.Items.Add(item); |
| | | } |
| | | |
| | | try |
| | | { |
| | | var dt = new DataTable(); |
| | |
| | | dr["fieldValue"] = _sql.fileValue.Replace("%", ""); |
| | | dt.Rows.Add(dr); |
| | | } |
| | | |
| | | gcMain.BindingContext = new BindingContext(); |
| | | gcMain.DataSource = dt; |
| | | gcMain.ForceInitialize(); |
| | |
| | | EventArgs e) |
| | | { |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 移出一行 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, ButtonPressedEventArgs e) |
| | | { |
| | | gridView1.CloseEditor(); |
| | | gridView1.UpdateCurrentRow(); |
| | | var rowhandle = gridView1.FocusedRowHandle; |
| | | if (rowhandle < 0) |
| | | return; |
| | | if (e.Button.Index == 0) |
| | | { |
| | | var dr = gridView1.GetDataRow(rowhandle); |
| | | gridView1.DeleteRow(rowhandle); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | #region MyRegion |
| | | private void getPageListQuery() |
| | | { |
| | | var _colList = new List<dynamic>(); |
| | | foreach (GridColumn col in _columns) |
| | | { |
| | | _colList.Add(col.Name.ToString()); |
| | | } |
| | | var _obj = new |
| | | { |
| | | formPath = this._fullName, |
| | | colArray = _colList |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | "Fm/GetQuery", JsonConvert.SerializeObject(_obj)); |
| | | var dt = UtilityHelper.ReturnToList(strJson); |
| | | DataTable _newTable = dt.rtnData; |
| | | gcQuery.BindingContext = new BindingContext(); |
| | | gcQuery.DataSource = _newTable; |
| | | gcQuery.ForceInitialize(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |