kyy
6 天以前 598bef9098cd10744dba191bcb684af8cfac9a54
DevApp/Gs.DevApp/DevFrm/IPQC/Frm_XunJianDetect01.cs
@@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -119,49 +120,69 @@
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
        {
            var frm = new Frm_XunJianDetect01Show();
            frm.UpdateParent += (ss, ee) =>
            //是否检查无毕beg
            var dr = gridView1.GetFocusedDataRow();
            if (dr == null || string.IsNullOrEmpty(dr["guid"].ToString()))
            {
                string begDate = ee.StringSingle.Trim();
                using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            string strLotNo = dr["lotNo"].ToString();
            if (string.IsNullOrEmpty(strLotNo))
            {
                MsgHelper.ShowError("未开始检验,不能导出!");
                return;
            }
            //是否检查无毕end
            string rowGuid = "", rowName = "";
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_releaseNo, gridView1, "releaseNo");
            if (string.IsNullOrEmpty(rowGuid))
            {
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定导出吗?"))
                return;
            using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
            {
                folderBrowserDialog.Description = "选择导出文件的保存路径";
                DialogResult dialogResult = folderBrowserDialog.ShowDialog();
                if (dialogResult == DialogResult.OK)
                {
                    folderBrowserDialog.Description = "选择导出文件的保存路径";
                    DialogResult dialogResult = folderBrowserDialog.ShowDialog();
                    if (dialogResult == DialogResult.OK)
                    string _folder = folderBrowserDialog.SelectedPath;
                    var _obj = new
                    {
                        string _folder = folderBrowserDialog.SelectedPath;
                        var _obj = new
                        guid = rowGuid,
                    };
                    try
                    {
                        string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutXunJian", JsonConvert.SerializeObject(_obj));
                        ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                        if (_rtn.rtnCode > 0)
                        {
                            begDate = begDate,
                        };
                        try
                        {
                            string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutXunJian", 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())
                            {
                                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("导出成功!");
                                client.DownloadFile(_url, _folderName);
                            }
                            else
                            {
                                ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                            }
                            var frm = new Gs.DevApp.DevFrm.QC.Xls(_folderName);
                            frm.ShowDialog();
                        }
                        catch (Exception ex)
                        else
                        {
                            ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
                            ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                        }
                    }
                    catch (Exception ex)
                    {
                        ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
                    }
                }
            };
            frm.ShowDialog();
            }
        }
        /// <summary>
        /// 日志事件
@@ -206,8 +227,11 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            // _sbSqlWhere += " and isnull(fsubmit,0)=0";
            gcMain1.DataSource = null;
            System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
            _sbSqlWhere.Append(" and bm.FSubsidiary in");
            _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
            _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try