| | |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Windows.Controls.Primitives; |
| | | using System.Windows.Forms; |
| | | using DevExpress.XtraBars; |
| | | using DevExpress.XtraBars.Commands; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraGrid; |
| | | using DevExpress.XtraGrid.Columns; |
| | | using DevExpress.XtraGrid.Menu; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using Gs.DevApp.DevFrm.Rpt; |
| | | using Gs.DevApp.DevFrm.Sys; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | |
| | | namespace Gs.DevApp.UserControl |
| | | { |
| | |
| | | btnZhongTai.ItemClick += BtnbZhongTai_ItemClick; |
| | | btnWg.ItemClick += BtnWg_ItemClick; |
| | | btnHelp.ItemClick += BtnHelp_ItemClick; |
| | | btnLayout.ItemClick += BtnLayout_ItemClick; |
| | | var lst = new List<string>(); |
| | | foreach (BarItem item in barManager1.Items) |
| | | if (item is BarLargeButtonItem largeButtonItem) |
| | |
| | | { |
| | | base.OnCreateControl(); |
| | | if (Parent != null) getNamespace(); |
| | | } |
| | | |
| | | private bool _isCk(int _type) |
| | | { |
| | | Form parentForm = this.FindForm(); |
| | | if (parentForm != null) |
| | | { |
| | | PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault(); |
| | | if (specificControl == null) |
| | | return false; |
| | | if (specificControl.Tag == null) |
| | | return false; |
| | | if (_type == 1) |
| | | { |
| | | if (specificControl != null) |
| | | { |
| | | if (specificControl.Tag.ToString() == "已审核") |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation("该单据已被审核,无法进行操作!"); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | if (_type == 0) |
| | | { |
| | | if (specificControl != null) |
| | | { |
| | | if (specificControl.Tag.ToString() == "未审核") |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation("该单据未被审核,无法进行操作!"); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private void BtnBoHui_ItemClick(object sender, ItemClickEventArgs e) |
| | |
| | | |
| | | private void BtnFchk_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(0); |
| | | if (bl) return; |
| | | if (btnFChkClick != null) |
| | | { |
| | | btnFChkClick(this, e); |
| | |
| | | |
| | | private void BtnChk_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(1); |
| | | if (bl) return; |
| | | if (btnChkClick != null) |
| | | { |
| | | btnChkClick(this, e); |
| | |
| | | |
| | | private void BtnFjianYan_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(0); |
| | | if (bl) return; |
| | | if (btnFjianYanClick != null) |
| | | btnFjianYanClick(this, e); |
| | | else |
| | |
| | | |
| | | private void BtnJianYan_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(1); |
| | | if (bl) return; |
| | | if (btnJianYanClick != null) |
| | | btnJianYanClick(this, e); |
| | | else |
| | |
| | | //_ckService(1.ToString()); |
| | | } |
| | | |
| | | private async void BtnIn_ItemClick(object sender, ItemClickEventArgs e) |
| | | private async void BtnIn_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(xlsInService)) |
| | | { |
| | |
| | | { |
| | | if (btnQueryClick != null) btnQueryClick(this, e); |
| | | } |
| | | |
| | | |
| | | private void BtnEsc_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (MsgHelper.AskQuestion("确定要要取消吗?")) |
| | |
| | | lst.Add(btnLog.Name); |
| | | lst.Add(btnPiZhun.Name); |
| | | lst.Add(btnHelp.Name); |
| | | lst.Add(btnLayout.Name); |
| | | lst.Add(btnBoHui.Name); |
| | | lst.Add(btnTzbl.Name); |
| | | lst.Add(btnKg.Name); |
| | | lst.Add(btnWg.Name); |
| | | lst.Add(btnZhongTai.Name); |
| | | _enabledBtn(lst); |
| | | this.currentAction = "esc"; |
| | | if (btnEscClick != null) btnEscClick(this, e); |
| | |
| | | lst.Add(btnAdd.Name); |
| | | lst.Add(btnEdit.Name); |
| | | lst.Add(btnEsc.Name); |
| | | lst.Add(btnChk.Name); |
| | | lst.Add(btnFchk.Name); |
| | | lst.Add(btnDel.Name); |
| | | lst.Add(btnJianYan.Name); |
| | | lst.Add(btnFjianYan.Name); |
| | | lst.Add(btnQuery.Name); |
| | | lst.Add(btnLog.Name); |
| | | lst.Add(btnZhiLiangChk.Name); |
| | | lst.Add(btnZhiLiangFchk.Name); |
| | | lst.Add(btnPiZhun.Name); |
| | | lst.Add(btnBoHui.Name); |
| | | lst.Add(btnDesign.Name); |
| | | lst.Add(btnReport.Name); |
| | | lst.Add(btnKg.Name); |
| | | lst.Add(btnWg.Name); |
| | | lst.Add(btnZhongTai.Name); |
| | | lst.Add(btnHelp.Name); |
| | | lst.Add(btnLayout.Name); |
| | | lst.Add(btnLoad.Name); |
| | | lst.Add(btnTzbl.Name); |
| | | _enabledBtn(lst); |
| | | } |
| | | } |
| | |
| | | |
| | | private void BtnEdit_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(1); |
| | | if (bl) return; |
| | | var lst = new List<string>(); |
| | | lst.Add(btnSave.Name); |
| | | lst.Add(btnEsc.Name); |
| | | lst.Add(btnHelp.Name); |
| | | lst.Add(btnLayout.Name); |
| | | _enabledBtn(lst); |
| | | this.currentAction = "edit"; |
| | | if (btnEdtClick != null) btnEdtClick(this, e); |
| | |
| | | |
| | | private void BtnDel_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(1); |
| | | if (bl) return; |
| | | if (btnDelClick != null) btnDelClick(this, e); |
| | | |
| | | // btnEsc.Enabled = false; |
| | | this.currentAction = ""; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | lst.Add(btnSave.Name); |
| | | lst.Add(btnEsc.Name); |
| | | lst.Add(btnHelp.Name); |
| | | lst.Add(btnLayout.Name); |
| | | _enabledBtn(lst); |
| | | this.currentAction = "add"; |
| | | if (btnAddClick != null) btnAddClick(this, e); |
| | | Form parentForm = this.FindForm(); |
| | | if (parentForm != null) |
| | | { |
| | | PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault(); |
| | | if (specificControl != null) |
| | | { |
| | | specificControl.Image = global::Gs.DevApp.Properties.Resources.ico_noCheck; |
| | | specificControl.Tag = "未审核"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void BtnRole_ItemClick(object sender, ItemClickEventArgs e) |
| | |
| | | if (btnWgClick != null) btnWgClick(this, e); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private void BtnbZhongTai_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | |
| | | return; |
| | | } |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtnJson.rtnMsg); |
| | | |
| | | } |
| | | |
| | | |
| | | private void BtnLayout_ItemClick(object sender, ItemClickEventArgs ee) |
| | | { |
| | | Form parentForm = this.Parent as Form; |
| | | string _formNamespace = parentForm.GetType().FullName; |
| | | if (parentForm != null) |
| | | { |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | GridControl gcMain = parentForm.Controls.Find("gcMain", true).OfType<GridControl>().FirstOrDefault(); |
| | | if (gcMain != null) { |
| | | GridView gv1 = gcMain.MainView as GridView; |
| | | if (gv1 != null) |
| | | { |
| | | gvList.Add(gv1); |
| | | } |
| | | } |
| | | Gs.DevApp.UserControl.showLayOut DevFrm = new showLayOut(_formNamespace, gvList); |
| | | DevFrm.ShowDialog(); |
| | | } |
| | | if (btnLayoutClick != null) btnLayoutClick(this, ee); |
| | | } |
| | | private void _enabledBtn(List<string> lstBtn) |
| | | { |
| | | foreach (BarItem item in barManager1.Items) |
| | |
| | | var _obj = new |
| | | { |
| | | userGuid = LoginInfoModel.CurrentUser.LoginUserGuid, |
| | | orgGuid = LoginInfoModel.CurrentUser.LoginOrgGuid, |
| | | formNamespace = _formNamespace |
| | | }; |
| | | var strReturn = ""; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | #region 公共事件 |
| | | |
| | |
| | | /// 通知备料 |
| | | /// </summary> |
| | | public event EventHandler btnTzblClick; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 状态 |
| | | /// </summary> |
| | | public event EventHandler btnZhongTaiClick; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 手动完工 |
| | | /// </summary> |
| | | public event EventHandler btnWgClick; |
| | | |
| | | |
| | | |
| | | public event EventHandler btnLayoutClick; |
| | | |
| | | #endregion |
| | | |
| | | #region 公共属性 |