1
duhe
2024-03-05 19a1b272fc705bd4c040a0dc650d673e2cfe1213
DAL/Ó¦¸¶¹ÜÀí/ClsYF_PayMentOtherBill.cs
@@ -47,14 +47,18 @@
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDateDate=getdate()" +
                    //========================================
                //========================================
                ",HAccDate='" + omodel.HAccDate.ToShortDateString() + "'" +
                ",HSupID=" + omodel.HSupID.ToString() +
                ",HCusID=" + omodel.HCusID.ToString() +
                ",HCurID=" + omodel.HCurID.ToString() +
                ",HExRate=" + omodel.HExRate.ToString() +
                ",HDeptID=" + omodel.HDeptID.ToString() +
                ",HEmpID=" + omodel.HEmpID.ToString() +
                ",HSumMoney=" + omodel.HSumMoney.ToString() +
                ",HProjectMoneyID =" + omodel.HProjectMoneyID.ToString() +
                ",HType='" + omodel.HType.ToString() + "'" +
                ",HMoney='" + omodel.HMoney + "'" +
                ",HTaxRate='" + omodel.HTaxRate + "'" +
                ",HSumMoney='" + omodel.HSumMoney + "'" +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                " where HInterID=" + lngBillKey.ToString());
@@ -62,30 +66,7 @@
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsYF_PayMentOtherBillSub oSub in DetailColl)
                {
                    //oCn.RunProc("Insert into YF_PayMentOtherBillSub " +
                    //  " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                    //  ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                    //  ") values("
                    //  + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                    //  "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                    //  ") ");
                }
                //
                //foreach (Model.ClsYF_PayMentOtherBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_YF_PayMentOtherBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        return false;
                //    }
                //}
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -108,40 +89,17 @@
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into YF_PayMentOtherBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HAccDate,HSupID,HCurID,HExRate" +
                ",HDeptID,HEmpID,HSumMoney,HExplanation,HInnerBillNo" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                ",'" + omodel.HAccDate.ToShortDateString() + "'," + omodel.HSupID.ToString() + "," + omodel.HCurID.ToString() + "," + omodel.HExRate.ToString() +
                ", " + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HSumMoney.ToString() + ",'"  + omodel.HExplanation +"','"+ omodel.HInnerBillNo + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsYF_PayMentOtherBillSub oSub in DetailColl)
                {
                    //oCn.RunProc("Insert into YF_PayMentOtherBillSub " +
                    //  " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                    //  ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                    //  ") values("
                    //  + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                    //  "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                    //  ") ");
                }
                //
                //foreach (Model.ClsYF_PayMentOtherBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_YF_PayMentOtherBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        return false;
                //    }
                //}
                //
               "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
               ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
               ",HAccDate,HCusID,HCurID,HExRate" +
               ",HDeptID,HEmpID,HProjectMoneyID,HType,HMoney,HTaxRate,HSumMoney,HExplanation,HInnerBillNo,HOrgID" +
               ") " +
               " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
               ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
               ",'" + omodel.HAccDate.ToShortDateString() + "'," + omodel.HCusID.ToString() + "," + omodel.HCurID.ToString() + "," + omodel.HExRate.ToString() +
               ", '" + omodel.HDeptID.ToString() + "','" + omodel.HEmpID.ToString() + "','" + omodel.HProjectMoneyID.ToString() + "','" + omodel.HType + "','" + omodel.HMoney + "','" + omodel.HTaxRate + "','" + omodel.HSumMoney + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HOrgID + "'" +
               ") ");
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
@@ -194,7 +152,7 @@
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
                //========================================================
                omodel.HAccDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HAccDate"]);
                omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
                omodel.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"]);
                omodel.HCurID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCurID"]);
                omodel.HExRate = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HExRate"]);
                omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);