yangle
2022-12-09 f77e4196ad4870b713a0c51d874481a372c9201c
WorkM/±¨±í·ÖÎö/Sc_WorkShopReport.cs
@@ -166,8 +166,8 @@
            {
                sDlgWhere = sDlgWhere.Substring(1, sDlgWhere.Length - 1);
            }
            //
            DSet = SubCn.RunProcReturn("exec h_p_CJKB" + sDlgWhere, "Gy_Czygl");
            DSet = SubCn.RunProcReturn("exec h_p_CJKB " + sDlgWhere, "h_p_CJKB");
            //生成首行标题
            if (DSet == null)
            {
@@ -176,33 +176,21 @@
            }
            //
            grdMain.DataSource = DSet.Tables[0].DefaultView;
            //获取动态列 ï¼ˆç‰©æ–™ä¿¡æ¯ï¼‰
            //DsHead = SubCn.RunProcReturn("exec h_p_Sc_GetProcExchReportHead " + sDlgWhere, "Gy_Czygl");
            //for (int a = 0; a < DsHead.Tables[0].Rows.Count; a++)
            //{
            //    if (ClsPub.isLong(DsHead.Tables[0].Rows[a]["HMaterID"]) != 0)
            //    {
            //        grdMain.Columns.Add(ClsPub.isStrNull(DsHead.Tables[0].Rows[a]["HMaterID"]), ClsPub.isStrNull(DsHead.Tables[0].Rows[a]["HName"]));
            //        grdMain.Columns[BCol].Tag = ClsPub.isLong(DsHead.Tables[0].Rows[a]["HMaterID"]);
            //        BCol = BCol + 1;
            //    }
            //}
            BCol = 7;
            //获取动态内容  ï¼ˆæ•°é‡ä¿¡æ¯ï¼‰
            for (int row = 0; row <= grdMain.RowCount - 1; row++)
            {
                for (int col = BCol; col <= grdMain.ColumnCount - 1; col++)
                {
                    HDeptID = DBUtility.ClsPub.isLong(grdMain.Rows[row].Cells[Fun_GetCol("HDeptID")].Value);
                    DsQty = SubCn.RunProcReturn("exec h_p_CJKB '" +  HDeptID.ToString(), "Gy_Czygl");
                    if (DsQty != null && DsQty.Tables[0].Rows.Count > 0)
                    {
                        grdMain.Rows[row].Cells[col].Value = DBUtility.ClsPub.isDoule(DsQty.Tables[0].Rows[0]["HQty"], 2);
                    }
                }
            }
            //for (int row = 0; row <= grdMain.RowCount - 1; row++)
            //{
            //    for (int col = BCol; col <= grdMain.ColumnCount - 1; col++)
            //    {
            //        //HDeptID = DBUtility.ClsPub.isLong(grdMain.Rows[row].Cells[Fun_GetCol("HDeptID")].Value);
            //        DsQty = SubCn.RunProcReturn("exec h_p_CJKB " + 0, "h_p_CJKB");
            //        if (DsQty != null && DsQty.Tables[0].Rows.Count > 0)
            //        {
            //            grdMain.Rows[row].Cells[col].Value = DBUtility.ClsPub.isDoule(DsQty.Tables[0].Rows[0]["HQty"], 2);
            //        }
            //    }
            //}
            //设置合计列
            string sTotalCol = "";