DevApp/Gs.DevApp/App.config | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemTbl.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemTbl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DevApp/Gs.DevApp/App.config
@@ -28,8 +28,8 @@ </assemblyBinding> </runtime> <appSettings> <add key="WebApiUrl" value="http://localhost:5263/" /> <!--<add key="WebApiUrl" value="http://192.168.1.145:81/" />--> <!-- <add key="WebApiUrl" value="http://localhost:5263/" />--> <add key="WebApiUrl" value="http://192.168.1.145:81/" /> <add key="LogPath" value="logs" /> <add key="ProductName" value="广深科技 G-MES V2.0" /> <add key="PageSize" value="50" /> DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemTbl.Designer.cs
@@ -29,6 +29,11 @@ /// </summary> private void InitializeComponent() { DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject(); this.gvMx1tld009 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gvMx1tld007 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gvMx1tld006 = new DevExpress.XtraGrid.Columns.GridColumn(); @@ -44,6 +49,8 @@ this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gvMxDel = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); this.panelMx1 = new DevExpress.XtraEditors.PanelControl(); this.lbMxGuid = new DevExpress.XtraEditors.LabelControl(); this.txt_iCount_1 = new DevExpress.XtraEditors.TextEdit(); @@ -124,9 +131,11 @@ this.btnSelect = new DevExpress.XtraEditors.SimpleButton(); this.labelControl11 = new DevExpress.XtraEditors.LabelControl(); this.lbGuid = new System.Windows.Forms.Label(); this.picCheckBox = new System.Windows.Forms.PictureBox(); this.tabMxPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gcMx1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gvMx1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.panelMx1)).BeginInit(); this.panelMx1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.txt_iCount_1.Properties)).BeginInit(); @@ -157,6 +166,7 @@ ((System.ComponentModel.ISupportInitialize)(this.txt_tbl020.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.txt_tbl013.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.txt_tbl005.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picCheckBox)).BeginInit(); this.SuspendLayout(); // // gvMx1tld009 @@ -290,6 +300,8 @@ this.gcMx1.Location = new System.Drawing.Point(0, 98); this.gcMx1.MainView = this.gvMx1; this.gcMx1.Name = "gcMx1"; this.gcMx1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemButtonEdit1}); this.gcMx1.Size = new System.Drawing.Size(1124, 272); this.gcMx1.TabIndex = 0; this.gcMx1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { @@ -309,7 +321,8 @@ this.gvMx1tld007, this.gvMx1tld009, this.gridColumn1, this.gridColumn2}); this.gridColumn2, this.gvMxDel}); this.gvMx1.GridControl = this.gcMx1; this.gvMx1.Name = "gvMx1"; this.gvMx1.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True; @@ -344,6 +357,27 @@ this.gridColumn2.Visible = true; this.gridColumn2.VisibleIndex = 10; this.gridColumn2.Width = 94; // // gvMxDel // this.gvMxDel.Caption = "移出"; this.gvMxDel.ColumnEdit = this.repositoryItemButtonEdit1; this.gvMxDel.MinWidth = 25; this.gvMxDel.Name = "gvMxDel"; this.gvMxDel.Visible = true; this.gvMxDel.VisibleIndex = 12; this.gvMxDel.Width = 94; // // repositoryItemButtonEdit1 // this.repositoryItemButtonEdit1.AutoHeight = false; editorButtonImageOptions1.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16; editorButtonImageOptions1.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter; this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "移出", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)}); this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit1_ButtonClick); // // panelMx1 // @@ -1296,17 +1330,30 @@ this.lbGuid.TabIndex = 1; this.lbGuid.Visible = false; // // picCheckBox // this.picCheckBox.Image = global::Gs.DevApp.Properties.Resources.ico_noCheck; this.picCheckBox.Location = new System.Drawing.Point(1016, 45); this.picCheckBox.Name = "picCheckBox"; this.picCheckBox.Size = new System.Drawing.Size(100, 50); this.picCheckBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.picCheckBox.TabIndex = 5; this.picCheckBox.TabStop = false; this.picCheckBox.Visible = false; // // Frm_MesItemTbl // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1128, 704); this.Controls.Add(this.picCheckBox); this.Controls.Add(this.xtraTabControl1); this.Controls.Add(this.toolBarMenu1); this.Name = "Frm_MesItemTbl"; this.tabMxPage1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gcMx1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gvMx1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.panelMx1)).EndInit(); this.panelMx1.ResumeLayout(false); this.panelMx1.PerformLayout(); @@ -1339,6 +1386,7 @@ ((System.ComponentModel.ISupportInitialize)(this.txt_tbl020.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.txt_tbl013.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.txt_tbl005.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picCheckBox)).EndInit(); this.ResumeLayout(false); } @@ -1450,5 +1498,8 @@ private DevExpress.XtraEditors.CheckEdit txt_tbl020; private DevExpress.XtraEditors.CheckEdit txt_tbl013; private DevExpress.XtraGrid.Columns.GridColumn gridColumn3; private DevExpress.XtraGrid.Columns.GridColumn gvMxDel; private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; private System.Windows.Forms.PictureBox picCheckBox; } } DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemTbl.cs
@@ -25,8 +25,10 @@ this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1); Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1, picCheckBox, this, "tbl013"); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; //选择需要入库的明细 @@ -120,7 +122,26 @@ _filterList = e.FilterList; getPageList(1); } /// <summary> /// 审核事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) { _toolCk(1); } /// <summary> /// 反审核 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <exception cref="NotImplementedException"></exception> private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) { _toolCk(0); } /// <summary> /// 取消事件 /// </summary> @@ -139,31 +160,37 @@ private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) { string rowGuid = "", rowName = ""; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo"); if (string.IsNullOrEmpty(rowGuid)) { ToolBox.MsgHelper.Warning("请先选择你要操作的行!"); MsgHelper.Warning("请先选择你要操作的行!"); return; } if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?")) return; List<dynamic> lst = new List<dynamic>(); lst.Add(rowGuid); var _obj = lst; var _obj = new { guid = rowGuid, mxGuid = Guid.Empty.ToString(), }; try { string strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModel", JsonConvert.SerializeObject(_obj)); ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); var strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModelOrMx", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { UtilityHelper.JumpToTab(xtraTabControl1, 0); getPageList(1); } ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); MsgHelper.Warning("提示:" + _rtn.rtnMsg); } catch (Exception ex) { ToolBox.MsgHelper.Warning("提示:" + ex.Message); MsgHelper.Warning("提示:" + ex.Message); } } @@ -383,5 +410,100 @@ ToolBox.MsgHelper.Warning("提示:" + ex.Message); } } private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { var rowhandle = gvMx1.FocusedRowHandle; if (rowhandle < 0) return; if (e.Button.Index == 0) { var dr = gvMx1.GetDataRow(rowhandle); var mxGuid = dr["tlid"].ToString(); if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?")) return; if (string.IsNullOrEmpty(mxGuid)) { gvMx1.DeleteRow(rowhandle); return; } var _obj = new { guid = lbGuid.Text.Trim(), mxGuid = mxGuid, }; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModelOrMx", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); } MsgHelper.Warning("提示:" + _rtn.rtnMsg); } catch (Exception ex) { MsgHelper.Warning("提示:" + ex.Message); } } } /// <summary> /// 工具条事件 /// </summary> /// <param name="inFieldValue"></param> private void _toolCk(int _inFieldValue) { string strMsg = ""; switch (_inFieldValue) { case 1: strMsg = "审核"; break; case 0: strMsg = "反审核"; break; }; toolBarMenu1.guidKey = ""; string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1, "billNo"); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.Warning("请先选择你要操作的行!"); return; } if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?")) return; var _obj = new { guid = rowGuid, inFieldValue = _inFieldValue, }; try { var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModelSubmit", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) getModel(lbGuid.Text.Trim(), false, 999); else getPageList(1); } } catch (Exception ex) { MsgHelper.Warning("提示:" + ex.Message); } } } } DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -1451,7 +1451,7 @@ /// <param name="fm">当前窗体</param> /// <param name="fileName">字段</param> /// <param name="icoName">图标路径</param> public static void SetGridSear(GridView gridView1, PictureBox btnChkIco = null, Form fm = null, string fileName = "checkStatus", string icoName = "") public static void SetGridSear(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "") { // gridView1.OptionsView.ColumnAutoWidth = false;自动调整列宽 foreach (GridColumn column in gridView1.Columns) @@ -1483,11 +1483,11 @@ e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); e.Graphics.DrawString(str, f, Brushes.Gray, r); }; if (btnChkIco != null) if (picCheckBox != null) { gridView1.FocusedRowChanged += (s, e) => { UtilityHelper.SetCheckIco(s, btnChkIco, fm, fileName, icoName); UtilityHelper.SetCheckIco(s, picCheckBox, fm, fileName, icoName); }; } }