copy from DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemQt.cs
copy to DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesItemQtCk.cs
Îļþ´Ó DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemQt.cs ¸´ÖÆ |
| | |
| | | using DevExpress.RichEdit.Export; |
| | | using DevExpress.RichEdit.Export; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using DevExpress.XtraGrid.Views.Grid.ViewInfo; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace Gs.DevApp.DevFrm |
| | | namespace Gs.DevApp.DevFrm.Ck |
| | | { |
| | | public partial class Frm_MesItemQt : DevExpress.XtraEditors.XtraForm |
| | | public partial class Frm_MesItemQtCk : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | string _webServiceName = "MesItemQtManager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | public Frm_MesItemQt() |
| | | public Frm_MesItemQtCk() |
| | | { |
| | | InitializeComponent(); |
| | | this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; |
| | |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qt015", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => |
| | | { |
| | | getModel(value); |
| | | }, (value) => |
| | | { |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | }); |
| | | getPageList(1); |
| | | pageBar1.PagerEvent += PageBar1_PagerEvent; |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1); |
| | | gridView1.CustomDrawRowIndicator += (s, e) => |
| | | { |
| | | if (e.Info.IsRowIndicator && e.RowHandle >= 0) |
| | | { |
| | | e.Info.DisplayText = (e.RowHandle + 1).ToString(); |
| | | } |
| | | }; |
| | | gridView1.FocusedRowChanged += (s, e) => |
| | | { |
| | | UtilityHelper.SetCheckIco(s, picCheckBox, this, "qt015", ""); |
| | | }; |
| | | gridView1.CustomDrawEmptyForeground += (s, e) => |
| | | { |
| | | string str = "ææªæ¥æ¾å°å¹é
çæ°æ®!"; |
| | | Font f = new Font("微软é
é»", 16); |
| | | Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); |
| | | e.Graphics.DrawString(str, f, Brushes.Gray, r); |
| | | }; |
| | | //设置ä»åºéæ© |
| | | txt_qt008.getSuppler(""); |
| | | this.txt_qt008.EditChanged += (s, e) => |
| | | { |
| | | |
| | | }; |
| | | var _obj = new |
| | | { |
| | |
| | | MsgHelper.Warning("æç¤ºï¼" + ex.Message); |
| | | } |
| | | } |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | | _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); |
| | | Task.Delay(100); |
| | | Task.Delay(100); |
| | | getPageList(1); |
| | | } |
| | | /// <summary> |
| | | /// åå»äºä»¶ |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) |
| | | { |
| | | string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); |
| | | if (!string.IsNullOrEmpty(rowGuid)) |
| | | getModel(rowGuid, false, 999); |
| | | } |
| | | /// <summary> |
| | | /// å页äºä»¶ |
| | |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | getPageList(1); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 0) |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | else |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); |
| | | } |
| | | ToolBox.MsgHelper.Warning("æç¤ºï¼" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | getModel(lbGuid.Text.Trim(), false, 999); |
| | | getModel(lbGuid.Text.Trim()); |
| | | else |
| | | { |
| | | _filterList.Clear(); |
| | |
| | | ToolBox.MsgHelper.Warning("请å
éæ©ä½ è¦æä½çè¡ï¼"); |
| | | return; |
| | | } |
| | | getModel(rowGuid, true, 1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); |
| | | UtilityHelper.ChangeEnableByControl(panel1.Controls, true); |
| | | } |
| | | /// <summary> |
| | | /// æ°å¢äºä»¶ |
| | |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 1); |
| | | lbGuid.Text = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gridViews.Add(gvMx1); |
| | | UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// ä¿åäºä»¶ |
| | |
| | | /// </summary> |
| | | /// <param name="curPage">第å 页</param> |
| | | /// <param name="pageSize">æ¯é¡µå æ¡</param> |
| | | private void getPageList(int curPage) |
| | | private void getPageList(int curPage) |
| | | { |
| | | |
| | | var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | |
| | | { |
| | | ToolBox.MsgHelper.ShowError("æç¤ºï¼" + ex.Message); |
| | | } |
| | | |
| | | |
| | | } |
| | | private void getModel(string strGuid, bool isEdit, int tabIdx) |
| | | private void getModel(string strGuid) |
| | | { |
| | | bool isEdit = false; |
| | | if (toolBarMenu1.currentAction == "add") return; |
| | | if (toolBarMenu1.currentAction == "edit") isEdit = true; |
| | | if (string.IsNullOrEmpty(strGuid)) |
| | | { |
| | | ToolBox.MsgHelper.Warning("请å
éæ©ä½ è¦æä½çè¡ï¼"); |
| | | return; |
| | | } |
| | | UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); |
| | | var _obj = new |
| | | { |
| | | guid = strGuid,//主建 |
| | |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) |
| | | private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) |
| | | { |
| | | _toolCk(1); |
| | | } |
| | |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) |
| | | private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) |
| | | { |
| | | _toolCk(0); |
| | | } |
| | |
| | | /// å·¥å
·æ¡äºä»¶ |
| | | /// </summary> |
| | | /// <param name="inFieldValue"></param> |
| | | private void _toolCk(int _inFieldValue) |
| | | private void _toolCk(int _inFieldValue) |
| | | { |
| | | string strMsg = ""; |
| | | switch (_inFieldValue) |
| | |
| | | } |
| | | if (!MsgHelper.AskQuestion("ä½ éæ©äºã" + rowName + "ãï¼ç¡®å®" + strMsg + "åï¼")) |
| | | return; |
| | | |
| | | |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid, |
| | |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | getModel(lbGuid.Text.Trim(), false, 999); |
| | | getModel(lbGuid.Text.Trim()); |
| | | else |
| | | getPageList(1); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("æç¤ºï¼" + ex.Message); |
| | | } |
| | | |
| | | |
| | | } |
| | | private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); |
| | | if (_rtn.rtnCode > 0) getModel(lbGuid.Text); |
| | | } |
| | | MsgHelper.Warning("æç¤ºï¼" + _rtn.rtnMsg); |
| | | } |