llj
8 天以前 2bf6de5d4748d28f7f3a098af25503d6a0c619d1
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÁìÁÏ·¢»õ/Kf_MateOutBillController.cs
@@ -1547,32 +1547,32 @@
                select hmainid HInterID, å•据号 HBillNO from h_v_IF_MateOutBillList_Search where hmainid = {mainList[0].HInterID}
                ", "h_v_IF_MateOutBillList_Search");
                // if (ds1.Tables[0].Rows.Count > 0 && ds1.Tables[0].Rows[0]["HInterID"] != null) {
                //     if(string.Equals(ds1.Tables[0].Rows[0]["HBillNo"].ToString(), mainList[0].HBillNo, StringComparison.OrdinalIgnoreCase)){
                //         string sql = string.Empty;
                //         sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
                //         oCn.RunProc(sql);
                //         sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
                //         oCn.RunProc(sql);
                //     }
                //     else
                //     {
                //         // é‡æ–°ç”³è¯·HInterID
                //         var HInterID_Exch =  DBUtility.ClsPub.CreateBillID("1204", ref DBUtility.ClsPub.sExeReturnInfo);
                //         mainList[0].HInterID = HInterID_Exch;
                //
                //         foreach(var oSub in subList)
                //         {
                //             oSub.HInterID = HInterID_Exch;
                //         }
                //
                //     }
                // }
                string sql = string.Empty;
                sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
                oCn.RunProc(sql);
                sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
                oCn.RunProc(sql);
                if (ds1.Tables[0].Rows.Count > 0 && ds1.Tables[0].Rows[0]["HInterID"] != null) {
                    if(string.Equals(ds1.Tables[0].Rows[0]["HBillNo"].ToString(), mainList[0].HBillNo, StringComparison.OrdinalIgnoreCase)){
                        string sql = string.Empty;
                        sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
                        oCn.RunProc(sql);
                        sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
                        oCn.RunProc(sql);
                    }
                    else
                    {
                        // é‡æ–°ç”³è¯·HInterID
                        var HInterID_Exch =  DBUtility.ClsPub.CreateBillID("1204", ref DBUtility.ClsPub.sExeReturnInfo);
                        mainList[0].HInterID = HInterID_Exch;
                        foreach(var oSub in subList)
                        {
                            oSub.HInterID = HInterID_Exch;
                        }
                    }
                }
                // string sql = string.Empty;
                // sql = $"delete Kf_ICStockBillMain where HinterID = {mainList[0].HInterID}";
                // oCn.RunProc(sql);
                // sql = $"delete Kf_ICStockBillSub where HinterID = {mainList[0].HInterID}";
                // oCn.RunProc(sql);
                // ä¸»è¡¨
                oCn.RunProc($@"Insert Into Kf_ICStockBillMain 
                (