| | |
| | | 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; |
| | | |
| | |
| | | InitializeComponent(); |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | this.toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | | |
| | | // 设置gridView1参数,并添加行选择事件处理 |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "", "", null); |
| | | |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "", "", null, tips, true, null); |
| | | // 添加gridView1的行选择变化事件 |
| | | gridView1.FocusedRowChanged += GridView1_FocusedRowChanged; |
| | | |
| | | // 设置gridView2参数 |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gridView2); |
| | | |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => |
| | | { |
| | | }, (value) => |
| | |
| | | { |
| | | daa001 = workOrderNo |
| | | }; |
| | | |
| | | string json = JsonConvert.SerializeObject(requestObj); |
| | | |
| | | // 调用后台接口获取明细数据 |
| | |
| | | /// <param name="pageSize">每页几条</param> |
| | | private void getPageList(int curPage) |
| | | { |
| | | gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | gcMain1.DataSource = null; |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and a.ERP_SCZZ in"); |
| | | _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); |
| | | _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.INDEP_DATE", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 导出 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnOutClick(object sender, EventArgs e) |
| | | { |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and a.ERP_SCZZ in"); |
| | | _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); |
| | | _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | | folderBrowserDialog.Description = "选择导出文件的保存路径"; |
| | | DialogResult dialogResult = folderBrowserDialog.ShowDialog(); |
| | | if (dialogResult == DialogResult.OK) |
| | | { |
| | | string _folder = folderBrowserDialog.SelectedPath; |
| | | var _params = new |
| | | { |
| | | inQueryWhere = _sbSqlWhere.ToString(), |
| | | inFid = "", |
| | | inP1 = "", |
| | | inP2 = "", |
| | | inP3 = "", |
| | | inP4 = "" |
| | | }; |
| | | var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_CPMX", "", "", "", _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); |
| | | } |
| | | var frm = new Gs.DevApp.DevFrm.QC.Xls(_folderName); |
| | | frm.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |