| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.Data.SqlTypes; |
| | | using System.Net; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | toolBarMenu1.btnBaoGaoClick += ToolBarMenu1_btnBaoGaoClick; |
| | | toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1, tips); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnOutClick(object sender, EventArgs e) |
| | | { |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | | folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and daa.erp_sczz in"); |
| | | _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); |
| | | _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); |
| | | if (dialogResult == DialogResult.OK) |
| | | { |
| | | string _folder = folderBrowserDialog.SelectedPath; |
| | | var _params = new |
| | | { |
| | | inSortName = "", |
| | | inSortOrder = "", |
| | | inQueryWhere = _sbSqlWhere.ToString() |
| | | }; |
| | | var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_fqclst", "", "", "", _params); |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick; |
| | | toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1, tips); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); |
| | |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnOutClick(object sender, EventArgs e) |
| | | { |
| | | |
| | | var frm = new SelOutType(); |
| | | var type = 0; |
| | | //赋值给明细表 |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | var lst = new List<string>(); |
| | | lst = ee.StringList; |
| | | if (!string.IsNullOrEmpty(lst[0])) |
| | | { |
| | | if (lst[0] == "列表导出") |
| | | { |
| | | type = 1; |
| | | } |
| | | else if (lst[0] == "明细导出") |
| | | { |
| | | type = 2; |
| | | } |
| | | } |
| | | }; |
| | | frm.ShowDialog(); |
| | | if (type == 1) |
| | | { |
| | | LstOutput(); |
| | | } |
| | | if (type == 2) |
| | | { |
| | | MxOutput(); |
| | | } |
| | | } |
| | | |
| | | private void MxOutput() |
| | | { |
| | | string rowGuid = "", rowName = ""; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_releaseNo, gridView1, "releaseNo"); |
| | |
| | | } |
| | | } |
| | | |
| | | private void LstOutput() |
| | | { |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | | folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and a.ReceiveOrgId in"); |
| | | _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); |
| | | _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); |
| | | if (dialogResult == DialogResult.OK) |
| | | { |
| | | string _folder = folderBrowserDialog.SelectedPath; |
| | | var _params = new |
| | | { |
| | | inSortName = "", |
| | | inSortOrder = "", |
| | | inQueryWhere = _sbSqlWhere.ToString() |
| | | }; |
| | | var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_iqcdetect01lst", "", "", "", _params); |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 刷新事件 |
| | | /// </summary> |
| | |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.Net; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | InitializeComponent(); |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "", "", (value) => |
| | | { |
| | |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnOutClick(object sender, EventArgs e) |
| | | { |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | | folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | if (dialogResult == DialogResult.OK) |
| | | { |
| | | string _folder = folderBrowserDialog.SelectedPath; |
| | | var _params = new |
| | | { |
| | | inSortName = "", |
| | | inSortOrder = "", |
| | | inQueryWhere = _sbSqlWhere.ToString() |
| | | }; |
| | | var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsout_WOTraceCodes", "", "", "", _params); |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using DevExpress.Utils; |
| | | using DevExpress.Pdf.Native.BouncyCastle.Asn1.X509; |
| | | using DevExpress.Utils; |
| | | using DevExpress.XtraGrid.Views.Grid.ViewInfo; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | |
| | | beginDate = dateEdit1.EditValue.ToString(), |
| | | endDate = dateEdit2.EditValue.ToString() |
| | | }; |
| | | var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_shjh","","","", _params); |
| | | var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_shjh", "", "", "", _params); |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", JsonConvert.SerializeObject(_obj)); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void btnBOMQuery_Click(object sender, EventArgs e) |
| | | { |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", _webServiceName + "GetErpBOM", ""); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | MsgHelper.ShowInformation("BOM数据更新成功"); |
| | | } |
| | | else |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |