新增末道工序出站汇报单列表模块;不良明细良率报表获取数据方法修改
4个文件已修改
3个文件已添加
1个文件已删除
5806 ■■■■■ 已修改文件
DAL/仓库管理/ClsKf_ProductInBill.cs 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LMES/ClsShowMod.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LMES/bin/x86/Debug.zip 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/WorkM.csproj 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/报表分析/DefectiveDetailedYieldReport.cs 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/流转卡管理/MES_StationOutBillList_LastProc.cs 781 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/流转卡管理/MES_StationOutBillList_LastProc.designer.cs 606 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/流转卡管理/MES_StationOutBillList_LastProc.resx 4101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/²Ö¿â¹ÜÀí/ClsKf_ProductInBill.cs
@@ -579,6 +579,143 @@
        }
        //末道工序出站汇报单列表   å…¥åº“功能调用
        public bool AddBill_StationOut_LastProc(string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg)
        {
            try
            {
                DataSet Ds;
                if (oSystemParameterMain.WMS_CampanyName == "杭州智见" || oSystemParameterMain.WMS_CampanyName == "杭州斯莫尔") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                }
                else
                {
                    oCn.BeginTran();
                }
                //生成出入库单据
                //插入子表
                DataSet DS2 = oCn.RunProcReturn("EXEC h_p_Kf_ProductInBillSub_Insert_StationOutLastProc " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + sHSourceType + "'", "h_p_Kf_ProductInBillSub_Insert_StationOutLastProc");
                if (DS2 == null || DS2.Tables[0].Rows.Count == 0)
                {
                    sErrMsg = "判断写入子表状态失败,未知错误!";
                    if (oSystemParameterMain.WMS_CampanyName == "杭州智见" || oSystemParameterMain.WMS_CampanyName == "杭州斯莫尔") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                    {
                    }
                    else
                    {
                        oCn.RollBack();
                    }
                    return false;
                }
                else
                {
                    if (DBUtility.ClsPub.isStrNull(DS2.Tables[0].Rows[0][0]) != "OK")
                    {
                        sErrMsg = "单据号:" + omodel.HBillNo + ",写入子表失败!";
                        return false;
                    }
                }
                //插入主表
                oCn.RunProc("Insert Into Kf_ICStockBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
                ") " +
                " values('1202','1202'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "',convert(varchar(10),getdate(),120),'" + omodel.HMainSourceBillType + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',convert(varchar(10),getdate(),120)" +
                ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() +
                ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) +
                ") ");
                //新增K3子表、主表
                oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_Insert_New " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillerID.ToString() + ",'" + sHSourceType + "'");
                //更新关联数量
                if (sHSourceType == "3710")         //生产任务单
                {
                    oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOToProductIn_Add " + omodel.HInterID.ToString());
                    //回填K3关联数量
                    oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_UpdateBillRelateData_ICMO_New " + omodel.HInterID.ToString());
                }
                else    //无源单
                {
                    //回填K3关联数量
                    oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_UpdateBillRelateData_New " + omodel.HInterID.ToString());
                }
                //判断库存更新控制状态(0为审核改变库存,1为保存改变库存)
                DataSet DS = oCn.RunProcReturn("exec h_p_IFK3_SaveUpdateStock ", "h_p_IFK3_SaveUpdateStock");
                if (DS == null || DS.Tables[1].Rows.Count == 0)
                {
                    sErrMsg = "判断库存更新控制状态,未知错误!";
                    if (oSystemParameterMain.WMS_CampanyName == "杭州智见" || oSystemParameterMain.WMS_CampanyName == "杭州斯莫尔") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                    {
                    }
                    else
                    {
                        oCn.RollBack();
                    }
                    return false;
                }
                else
                {
                    if (DBUtility.ClsPub.isLong(DS.Tables[1].Rows[0][0]) == 1)
                    {
                        //更新K3库存
                        oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_UpdateStock_New " + omodel.HInterID.ToString());
                        oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_UpdateOrderStock_New " + omodel.HInterID.ToString());
                        //审核单据
                        if (oSystemParameterMain.Kf_ProductInBill_AutoCheck == "Y") //系统参数  è‡ªåŠ¨å®¡æ ¸
                        {
                            //审核单据
                            oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + omodel.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + omodel.HInterID.ToString());
                            //审核K3单据
                            oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_Check_New " + omodel.HInterID.ToString() + "," + omodel.HBillerID.ToString());
                        }
                    }
                    else
                    {
                        //审核单据
                        if (oSystemParameterMain.Kf_ProductInBill_AutoCheck == "Y") //系统参数  è‡ªåŠ¨å®¡æ ¸
                        {
                            //审核单据
                            oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + omodel.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + omodel.HInterID.ToString());
                            //审核K3单据
                            oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_Check_New " + omodel.HInterID.ToString() + "," + omodel.HBillerID.ToString());
                            //更新K3库存
                            oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_UpdateStock_New " + omodel.HInterID.ToString());
                            oCn.RunProc("exec h_p_IFK3_ToERP_ProductInBill_UpdateOrderStock_New " + omodel.HInterID.ToString());
                        }
                    }
                }
                sErrMsg = "新增单据成功!";
                if (oSystemParameterMain.WMS_CampanyName == "杭州智见" || oSystemParameterMain.WMS_CampanyName == "杭州斯莫尔") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                }
                else
                {
                    oCn.Commit();
                }
                return true;
            }
            catch (Exception e)
            {
                sErrMsg = "生成产品入库单失败!" + e.Message;
                if (oSystemParameterMain.WMS_CampanyName == "杭州智见" || oSystemParameterMain.WMS_CampanyName == "杭州斯莫尔") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                {
                }
                else
                {
                    oCn.RollBack();
                }
                return false;
            }
        }
    }
LMES/ClsShowMod.cs
@@ -5271,6 +5271,13 @@
                        oMES_StationOutBillList_Bad.Show();
                        oMainForm.AddTabPage(oMES_StationOutBillList_Bad);
                        break;
                    case "mes_stationoutbilllist_lastproc":
                        MES_StationOutBillList_LastProc oMES_StationOutBillList_LastProc = new MES_StationOutBillList_LastProc();
                        oMES_StationOutBillList_LastProc.MdiParent = oMain;
                        oMES_StationOutBillList_LastProc.ModCaption = gnmc;
                        oMES_StationOutBillList_LastProc.Show();
                        oMainForm.AddTabPage(oMES_StationOutBillList_LastProc);
                        break;
                    case "sc_prodwiptotalreport":
                        Sc_ProdWIPTotalReport oSc_ProdWIPTotalReport = new Sc_ProdWIPTotalReport();
                        oSc_ProdWIPTotalReport.MdiParent = oMain;
LMES/bin/x86/Debug.zip
Binary files differ
WorkM/WorkM.csproj
@@ -413,6 +413,12 @@
    <Compile Include="流转卡管理\MES_StationOutBill.designer.cs">
      <DependentUpon>MES_StationOutBill.cs</DependentUpon>
    </Compile>
    <Compile Include="流转卡管理\MES_StationOutBillList_LastProc.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="流转卡管理\MES_StationOutBillList_LastProc.designer.cs">
      <DependentUpon>MES_StationOutBillList_LastProc.cs</DependentUpon>
    </Compile>
    <Compile Include="流转卡管理\MES_StationOutBillList_BaoFei.cs">
      <SubType>Form</SubType>
    </Compile>
@@ -1094,6 +1100,10 @@
      <DependentUpon>MES_StationOutBill.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="流转卡管理\MES_StationOutBillList_LastProc.resx">
      <DependentUpon>MES_StationOutBillList_LastProc.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="流转卡管理\MES_StationOutBillList_BaoFei.resx">
      <DependentUpon>MES_StationOutBillList_BaoFei.cs</DependentUpon>
      <SubType>Designer</SubType>
WorkM/±¨±í·ÖÎö/DefectiveDetailedYieldReport.cs
@@ -137,93 +137,93 @@
        {
            SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
            DataSet DSet = new DataSet();
            ////过滤条件Dlg
            //string sDlgWhere = "";
            //if (txtHProcessExchangeBillNo.Text != "")//流转卡
            //{
            //    sDlgWhere = sDlgWhere + "and c.HProcExchBillNo like '%" + txtHProcessExchangeBillNo.Text + "%'";
            //}
            //if (txtHICMOBillNo.Text != "")//生产订单
            //{
            //    sDlgWhere = sDlgWhere + "and a.HICMOBillNo like '%" + txtHICMOBillNo.Text + "%'";
            //}
            //if (textHmaterName.Text != "")//物料
            //{
            //    sDlgWhere = sDlgWhere + "and b.HName like '%" + textHmaterName.Text + "%'";
            //}
            //if (textHprocName.Text != "")//工序
            //{
            //    sDlgWhere = sDlgWhere + "and d.HName like '%" + textHprocName.Text + "%'";
            //}
            //if (dtpHBDate.Value.ToShortDateString() != "")//开始日期
            //{
            //    sDlgWhere = sDlgWhere + "and a.HMakeDate >= '" + dtpHBDate.Value.ToShortDateString() + "'";
            //}
            //if (dtpHEDate.Value.ToShortDateString() != "")//结束日期
            //{
            //    sDlgWhere = sDlgWhere + "and a.HMakeDate <= '" + dtpHEDate.Value.ToShortDateString() + "'";
            //}
            ////过滤条件
            ////string sWhere = "";
            ////sWhere = sWhere + ",'" + this.dtpHBDate.Value.ToShortDateString() + "'";
            ////sWhere = sWhere + ",'" + this.dtpHEDate.Value.ToShortDateString() + "'";
            ////sWhere = sWhere + ",1,3";
            //////sWhere = sWhere + ",'" + frmQuery.dtpHBakEndDate.Value.ToShortDateString() + "'";
            //////sWhere = sWhere + "," + frmQuery.txtHCusID.Tag.ToString().Trim();
            ////if (sWhere.Trim().Length > 0)
            ////{
            ////    sWhere = sWhere.Substring(1, sWhere.Length - 1);
            ////}
            ////
            //DSet = SubCn.RunProcReturn("select " +
            //    "MAX(a.HMakeDate) æ±‡æŠ¥æ—¥æœŸ, a.HICMOBillNo ä»»åŠ¡å•å·, c.HProcExchBillNo æµè½¬å¡å·, c.HProcID, d.HName å·¥åºåç§°" +
            //    ", sum(a.HWorkTimes) å·¥æ—¶, b.HName ç‰©æ–™åç§°, a.HICMOQty ç”Ÿäº§è®¢å•数量, a.HPlanQty è®¡åˆ’数量, c.HQty è¿›ç«™æ•°é‡" +
            //    ", co.HQty å‡ºç«™åˆæ ¼æ•°é‡, c.HQty - co.HQty - co.HWasterQty æœªè¿›ç«™æ•°é‡" +
            //    ", co.HWasterQty ä¸åˆæ ¼æ•°é‡, co.HQty /  nullif((co.HQty+co.HWasterQty),0) å‡ºç«™è‰¯çއ,a.hb, co.HName ä¸è‰¯æ˜Žç»†, co.HBadQty ä¸è‰¯æ•°é‡ " +
            //    " FROM Sc_StationOutBillMain a " +
            //    "left join Gy_Material  b on a.HMaterID = b.HItemID " +
            //    "left join( " +
            //    "select sum(aa.HQty) HQty, aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " +
            //    "from Sc_StationInBillMain aa " +
            //    "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " +
            //    ") c on a.HProcExchInterID = c.HProcExchInterID and a.HProcID = c.HProcID " +
            //    "left join( " +
            //    "select sum(aa.HQty) HQty, sum(aa.HWasterQty) HWasterQty, bad.HBadQty, bad.HName" +
            //    ", aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " +
            //    "from Sc_StationOutBillMain aa " +
            //    "left join ( " +
            //    "select qa.HProcExchInterID, qb.HBadQty, qbr.HName, qa.HProcID " +
            //    "from QC_NoPassProdCheckBillMain qa " +
            //    "left join QC_NoPassProdCheckBillsub qb on qa.HInterID = qb.HInterID " +
            //    "left join Gy_BadReason qbr on qb.HBadReasonID = qbr.HItemID " +
            //    "group by qa.HProcExchInterID, qbr.HName, qa.HProcID, qb.HBadQty " +
            //    ") bad on aa.HProcExchInterID = bad.HProcExchInterID and aa.HProcID = bad.HProcID " +
            //    "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID, bad.HBadQty, bad.HName " +
            //    ") co on a.HProcExchInterID = co.HProcExchInterID and a.HProcID = co.HProcID " +
            //    "left join Gy_Process d on c.HProcID = d.HItemID " +
            //    "where 1 = 1 " + sDlgWhere +
            //    "group by a.HICMOBillNo,c.HProcExchBillNo,d.HName,b.HName,a.HICMOQty,c.HQty,a.HPlanQty" +
            //    ",co.HQty,c.HProcID,co.HWasterQty,co.HName,co.HBadQty,a.HWasterQty " +
            //    "order by c.HProcID", "Sc_StationOutBillMain", ref ClsPub.sExeReturnInfo);
            //过滤条件Dlg
            string sDlgWhere = "";
            sDlgWhere = sDlgWhere + ",'" + txtHProcessExchangeBillNo.Text + "'";
            sDlgWhere = sDlgWhere + ",'" + txtHICMOBillNo.Text + "'";
            sDlgWhere = sDlgWhere + ",'" + textHmaterName.Text + "'";
            sDlgWhere = sDlgWhere + ",'" + textHprocName.Text + "'";
            sDlgWhere = sDlgWhere + ",'" + dtpHBDate.Value.ToShortDateString() + "'";
            sDlgWhere = sDlgWhere + ",'" + dtpHEDate.Value.ToShortDateString() + "'";
            if (sDlgWhere.Trim().Length > 0)
            if (txtHProcessExchangeBillNo.Text != "")//流转卡
            {
                sDlgWhere = sDlgWhere.Substring(1, sDlgWhere.Length - 1);
                sDlgWhere = sDlgWhere + "and c.HProcExchBillNo like '%" + txtHProcessExchangeBillNo.Text + "%'";
            }
            if (txtHICMOBillNo.Text != "")//生产订单
            {
                sDlgWhere = sDlgWhere + "and a.HICMOBillNo like '%" + txtHICMOBillNo.Text + "%'";
            }
            if (textHmaterName.Text != "")//物料
            {
                sDlgWhere = sDlgWhere + "and b.HName like '%" + textHmaterName.Text + "%'";
            }
            if (textHprocName.Text != "")//工序
            {
                sDlgWhere = sDlgWhere + "and d.HName like '%" + textHprocName.Text + "%'";
            }
            if (dtpHBDate.Value.ToShortDateString() != "")//开始日期
            {
                sDlgWhere = sDlgWhere + "and a.HMakeDate >= '" + dtpHBDate.Value.ToShortDateString() + "'";
            }
            if (dtpHEDate.Value.ToShortDateString() != "")//结束日期
            {
                sDlgWhere = sDlgWhere + "and a.HMakeDate <= '" + dtpHEDate.Value.ToShortDateString() + "'";
            }
            //过滤条件
            //string sWhere = "";
            //sWhere = sWhere + ",'" + this.dtpHBDate.Value.ToShortDateString() + "'";
            //sWhere = sWhere + ",'" + this.dtpHEDate.Value.ToShortDateString() + "'";
            //sWhere = sWhere + ",1,3";
            ////sWhere = sWhere + ",'" + frmQuery.dtpHBakEndDate.Value.ToShortDateString() + "'";
            ////sWhere = sWhere + "," + frmQuery.txtHCusID.Tag.ToString().Trim();
            //if (sWhere.Trim().Length > 0)
            //{
            //    sWhere = sWhere.Substring(1, sWhere.Length - 1);
            //}
            //
            DSet = SubCn.RunProcReturn("select " +
                "MAX(a.HMakeDate) æ±‡æŠ¥æ—¥æœŸ, a.HICMOBillNo ä»»åŠ¡å•å·, c.HProcExchBillNo æµè½¬å¡å·, c.HProcID, d.HName å·¥åºåç§°" +
                ", sum(a.HWorkTimes) å·¥æ—¶, b.HName ç‰©æ–™åç§°, a.HICMOQty ç”Ÿäº§è®¢å•数量, a.HPlanQty è®¡åˆ’数量, c.HQty è¿›ç«™æ•°é‡" +
                ", co.HQty å‡ºç«™åˆæ ¼æ•°é‡, c.HQty - co.HQty - co.HWasterQty æœªè¿›ç«™æ•°é‡" +
                ", co.HWasterQty ä¸åˆæ ¼æ•°é‡, co.HQty /  nullif((co.HQty+co.HWasterQty),0) å‡ºç«™è‰¯çއ,co.HBillSubType ä¸šåŠ¡ç±»åž‹, co.HName ä¸è‰¯æ˜Žç»†, co.HBadQty ä¸è‰¯æ•°é‡ " +
                " FROM Sc_StationOutBillMain a " +
                "left join Gy_Material  b on a.HMaterID = b.HItemID " +
                "left join( " +
                "select sum(aa.HQty) HQty, aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " +
                "from Sc_StationInBillMain aa " +
                "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " +
                ") c on a.HProcExchInterID = c.HProcExchInterID and a.HProcID = c.HProcID " +
                "left join( " +
                "select sum(aa.HQty) HQty, sum(aa.HWasterQty) HWasterQty, bad.HBadQty, bad.HName" +
                ", aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID,bad.HBillSubType " +
                "from Sc_StationOutBillMain aa " +
                "left join ( " +
                "select qa.HProcExchInterID, qb.HBadQty, qbr.HName, qa.HProcID,qa.HBillSubType " +
                "from QC_NoPassProdCheckBillMain qa " +
                "left join QC_NoPassProdCheckBillsub qb on qa.HInterID = qb.HInterID " +
                "left join Gy_BadReason qbr on qb.HBadReasonID = qbr.HItemID " +
                "group by qa.HProcExchInterID, qbr.HName, qa.HProcID, qb.HBadQty,qa.HBillSubType " +
                ") bad on aa.HProcExchInterID = bad.HProcExchInterID and aa.HProcID = bad.HProcID " +
                "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID, bad.HBadQty, bad.HName,bad.HBillSubType " +
                ") co on a.HProcExchInterID = co.HProcExchInterID and a.HProcID = co.HProcID " +
                "left join Gy_Process d on c.HProcID = d.HItemID " +
                "where 1 = 1 " + sDlgWhere +
                "group by a.HICMOBillNo,c.HProcExchBillNo,d.HName,b.HName,a.HICMOQty,c.HQty,a.HPlanQty" +
                ",co.HQty,c.HProcID,co.HWasterQty,co.HName,co.HBadQty,a.HWasterQty,co.HBillSubType " +
                "order by c.HProcID", "Sc_StationOutBillMain", ref ClsPub.sExeReturnInfo);
            DSet = SubCn.RunProcReturn("exec h_p_DefectiveDetailedYieldReport_New " + sDlgWhere, "h_p_DefectiveDetailedYieldReport_New");
            ////过滤条件Dlg
            //string sDlgWhere = "";
            //sDlgWhere = sDlgWhere + ",'" + txtHProcessExchangeBillNo.Text + "'";
            //sDlgWhere = sDlgWhere + ",'" + txtHICMOBillNo.Text + "'";
            //sDlgWhere = sDlgWhere + ",'" + textHmaterName.Text + "'";
            //sDlgWhere = sDlgWhere + ",'" + textHprocName.Text + "'";
            //sDlgWhere = sDlgWhere + ",'" + dtpHBDate.Value.ToShortDateString() + "'";
            //sDlgWhere = sDlgWhere + ",'" + dtpHEDate.Value.ToShortDateString() + "'";
            //if (sDlgWhere.Trim().Length > 0)
            //{
            //    sDlgWhere = sDlgWhere.Substring(1, sDlgWhere.Length - 1);
            //}
            //DSet = SubCn.RunProcReturn("exec h_p_DefectiveDetailedYieldReport_New " + sDlgWhere, "h_p_DefectiveDetailedYieldReport_New");
            //生成首行标题
            if (DSet == null)
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationOutBillList_LastProc.cs
New file
@@ -0,0 +1,781 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using gregn6Lib;
using SQLHelper;
using DBUtility;
using System.IO;
using System.Reflection;
namespace WorkM
{
    public partial class MES_StationOutBillList_LastProc : Form
    {
        public MES_StationOutBillList_LastProc()
        {
            InitializeComponent();
        }
        public DBUtility.frmBillQueryCondition_New frmCondition;
        public string ViewName = "h_v_MES_StationOutBillList_LastProc";
        public string ModCaption = "末道工序出站汇报单列表";
        public const string ModName = "3791";
        public const string ModRightName = "MES_StationOutBill";
        public const string ModRightNameEdit = ModRightName + "_Edit";
        public const string ModRightNameCheck = ModRightName + "_Check";
        public const string ModRightNameClose = ModRightName + "_Close";
        public const string ModRightNameDelete = ModRightName + "_Delete";
        DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
        public MES_StationOutBill oFrm;
        Pub_Class.ClsGridListSum oSumGrid = new Pub_Class.ClsGridListSum();
        public string sDlgWhere = "";  //外窗体递入
        #region  å›ºå®šä»£ç 
        private void MES_StationOutBillList_LastProc_Load(object sender, EventArgs e)
        {
            frmCondition = new frmBillQueryCondition_New();
            this.Text = ModCaption;
            lblCaption.Text = ModCaption;
            oSumGrid.ogrdMain = grdMain;  //初始化 new
            oSumGrid.oGridsum = grdSum;
            initGrid();
        }
        private void initGrid()
        {
            DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name);
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            cmbHStatus.Text = "全部";
            timer1.Enabled = false;
            initGrid();
            Display();
        }
        private void timer2_Tick(object sender, EventArgs e)
        {
            timer2.Enabled = false;
            frmCondition = new frmBillQueryCondition_New();
            SetCondition(frmCondition, ViewName, this.Name);
            frmCondition.ShowDialog();
            if (frmCondition.Tag.ToString() == "OK")
            {
                timer1.Enabled = true;
            }
        }
        public void SetCondition(frmBillQueryCondition_New frmCondition, string ViewName, string Name)
        {
            frmCondition.Tag = "";
            frmCondition.ViewName = ViewName;
            frmCondition.ModName = Name;
        }
        //释放鼠标按钮发生
        private void grdMain_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e)
        {
            //Total();
        }
        //合计 new
        private void grdMain_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
        {
            Total();
        }
        //双击列表选中行
        private void grdMain_DblClick(object sender, EventArgs e)
        {
            Sub_ShowBill();
        }
        private void grdMain_Paint(object sender, PaintEventArgs e)
        {
            GraphicsGrid();
        }
        private void GraphicsGrid()
        {
            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain);
        }
        private void grdMain_Scroll(object sender, ScrollEventArgs e)
        {
            if (e.ScrollOrientation == ScrollOrientation.HorizontalScroll)
            {
                Total();
            }
        }
        //得到对应列
        private Int32 Fun_GetCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain);
        }
        //保存列宽
        private void bclk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
        }
        //默认列宽
        private void mrlk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
        }
        #endregion
        #region  æŸ¥è¯¢åŠŸèƒ½
        private void cx_Click(object sender, EventArgs e)
        {
            frmCondition = new frmBillQueryCondition_New();
            SetCondition(frmCondition, ViewName, this.Name);
            frmCondition.ShowDialog();
            if (frmCondition.Tag.ToString() == "OK")
            {
                Display();
            }
        }
        private void Display()
        {
            ClsCN SubCn = new ClsCN();
            DataSet DSet;
            string sSql = "";
            string sWhere = "";
            bzd.Enabled = true;
            if (frmCondition.SqlStr.Trim().Length == 0)
            {
                sSql = "Select top 5000 * from " + ViewName + " Where 1=1 " + sWhere + sDlgWhere + " order by hmainid desc ";
            }
            else
            {
                sSql = frmCondition.SqlStr + sWhere + sDlgWhere + " order by hmainid desc ";
            }
            //
            DSet = SubCn.RunProcReturn(sSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo);
            //生成首行标题
            if (DSet == null)
            {
                MessageBox.Show("没有返回任何结果,请在过滤框中点击【恢复】按钮,尝试再次查询!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            //释放冻结
            DBUtility.Xt_BaseBillFun.CancelFrozenCol(grdMain);
            //
            grdMain.DataSource = DSet.Tables[0].DefaultView;
            //设置合计列
            string sTotalCol = "";
            sTotalCol = DBUtility.Gy_BaseFun.GetTotalCols(DSet);
            string[] sT;
            sT = sTotalCol.Split(Convert.ToChar(","));
            oSumGrid.BuildTotalCols(sT);
            //
            //冻结
            int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
            string s = frmCondition.cmbHComplete.Text;
            DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol);
            //画线
            GraphLine();
            Total();
        }
        private void GraphLine()
        {
            int MainIDCol = Fun_GetCol("hmainid");
            int SubIDCol = Fun_GetCol("hsubid");
            string s = frmCondition.cmbHComplete.Text;
            long n = 0;
            DBUtility.Xt_BaseBillFun.GraphLine(grdMain, MainIDCol, SubIDCol, s, ref n);
            //显示
            lbldj.Text = "查询出 " + n.ToString() + " å¼ å•据";
            lbljl.Text = "共有 " + grdMain.RowCount.ToString() + " æ¡è®°å½•";
        }
        //合计 new
        private void Total()
        {
            if (grdMain.Rows.Count > 0 && grdMain.ColumnCount > 0)
            {
                oSumGrid.SetGridsum();
                //oSumGrid.Total();
                oSumGrid.TotalAll();
            }
        }
        #endregion
        #region  å¿«é€ŸæŸ¥è¯¢åŠŸèƒ½
        private void cmbHStatus_SelectedIndexChanged(object sender, EventArgs e)
        {
            Sub_FastQuery();
        }
        private void txtHBillNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Sub_FastQuery();
            }
        }
        //快速过滤
        private void Sub_FastQuery()
        {
            string sFastSQL = "";
            if (txtHBillNo.Text.Trim() != "")
            {
                sFastSQL = sFastSQL + " and å·¥åºæµè½¬å¡å· like '%" + txtHBillNo.Text + "%'";
            }
            //同步状态
            if (cmbHStatus.Text.Trim() == "未同步")
            {
                sFastSQL = sFastSQL + " and (同步状态='" + cmbHStatus.Text.Trim() + "'  ) ";
            }
            if (cmbHStatus.Text.Trim() == "已同步")
            {
                sFastSQL = sFastSQL + " and (同步状态='" + cmbHStatus.Text.Trim() + "'  ) ";
            }
            sDlgWhere = sFastSQL;
            Display();
        }
        #endregion
        #region  åˆ·æ–°åŠŸèƒ½
        private void sx_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }
        #endregion
        #region  å…¥åº“功能
        private void bzd_Click(object sender, EventArgs e)
        {
            //点击后入库按钮变灰
            bzd.Enabled = false;
            //根据选中的数据生成包装单
            int MainIDCol = Fun_GetCol("hmainid");
            int SubIDCol = Fun_GetCol("hsubid");
            int BillNoCol = Fun_GetCol("单据号");
            int HUserK3Col = Fun_GetCol("K3用户");
            int HKeepCol = Fun_GetCol("K3保管");
            int HSecManagerCol = Fun_GetCol("K3验收");
            int HDeptCol = Fun_GetCol("K3部门");
            DAL.ClsKf_ProductInBill oClsKf_ProductInBill;
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            //获取系统参数
            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
            if (oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo) == false)
            {
                MessageBox.Show("获取系统参数失败! " + DBUtility.ClsPub.sExeReturnInfo);
                bzd.Enabled = true;
                return;
            }
            //判断会计期是否合理
            string s = "";
            int sYear = 0;
            int sPeriod = 0;
            if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Today, ref sYear, ref sPeriod, ref s) == false)
            {
                MessageBox.Show("会计期间有错误! " + DBUtility.ClsPub.sExeReturnInfo);
                bzd.Enabled = true;
                return;
            }
            string sHInterID = "";
            for (int i = 0; i < grdMain.SelectedRows.Count; i++)
            {
                sHInterID = sHInterID + "," + DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
            }
            if (sHInterID == "")
            {
                MessageBox.Show("没有选中的单据明细行,请先选择要入库的单据!", "提示");
                bzd.Enabled = true;
                return;
            }
            else
            {
                DataSet DS = oCn.RunProcReturn("exec h_p_MES_StationOutBillList_LastProc_PreProductIn '" + sHInterID + "'", "h_p_MES_StationOutBillList_LastProc_PreProductIn", ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS == null || DS.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("入库前判断失败!", "提示");
                    bzd.Enabled = true;
                    return;
                }
                else
                {
                    if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
                    {
                        MessageBox.Show(DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]));
                        bzd.Enabled = true;
                        return;
                    }
                }
            }
            Int64 n = 0;
            //循环 é€‰ä¸­è¡Œ
            for (int i = 0; i < grdMain.SelectedRows.Count; i++)
            {
                oClsKf_ProductInBill = new DAL.ClsKf_ProductInBill();
                oClsKf_ProductInBill.omodel.HYear = sYear;
                oClsKf_ProductInBill.omodel.HPeriod = sPeriod;
                oClsKf_ProductInBill.omodel.HInterID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
                oClsKf_ProductInBill.omodel.HDate = DateTime.Today;
                oClsKf_ProductInBill.omodel.HBillNo = ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
                oClsKf_ProductInBill.omodel.HDeptID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HDeptCol].Value);
                oClsKf_ProductInBill.omodel.HEmpID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
                oClsKf_ProductInBill.omodel.HSecManagerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HSecManagerCol].Value);
                oClsKf_ProductInBill.omodel.HKeeperID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
                oClsKf_ProductInBill.omodel.HBillerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HUserK3Col].Value);
                oClsKf_ProductInBill.omodel.HRemark = "末道工序良品同步";
                oClsKf_ProductInBill.omodel.HMaker = DBUtility.ClsPub.CurUserName;
                oClsKf_ProductInBill.omodel.HWHID = 0;
                oClsKf_ProductInBill.omodel.HSupID = 0;
                oClsKf_ProductInBill.omodel.HExplanation = "";
                if (oClsKf_ProductInBill.omodel.HBillerID == 0 || oClsKf_ProductInBill.omodel.HKeeperID == 0
                    || oClsKf_ProductInBill.omodel.HEmpID == 0 || oClsKf_ProductInBill.omodel.HDeptID == 0
                    || oClsKf_ProductInBill.omodel.HSecManagerID == 0)
                {
                    MessageBox.Show("没有设置金蝶用户、部门、保管、验收员! " + DBUtility.ClsPub.sExeReturnInfo);
                    continue;
                }
                if (oClsKf_ProductInBill.AddBill_StationOut_LastProc("3710", oSystemParameter.omodel, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    n++;
                }
                else
                {
                    MessageBox.Show("同步单据失败!" + DBUtility.ClsPub.sExeReturnInfo);
                }
                //休眠5秒
                System.Threading.Thread.Sleep(2000);
                //
            }
            bzd.Enabled = true;
            //
            if (n > 0)
            {
                MessageBox.Show("同步单据完毕!一共有" + n.ToString() + "张入库单!");
                initGrid();
                Display();
            }
        }
        #endregion
        #region  æ–°å¢žåŠŸèƒ½
        private void xz_Click(object sender, EventArgs e)
        {
            MES_StationOutBill oMES_StationOutBill = new MES_StationOutBill();
            oMES_StationOutBill.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            oMES_StationOutBill.ModCaption = "工序出站汇报单";
            oMES_StationOutBill.ShowDialog();
        }
        #endregion
        #region  å•据功能
        private void dj_Click(object sender, EventArgs e)
        {
            Sub_ShowBill();
        }
        //显示单据
        private void Sub_ShowBill()
        {
            Int64 lngBillKey = 0;
            if (grdMain.CurrentRow == null)
                return;
            lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value);
            if (lngBillKey == 0)
                return;
            DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                oFrm = new MES_StationOutBill();
                oFrm.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View;
                oFrm.BillOld = oBill;
                oFrm.ShowDialog();
                if (oFrm.BillChange)
                {
                    if (MessageBox.Show("单据列表已经发生变化,是否刷新", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    {
                        timer1.Enabled = true;
                    }
                }
            }
            else
            {
                MessageBox.Show("单据未找到", "提示");
            }
            oBill = null;
        }
        #endregion
        #region  åˆ é™¤åŠŸèƒ½
        private void sc_Click(object sender, EventArgs e)
        {
            Sub_DeleteBill();
        }
        //删除
        private void Sub_DeleteBill()
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
            {
                return;
            }
            //
            Int64 lngBillKey = 0;
            if (grdMain.CurrentRow == null)
                return;
            lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value);
            if (lngBillKey == 0)
                return;
            DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                if (MessageBox.Show("确定要删除当前单据?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    if (oBill.omodel.HMaker != ClsPub.CurUserName && (ClsPub.CurUserName != "admin" && ClsPub.CurUserName != "Admin"))
                    {
                        MessageBox.Show("只能删除本人的单据!", "提示");
                        return;
                    }
                    string c = "";
                    SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                    DataSet ds;
                    //判断生产订单是否已结案,要求计划手工反结案  åˆ¤æ–­æ˜¯å¦å­˜åœ¨ ç›¸åŒå•据号 çš„入库单 , ä¸‹é“工序是否进站
                    ds = oCn.RunProcReturn("exec h_p_MES_StationOutBill_DelCtrl  '" + oBill.omodel.HBillNo + "'", "h_p_MES_StationOutBill_DelCtrl");
                    if (ds == null)
                    {
                        MessageBox.Show("判断关联失败!");
                        return;
                    }
                    if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
                    {
                        MessageBox.Show(Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]));
                        return;
                    }
                    //if (oBill.DeleteCheck(oBill.omodel.HInterID,"出站单", ref c) == false)
                    //{
                    //    MessageBox.Show(c, "提示");
                    //    return;
                    //}
                    //if (oBill.omodel.HChecker != "")
                    //{
                    //    MessageBox.Show("单据已经审核,不能删除!", "提示");
                    //    return;
                    //}
                    //if (!oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                    //写入删除日志
                    string WorkList = "删除出站单:" + oBill.omodel.HBillNo;
                    //BLL.ClsPub_BLL.System_Log_DropAdd(WorkList);
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
                        MessageBox.Show(DBUtility.ClsPub.sExeReturnInfo, "提示");
                        return;
                    }
                    else
                    {
                        Display();
                    }
                }
            }
            else
            {
                MessageBox.Show("单据未找到", "提示");
            }
        }
        #endregion
        #region  å®¡æ ¸åŠŸèƒ½
        private void sh_Click(object sender, EventArgs e)
        {
            this.Sub_CheckBill();
        }
        //审核单据
        private void Sub_CheckBill()
        {
            //审核权限
            if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName))
            {
                return;
            }
            //
            Int64 lngBillKey = 0;
            if (grdMain.CurrentRow == null)
                return;
            lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value);
            if (lngBillKey == 0)
                return;
            DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
            //查看是否已审核,关闭,作废
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                if (oBill.omodel.HChecker.Trim() != "")
                {
                    MessageBox.Show("单据已审核!不能再次审核", "提示");
                    return;
                }
            }
            else
            {
                MessageBox.Show("单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
                return;
            }
            //审核
            if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
            {
                MessageBox.Show("审核成功!", "提示");
                return;
            }
            else
            {
                MessageBox.Show("审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
                return;
            }
        }
        #endregion
        #region  åå®¡æ ¸åŠŸèƒ½
        private void qsh_Click(object sender, EventArgs e)
        {
            Sub_AbandonCheck();
        }
        //反审单据
        private void Sub_AbandonCheck()
        {
            //审核权限
            if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName))
            {
                return;
            }
            //
            Int64 lngBillKey = 0;
            if (grdMain.CurrentRow == null)
                return;
            lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value);
            if (lngBillKey == 0)
                return;
            DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
            //查看是否已审核,关闭,作废
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                if (oBill.omodel.HChecker.Trim() == "")
                {
                    MessageBox.Show("单据未审核!不需要反审核!", "提示");
                    return;
                }
            }
            else
            {
                MessageBox.Show("单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
                return;
            }
            //反审核
            if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
            {
                MessageBox.Show("反审核成功!", "提示");
                return;
            }
            else
            {
                MessageBox.Show("反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
                return;
            }
        }
        #endregion
        #region  é€€å‡ºåŠŸèƒ½
        private void tc_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion
        #region  æ‰“印功能
        GridppReport Report;
        //预览
        private void yl_Click(object sender, EventArgs e)
        {
            //选择打印模板
            BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
            oFrm.sBillName = ModName;
            oFrm.sBillModel = ModCaption;
            oFrm.ShowDialog();
            if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
            {
                Sub_SetReport(oFrm.sOpenTmp);
                Report.PrintPreview(true);
            }
        }
        private void Sub_SetReport(string sOpenTmp)
        {
            //判断行数
            for (int i = 0; i < grdMain.Rows.Count; i++)
            {
                grdMain.Rows[i].Cells[0].Value = "";
            }
            for (int i = 0; i < grdMain.SelectedRows.Count; i++)
            {
                grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[0].Value = "*";
            }
            Report = new GridppReport();
            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf");  //here .
            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
        }
        private void ReportFetchRecordByDataTable()
        {
            DataTable dt = new DataTable();
            BLL.Utility.FillRecordToReport_Sel(Report, grdMain, dt, Fun_GetCol("选择"));
        }
        #endregion
        #region  å¼•出功能
        //引出EXCEL
        private void dc_Click(object sender, EventArgs e)
        {
            //DBUtility.Gy_BaseFun.DataToExcel(this.Text, grdMain);
            DataGridViewToExcel2();
        }
        private void DataGridViewToExcel2()
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = "Execl文件(*.xls)|*.xls";
            saveFileDialog.FilterIndex = 0;
            saveFileDialog.RestoreDirectory = true;
            saveFileDialog.CreatePrompt = true;
            saveFileDialog.Title = "数据视图导出EXCEL文件";
            saveFileDialog.ShowDialog();
            if (saveFileDialog.FileName == "")
            {
                return;
            }
            Stream myStream;
            myStream = saveFileDialog.OpenFile();
            StreamWriter sw = new StreamWriter(myStream, System.Text.Encoding.GetEncoding("gb2312"));
            string str = "";
            DateTime start = DateTime.Now;
            try
            {
                //写标题
                for (int i = 0; i < grdMain.ColumnCount; i++)
                {
                    if (i > 0)
                    {
                        str += "\t";
                    }
                    str += grdMain.Columns[i].HeaderText;
                }
                sw.WriteLine(str);
                //写内容
                for (int j = 0; j < grdMain.Rows.Count; j++)
                {
                    string tempStr = "";
                    for (int k = 0; k < grdMain.Columns.Count; k++)
                    {
                        if (k > 0)
                        {
                            tempStr += "\t";
                        }
                        if (grdMain.Rows[j].Cells[k].Value == null)
                        {
                            tempStr += string.Empty;
                        }
                        else
                        {
                            tempStr += grdMain.Rows[j].Cells[k].Value.ToString();
                        }
                    }
                    sw.WriteLine(tempStr);
                }
                sw.Close();
                myStream.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sw.Close();
                myStream.Close();
            }
            MessageBox.Show("将此工作表导出为excel共耗时:" + DateTime.Now.Subtract(start).TotalMilliseconds.ToString() + "毫秒");
        }
        //EXCEL引出
        private void eXCELToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DBUtility.Gy_BaseFun.DataToExcel(this.Text, grdMain);
        }
        //CSV引出
        private void cSVToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DBUtility.Gy_BaseFun.DataGridViewToExcel2(grdMain, this.Text, this.Text);
        }
        #endregion
    }
}
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationOutBillList_LastProc.designer.cs
New file
@@ -0,0 +1,606 @@
namespace WorkM
{
    partial class MES_StationOutBillList_LastProc
    {
        /// <summary>
        /// å¿…需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// æ¸…理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows çª—体设计器生成的代码
        /// <summary>
        /// è®¾è®¡å™¨æ”¯æŒæ‰€éœ€çš„æ–¹æ³• - ä¸è¦
        /// ä½¿ç”¨ä»£ç ç¼–辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MES_StationOutBillList_LastProc));
            this.pPic = new System.Windows.Forms.Panel();
            this.cmbHStatus = new System.Windows.Forms.ComboBox();
            this.label4 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.txtHBillNo = new System.Windows.Forms.TextBox();
            this.panel1 = new System.Windows.Forms.Panel();
            this.lbljl = new System.Windows.Forms.Label();
            this.lbldj = new System.Windows.Forms.Label();
            this.lblCaption = new System.Windows.Forms.Label();
            this.Tool = new System.Windows.Forms.ToolStrip();
            this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
            this.eXCELToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.cSVToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.dc = new System.Windows.Forms.ToolStripButton();
            this.yl = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.cx = new System.Windows.Forms.ToolStripButton();
            this.sx = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.bzd = new System.Windows.Forms.ToolStripButton();
            this.xz = new System.Windows.Forms.ToolStripButton();
            this.dj = new System.Windows.Forms.ToolStripButton();
            this.sc = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
            this.sh = new System.Windows.Forms.ToolStripButton();
            this.qsh = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
            this.tc = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
            this.mrlk = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
            this.bclk = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.timer2 = new System.Windows.Forms.Timer(this.components);
            this.grdMain = new System.Windows.Forms.DataGridView();
            this.grdPrint = new System.Windows.Forms.DataGridView();
            this.grdSum = new System.Windows.Forms.DataGridView();
            this.pPic.SuspendLayout();
            this.panel1.SuspendLayout();
            this.Tool.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdPrint)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdSum)).BeginInit();
            this.SuspendLayout();
            //
            // pPic
            //
            this.pPic.BackColor = System.Drawing.Color.White;
            this.pPic.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pPic.BackgroundImage")));
            this.pPic.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.pPic.Controls.Add(this.cmbHStatus);
            this.pPic.Controls.Add(this.label4);
            this.pPic.Controls.Add(this.label1);
            this.pPic.Controls.Add(this.txtHBillNo);
            this.pPic.Controls.Add(this.panel1);
            this.pPic.Controls.Add(this.lblCaption);
            this.pPic.Dock = System.Windows.Forms.DockStyle.Top;
            this.pPic.Location = new System.Drawing.Point(0, 50);
            this.pPic.Name = "pPic";
            this.pPic.Size = new System.Drawing.Size(1246, 47);
            this.pPic.TabIndex = 15;
            //
            // cmbHStatus
            //
            this.cmbHStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbHStatus.FormattingEnabled = true;
            this.cmbHStatus.Items.AddRange(new object[] {
            "全部",
            "未同步",
            "已同步"});
            this.cmbHStatus.Location = new System.Drawing.Point(351, 14);
            this.cmbHStatus.Margin = new System.Windows.Forms.Padding(2);
            this.cmbHStatus.Name = "cmbHStatus";
            this.cmbHStatus.Size = new System.Drawing.Size(92, 20);
            this.cmbHStatus.TabIndex = 20;
            this.cmbHStatus.SelectedIndexChanged += new System.EventHandler(this.cmbHStatus_SelectedIndexChanged);
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.BackColor = System.Drawing.Color.Transparent;
            this.label4.Location = new System.Drawing.Point(285, 18);
            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(53, 12);
            this.label4.TabIndex = 19;
            this.label4.Text = "同步状态";
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.BackColor = System.Drawing.Color.Transparent;
            this.label1.Location = new System.Drawing.Point(467, 18);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(65, 12);
            this.label1.TabIndex = 8;
            this.label1.Text = "流转卡号:";
            //
            // txtHBillNo
            //
            this.txtHBillNo.Location = new System.Drawing.Point(535, 14);
            this.txtHBillNo.Name = "txtHBillNo";
            this.txtHBillNo.Size = new System.Drawing.Size(162, 21);
            this.txtHBillNo.TabIndex = 9;
            this.txtHBillNo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtHBillNo_KeyDown);
            //
            // panel1
            //
            this.panel1.Controls.Add(this.lbljl);
            this.panel1.Controls.Add(this.lbldj);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
            this.panel1.Location = new System.Drawing.Point(1049, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(197, 47);
            this.panel1.TabIndex = 7;
            //
            // lbljl
            //
            this.lbljl.AutoSize = true;
            this.lbljl.Location = new System.Drawing.Point(24, 30);
            this.lbljl.Name = "lbljl";
            this.lbljl.Size = new System.Drawing.Size(11, 12);
            this.lbljl.TabIndex = 1;
            this.lbljl.Text = " ";
            //
            // lbldj
            //
            this.lbldj.AutoSize = true;
            this.lbldj.Location = new System.Drawing.Point(24, 12);
            this.lbldj.Name = "lbldj";
            this.lbldj.Size = new System.Drawing.Size(0, 12);
            this.lbldj.TabIndex = 0;
            //
            // lblCaption
            //
            this.lblCaption.AutoSize = true;
            this.lblCaption.BackColor = System.Drawing.Color.Transparent;
            this.lblCaption.Cursor = System.Windows.Forms.Cursors.No;
            this.lblCaption.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.lblCaption.Location = new System.Drawing.Point(12, 15);
            this.lblCaption.Name = "lblCaption";
            this.lblCaption.Size = new System.Drawing.Size(252, 21);
            this.lblCaption.TabIndex = 4;
            this.lblCaption.Text = "末道工序出站汇报单列表";
            this.lblCaption.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // Tool
            //
            this.Tool.AutoSize = false;
            this.Tool.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("Tool.BackgroundImage")));
            this.Tool.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.Tool.ImageScalingSize = new System.Drawing.Size(22, 22);
            this.Tool.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripDropDownButton1,
            this.dc,
            this.yl,
            this.toolStripSeparator2,
            this.cx,
            this.sx,
            this.toolStripSeparator1,
            this.bzd,
            this.xz,
            this.dj,
            this.sc,
            this.toolStripSeparator5,
            this.sh,
            this.qsh,
            this.toolStripSeparator4,
            this.tc,
            this.toolStripSeparator3,
            this.toolStripSeparator9,
            this.mrlk,
            this.toolStripSeparator7,
            this.bclk,
            this.toolStripSeparator8});
            this.Tool.Location = new System.Drawing.Point(0, 0);
            this.Tool.Name = "Tool";
            this.Tool.Padding = new System.Windows.Forms.Padding(0);
            this.Tool.Size = new System.Drawing.Size(1246, 50);
            this.Tool.Stretch = true;
            this.Tool.TabIndex = 16;
            this.Tool.Text = "toolStrip1";
            //
            // toolStripDropDownButton1
            //
            this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.eXCELToolStripMenuItem,
            this.cSVToolStripMenuItem});
            this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
            this.toolStripDropDownButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
            this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 47);
            this.toolStripDropDownButton1.Text = "引出";
            this.toolStripDropDownButton1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.toolStripDropDownButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            //
            // eXCELToolStripMenuItem
            //
            this.eXCELToolStripMenuItem.Name = "eXCELToolStripMenuItem";
            this.eXCELToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
            this.eXCELToolStripMenuItem.Text = "EXCEL";
            this.eXCELToolStripMenuItem.Click += new System.EventHandler(this.eXCELToolStripMenuItem_Click);
            //
            // cSVToolStripMenuItem
            //
            this.cSVToolStripMenuItem.Name = "cSVToolStripMenuItem";
            this.cSVToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
            this.cSVToolStripMenuItem.Text = "CSV";
            this.cSVToolStripMenuItem.Click += new System.EventHandler(this.cSVToolStripMenuItem_Click);
            //
            // dc
            //
            this.dc.AutoSize = false;
            this.dc.Image = ((System.Drawing.Image)(resources.GetObject("dc.Image")));
            this.dc.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.dc.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.dc.ImageTransparentColor = System.Drawing.Color.White;
            this.dc.Name = "dc";
            this.dc.Size = new System.Drawing.Size(36, 47);
            this.dc.Text = "引出";
            this.dc.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.dc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.dc.Visible = false;
            this.dc.Click += new System.EventHandler(this.dc_Click);
            //
            // yl
            //
            this.yl.AutoSize = false;
            this.yl.Image = ((System.Drawing.Image)(resources.GetObject("yl.Image")));
            this.yl.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.yl.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.yl.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.yl.Name = "yl";
            this.yl.Size = new System.Drawing.Size(36, 47);
            this.yl.Text = "预览";
            this.yl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.yl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.yl.Visible = false;
            this.yl.Click += new System.EventHandler(this.yl_Click);
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 50);
            //
            // cx
            //
            this.cx.AutoSize = false;
            this.cx.Image = ((System.Drawing.Image)(resources.GetObject("cx.Image")));
            this.cx.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.cx.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.cx.ImageTransparentColor = System.Drawing.Color.White;
            this.cx.Name = "cx";
            this.cx.Size = new System.Drawing.Size(36, 47);
            this.cx.Text = "查询";
            this.cx.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.cx.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.cx.Click += new System.EventHandler(this.cx_Click);
            //
            // sx
            //
            this.sx.AutoSize = false;
            this.sx.Image = ((System.Drawing.Image)(resources.GetObject("sx.Image")));
            this.sx.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.sx.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.sx.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.sx.Name = "sx";
            this.sx.Size = new System.Drawing.Size(36, 47);
            this.sx.Text = "刷新";
            this.sx.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.sx.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.sx.Click += new System.EventHandler(this.sx_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 50);
            this.toolStripSeparator1.Visible = false;
            //
            // bzd
            //
            this.bzd.AutoSize = false;
            this.bzd.Image = ((System.Drawing.Image)(resources.GetObject("bzd.Image")));
            this.bzd.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.bzd.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.bzd.ImageTransparentColor = System.Drawing.Color.White;
            this.bzd.Name = "bzd";
            this.bzd.Size = new System.Drawing.Size(36, 47);
            this.bzd.Text = "入库";
            this.bzd.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.bzd.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.bzd.ToolTipText = "入库";
            this.bzd.Click += new System.EventHandler(this.bzd_Click);
            //
            // xz
            //
            this.xz.AutoSize = false;
            this.xz.Image = ((System.Drawing.Image)(resources.GetObject("xz.Image")));
            this.xz.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.xz.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.xz.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.xz.Name = "xz";
            this.xz.Size = new System.Drawing.Size(36, 47);
            this.xz.Text = "新增";
            this.xz.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.xz.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.xz.Visible = false;
            this.xz.Click += new System.EventHandler(this.xz_Click);
            //
            // dj
            //
            this.dj.AutoSize = false;
            this.dj.Image = ((System.Drawing.Image)(resources.GetObject("dj.Image")));
            this.dj.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.dj.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.dj.ImageTransparentColor = System.Drawing.Color.White;
            this.dj.Name = "dj";
            this.dj.Size = new System.Drawing.Size(36, 47);
            this.dj.Text = "单据";
            this.dj.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.dj.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.dj.Visible = false;
            this.dj.Click += new System.EventHandler(this.dj_Click);
            //
            // sc
            //
            this.sc.AutoSize = false;
            this.sc.Image = ((System.Drawing.Image)(resources.GetObject("sc.Image")));
            this.sc.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.sc.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.sc.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.sc.Name = "sc";
            this.sc.Size = new System.Drawing.Size(36, 47);
            this.sc.Text = "删除";
            this.sc.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.sc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.sc.Visible = false;
            this.sc.Click += new System.EventHandler(this.sc_Click);
            //
            // toolStripSeparator5
            //
            this.toolStripSeparator5.Name = "toolStripSeparator5";
            this.toolStripSeparator5.Size = new System.Drawing.Size(6, 50);
            this.toolStripSeparator5.Visible = false;
            //
            // sh
            //
            this.sh.AutoSize = false;
            this.sh.Image = ((System.Drawing.Image)(resources.GetObject("sh.Image")));
            this.sh.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.sh.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.sh.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.sh.Name = "sh";
            this.sh.Size = new System.Drawing.Size(36, 47);
            this.sh.Text = "审核";
            this.sh.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.sh.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.sh.Visible = false;
            this.sh.Click += new System.EventHandler(this.sh_Click);
            //
            // qsh
            //
            this.qsh.AutoSize = false;
            this.qsh.Image = ((System.Drawing.Image)(resources.GetObject("qsh.Image")));
            this.qsh.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.qsh.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.qsh.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.qsh.Name = "qsh";
            this.qsh.Size = new System.Drawing.Size(36, 47);
            this.qsh.Text = "反审";
            this.qsh.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.qsh.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.qsh.Visible = false;
            this.qsh.Click += new System.EventHandler(this.qsh_Click);
            //
            // toolStripSeparator4
            //
            this.toolStripSeparator4.Name = "toolStripSeparator4";
            this.toolStripSeparator4.Size = new System.Drawing.Size(6, 50);
            //
            // tc
            //
            this.tc.AutoSize = false;
            this.tc.Image = ((System.Drawing.Image)(resources.GetObject("tc.Image")));
            this.tc.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.tc.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.tc.ImageTransparentColor = System.Drawing.Color.White;
            this.tc.Name = "tc";
            this.tc.Size = new System.Drawing.Size(36, 47);
            this.tc.Text = "退出";
            this.tc.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.tc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.tc.Click += new System.EventHandler(this.tc_Click);
            //
            // toolStripSeparator3
            //
            this.toolStripSeparator3.Name = "toolStripSeparator3";
            this.toolStripSeparator3.Size = new System.Drawing.Size(6, 50);
            //
            // toolStripSeparator9
            //
            this.toolStripSeparator9.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.toolStripSeparator9.Name = "toolStripSeparator9";
            this.toolStripSeparator9.Size = new System.Drawing.Size(6, 50);
            //
            // mrlk
            //
            this.mrlk.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.mrlk.Image = ((System.Drawing.Image)(resources.GetObject("mrlk.Image")));
            this.mrlk.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.mrlk.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.mrlk.ImageTransparentColor = System.Drawing.Color.White;
            this.mrlk.Name = "mrlk";
            this.mrlk.Size = new System.Drawing.Size(60, 47);
            this.mrlk.Text = "默认列宽";
            this.mrlk.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.mrlk.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.mrlk.Click += new System.EventHandler(this.mrlk_Click);
            //
            // toolStripSeparator7
            //
            this.toolStripSeparator7.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.toolStripSeparator7.Name = "toolStripSeparator7";
            this.toolStripSeparator7.Size = new System.Drawing.Size(6, 50);
            //
            // bclk
            //
            this.bclk.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.bclk.Image = ((System.Drawing.Image)(resources.GetObject("bclk.Image")));
            this.bclk.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.bclk.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
            this.bclk.ImageTransparentColor = System.Drawing.Color.White;
            this.bclk.Name = "bclk";
            this.bclk.Size = new System.Drawing.Size(60, 47);
            this.bclk.Text = "保存列宽";
            this.bclk.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.bclk.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.bclk.Click += new System.EventHandler(this.bclk_Click);
            //
            // toolStripSeparator8
            //
            this.toolStripSeparator8.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.toolStripSeparator8.Name = "toolStripSeparator8";
            this.toolStripSeparator8.Size = new System.Drawing.Size(6, 50);
            //
            // timer1
            //
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            //
            // timer2
            //
            this.timer2.Enabled = true;
            this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
            //
            // grdMain
            //
            this.grdMain.AllowUserToAddRows = false;
            this.grdMain.AllowUserToDeleteRows = false;
            this.grdMain.BackgroundColor = System.Drawing.SystemColors.InactiveCaption;
            this.grdMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.grdMain.Location = new System.Drawing.Point(0, 97);
            this.grdMain.Name = "grdMain";
            this.grdMain.ReadOnly = true;
            this.grdMain.RowHeadersWidth = 51;
            this.grdMain.RowTemplate.Height = 23;
            this.grdMain.Size = new System.Drawing.Size(1246, 415);
            this.grdMain.TabIndex = 19;
            this.grdMain.CellMouseUp += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.grdMain_CellMouseUp);
            this.grdMain.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.grdMain_ColumnWidthChanged);
            this.grdMain.Scroll += new System.Windows.Forms.ScrollEventHandler(this.grdMain_Scroll);
            this.grdMain.Paint += new System.Windows.Forms.PaintEventHandler(this.grdMain_Paint);
            this.grdMain.DoubleClick += new System.EventHandler(this.grdMain_DblClick);
            //
            // grdPrint
            //
            this.grdPrint.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdPrint.Location = new System.Drawing.Point(772, 146);
            this.grdPrint.Name = "grdPrint";
            this.grdPrint.RowHeadersWidth = 51;
            this.grdPrint.RowTemplate.Height = 23;
            this.grdPrint.Size = new System.Drawing.Size(25, 24);
            this.grdPrint.TabIndex = 8;
            this.grdPrint.Visible = false;
            //
            // grdSum
            //
            this.grdSum.AllowUserToAddRows = false;
            this.grdSum.AllowUserToDeleteRows = false;
            this.grdSum.BackgroundColor = System.Drawing.SystemColors.Control;
            this.grdSum.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdSum.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.grdSum.Location = new System.Drawing.Point(0, 512);
            this.grdSum.Name = "grdSum";
            this.grdSum.ReadOnly = true;
            this.grdSum.RowHeadersWidth = 51;
            this.grdSum.RowTemplate.Height = 23;
            this.grdSum.ScrollBars = System.Windows.Forms.ScrollBars.None;
            this.grdSum.Size = new System.Drawing.Size(1246, 19);
            this.grdSum.TabIndex = 47;
            //
            // MES_StationOutBillList_LastProc
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1246, 531);
            this.Controls.Add(this.grdMain);
            this.Controls.Add(this.grdSum);
            this.Controls.Add(this.pPic);
            this.Controls.Add(this.Tool);
            this.Controls.Add(this.grdPrint);
            this.Name = "MES_StationOutBillList_LastProc";
            this.Text = "末道工序出站汇报单列表";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.Load += new System.EventHandler(this.MES_StationOutBillList_LastProc_Load);
            this.pPic.ResumeLayout(false);
            this.pPic.PerformLayout();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.Tool.ResumeLayout(false);
            this.Tool.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdPrint)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdSum)).EndInit();
            this.ResumeLayout(false);
        }
        #endregion
        private System.Windows.Forms.Panel pPic;
        private System.Windows.Forms.Label lblCaption;
        private System.Windows.Forms.ToolStrip Tool;
        private System.Windows.Forms.ToolStripButton yl;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
        private System.Windows.Forms.ToolStripButton cx;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
        private System.Windows.Forms.ToolStripButton tc;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
        public System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.ToolStripButton sx;
        private System.Windows.Forms.ToolStripButton dj;
        private System.Windows.Forms.ToolStripButton xz;
        private System.Windows.Forms.ToolStripButton sc;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
        private System.Windows.Forms.Timer timer2;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
        private System.Windows.Forms.ToolStripButton mrlk;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
        private System.Windows.Forms.ToolStripButton bclk;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
        private System.Windows.Forms.ToolStripButton sh;
        private System.Windows.Forms.ToolStripButton qsh;
        private System.Windows.Forms.DataGridView grdMain;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label lbljl;
        private System.Windows.Forms.Label lbldj;
        private System.Windows.Forms.DataGridView grdPrint;
        private System.Windows.Forms.DataGridView grdSum;
        private System.Windows.Forms.ToolStripButton dc;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox txtHBillNo;
        private System.Windows.Forms.ToolStripButton bzd;
        private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
        private System.Windows.Forms.ToolStripMenuItem eXCELToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem cSVToolStripMenuItem;
        private System.Windows.Forms.ComboBox cmbHStatus;
        private System.Windows.Forms.Label label4;
    }
}
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationOutBillList_LastProc.resx
New file
Diff too large