| | |
| | | using DevExpress.XtraBars; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraGrid; |
| | | using DevExpress.XtraGrid.Views.Base.ViewInfo; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using DevExpress.XtraLayout; |
| | | using Gs.DevApp.DevFrm.Rpt; |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace Gs.DevApp.UserControl |
| | |
| | | btnIn.ItemClick += BtnIn_ItemClick; |
| | | btnChk.ItemClick += BtnChk_ItemClick; |
| | | btnFchk.ItemClick += BtnFchk_ItemClick; |
| | | btnJianYan.ItemClick += BtnJianYan_ItemClick; |
| | | btnFjianYan.ItemClick += BtnFjianYan_ItemClick; |
| | | btnPiZhun.ItemClick += BtnPiZhun_ItemClick; |
| | | btnFPiZhun.ItemClick += BtnFPiZhun_ItemClick; |
| | | btnLog.ItemClick += BtnLog_ItemClick; |
| | | btnZhiLiangChk.ItemClick += BtnZhiLiangChk_ItemClick; |
| | | btnZhiLiangFchk.ItemClick += BtnZhiLiangFchk_ItemClick; |
| | | btnCaiGouChk.ItemClick += BtnCaiGouChk_ItemClick; |
| | | btnCaiGouFchk.ItemClick += BtnCaiGouFchk_ItemClick; |
| | | btnBoHui.ItemClick += BtnBoHui_ItemClick; |
| | | btnJieAn.ItemClick += BtnJieAn_ItemClick; |
| | | btnFjieAn.ItemClick += BtnFjieAn_ItemClick; |
| | | btnTzbl.ItemClick += BtnTzbl_ItemClick; |
| | |
| | | btnCaiWuFchk.ItemClick += BtnCaiWuFchk_ItemClick; |
| | | btnShouHouChk.ItemClick += BtnShouHouChk_ItemClick; |
| | | btnShouHouFchk.ItemClick += BtnShouHouFchk_ItemClick; |
| | | btnOa.ItemClick += BtnOa_ItemClick; |
| | | var lst = new List<string>(); |
| | | foreach (BarItem item in barManager1.Items) |
| | | if (item is BarLargeButtonItem largeButtonItem) |
| | |
| | | actions = lst; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化按钮状态 |
| | | /// </summary> |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private void BtnBoHui_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnBoHuiClick != null) |
| | | btnBoHuiClick(this, e); |
| | | //if (string.IsNullOrEmpty(guidKey)) |
| | | //{ |
| | | // MsgHelper.Warning("请先选择你要操作的行!"); |
| | | // return; |
| | | //} |
| | | |
| | | //if (string.IsNullOrEmpty(chkParameter)) |
| | | //{ |
| | | // MsgHelper.ShowError("没有指定驳回参数,请联系开发人员获取支持!"); |
| | | // return; |
| | | //} |
| | | |
| | | //if (!MsgHelper.AskQuestion("你选择了1条数据,确定驳回重检吗?")) |
| | | // return; |
| | | //_ckService("5"); |
| | | } |
| | | |
| | | private void BtnCaiGouFchk_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnCaiGouFchkClick != null) |
| | |
| | | if (btnShouHouChkClick != null) |
| | | btnShouHouChkClick(this, e); |
| | | } |
| | | |
| | | private void BtnZhiLiangFchk_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnZhiLiangFchkClick != null) |
| | | btnZhiLiangFchkClick(this, e); |
| | | } |
| | | |
| | | private void BtnZhiLiangChk_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnZhiLiangChkClick != null) |
| | | btnZhiLiangChkClick(this, e); |
| | | //if (string.IsNullOrEmpty(guidKey)) |
| | | //{ |
| | | // MsgHelper.Warning("请先选择你要操作的行!"); |
| | | // return; |
| | | //} |
| | | |
| | | //if (string.IsNullOrEmpty(chkParameter)) |
| | | //{ |
| | | // MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!"); |
| | | // return; |
| | | //} |
| | | |
| | | //if (!MsgHelper.AskQuestion("你选择了1条数据,确定质量审核吗?")) |
| | | // return; |
| | | //_ckService("3"); |
| | | } |
| | | |
| | | |
| | | private void BtnFchk_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(0); |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | private void BtnLog_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnLogClick != null) btnLogClick(this, e); |
| | |
| | | { |
| | | if (btnPiZhunClick != null) btnPiZhunClick(this, e); |
| | | } |
| | | |
| | | private void BtnFjianYan_ItemClick(object sender, ItemClickEventArgs e) |
| | | private void BtnFPiZhun_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(0); |
| | | if (bl) return; |
| | | if (btnFjianYanClick != null) |
| | | btnFjianYanClick(this, e); |
| | | else |
| | | return; |
| | | if (btnFPiZhunClick != null) btnFPiZhunClick(this, e); |
| | | } |
| | | |
| | | private void BtnJianYan_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | bool bl = _isCk(1); |
| | | if (bl) return; |
| | | if (btnJianYanClick != null) |
| | | btnJianYanClick(this, e); |
| | | else |
| | | return; |
| | | } |
| | | private void BtnShouJian_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnShouJianClick != null) |
| | |
| | | |
| | | private void BtnOut_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (string.IsNullOrEmpty(this.xlsOutParameter)) |
| | | { |
| | | ToolBox.MsgHelper.ShowError("没有指定导出存储过程,请联系开发人员获取支持!"); |
| | | return; |
| | | } |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | | folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | if (dialogResult == DialogResult.OK) |
| | | { |
| | | string _folder = folderBrowserDialog.SelectedPath; |
| | | var _obj = new Gs.DevApp.Entity.XlsOutModel(this.xlsOutParameter); |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | string _file = _rtn.rtnData.fileUrl.ToString(); |
| | | string _folderName = _folder + "\\" + _file.Replace("down/", ""); |
| | | string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file; |
| | | using (WebClient client = new WebClient()) |
| | | { |
| | | client.DownloadFile(_url, _folderName); |
| | | } |
| | | ToolBox.MsgHelper.ShowInformation("导出成功!"); |
| | | } |
| | | else |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | if (btnOutClick != null) btnOutClick(this, e); |
| | | |
| | | //if (string.IsNullOrEmpty(this.xlsOutParameter)) |
| | | //{ |
| | | // ToolBox.MsgHelper.ShowError("没有指定导出存储过程,请联系开发人员获取支持!"); |
| | | // return; |
| | | //} |
| | | //using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | //{ |
| | | // folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | // DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | // if (dialogResult == DialogResult.OK) |
| | | // { |
| | | // string _folder = folderBrowserDialog.SelectedPath; |
| | | // var _obj = new Gs.DevApp.Entity.XlsOutModel(this.xlsOutParameter); |
| | | // try |
| | | // { |
| | | // string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView", JsonConvert.SerializeObject(_obj)); |
| | | // ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | // if (_rtn.rtnCode > 0) |
| | | // { |
| | | // string _file = _rtn.rtnData.fileUrl.ToString(); |
| | | // string _folderName = _folder + "\\" + _file.Replace("down/", ""); |
| | | // string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file; |
| | | // using (WebClient client = new WebClient()) |
| | | // { |
| | | // client.DownloadFile(_url, _folderName); |
| | | // } |
| | | // ToolBox.MsgHelper.ShowInformation("导出成功!"); |
| | | // } |
| | | // else |
| | | // { |
| | | // ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | // } |
| | | // } |
| | | //} |
| | | } |
| | | |
| | | private void BtnReport_ItemClick(object sender, ItemClickEventArgs e) |
| | |
| | | if (btnQueryClick != null) btnQueryClick(this, e); |
| | | } |
| | | |
| | | private void BtnOa_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnOaClick != null) btnOaClick(this, e); |
| | | } |
| | | /// <summary> |
| | | /// 取消时,还原按钮可用性 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void BtnEsc_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (MsgHelper.AskQuestion("确定要要取消吗?")) |
| | |
| | | lst.Add(btnDesign.Name); |
| | | lst.Add(btnChk.Name); |
| | | lst.Add(btnFchk.Name); |
| | | lst.Add(btnJianYan.Name); |
| | | lst.Add(btnFjianYan.Name); |
| | | lst.Add(btnOut.Name); |
| | | lst.Add(btnIn.Name); |
| | | lst.Add(btnLog.Name); |
| | | lst.Add(btnPiZhun.Name); |
| | | lst.Add(btnFPiZhun.Name); |
| | | lst.Add(btnHelp.Name); |
| | | lst.Add(btnLayout.Name); |
| | | lst.Add(btnFont.Name); |
| | | lst.Add(btnBoHui.Name); |
| | | lst.Add(btnTzbl.Name); |
| | | lst.Add(btnKg.Name); |
| | | lst.Add(btnWg.Name); |
| | | lst.Add(btnZhongTai.Name); |
| | | lst.Add(btnCaiWuChk.Name); |
| | | lst.Add(btnCaiWuFchk.Name); |
| | | lst.Add(btnCaiGouChk.Name); |
| | | lst.Add(btnCaiGouFchk.Name); |
| | | lst.Add(btnShouHouChk.Name); |
| | | lst.Add(btnShouHouFchk.Name); |
| | | _enabledBtn(lst); |
| | | this.currentAction = "esc"; |
| | | if (btnEscClick != null) btnEscClick(this, e); |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 保存成功后,还原按钮可用性 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void BtnSave_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (btnSaveClick != null) |
| | |
| | | var lst = new List<string>(); |
| | | 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(btnFPiZhun.Name); |
| | | lst.Add(btnDesign.Name); |
| | | lst.Add(btnReport.Name); |
| | | lst.Add(btnKg.Name); |
| | |
| | | lst.Add(btnFont.Name); |
| | | lst.Add(btnLoad.Name); |
| | | lst.Add(btnTzbl.Name); |
| | | lst.Add(btnZhongTai.Name); |
| | | lst.Add(btnCaiWuChk.Name); |
| | | lst.Add(btnCaiWuFchk.Name); |
| | | lst.Add(btnCaiGouChk.Name); |
| | | lst.Add(btnCaiGouFchk.Name); |
| | | lst.Add(btnShouHouChk.Name); |
| | | lst.Add(btnShouHouFchk.Name); |
| | | _enabledBtn(lst); |
| | | } |
| | | |
| | |
| | | lst.Add(btnHelp.Name); |
| | | lst.Add(btnLayout.Name); |
| | | lst.Add(btnFont.Name); |
| | | lst.Add(btnFont.Name); |
| | | lst.Add(btnLog.Name); |
| | | _enabledBtn(lst); |
| | | this.currentAction = "edit"; |
| | | if (btnEdtClick != null) btnEdtClick(this, e); |
| | |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var dd = UtilityHelper.ReturnToList(strReturn); |
| | | var dt = dd.rtnData; |
| | | |
| | | if (!string.IsNullOrEmpty(defaultActions) && defaultActions.Contains("查询")) |
| | | { |
| | | if (dt == null || dt.Rows.Count <= 0) |
| | |
| | | /// </summary> |
| | | public event EventHandler btnPiZhunClick; |
| | | |
| | | /// <summary> |
| | | /// 批准 |
| | | /// </summary> |
| | | public event EventHandler btnFPiZhunClick; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 日志 |
| | |
| | | /// </summary> |
| | | public event EventHandler btnOaClick; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 导出 |
| | | /// </summary> |
| | | public event EventHandler btnOutClick; |
| | | |
| | | #endregion |
| | | |
| | | #region 公共属性 |