예제 #1
0
        public override List <T> handleData <T>(DataSet dataSet)
        {
            fentryList.Clear();
            List <ReceivableInfoSaveObject> receivableSaveInfoObjList = new List <ReceivableInfoSaveObject>();
            List <ReceivableDataSet>        receivableDataSetList     = new List <ReceivableDataSet>();

            for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
            {
                ReceivableDataSet receivableDataSet = new ReceivableDataSet();
                receivableDataSet.FNumber             = dataSet.Tables[0].Rows[i]["FNumber"].ToString();
                receivableDataSet.Fdate               = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["Fdate"]);
                receivableDataSet.FendDate            = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["FendDate"]);
                receivableDataSet.FaccntTimeJudgeTime = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["FaccntTimeJudgeTime"]);
                receivableDataSet.FCustomer           = dataSet.Tables[0].Rows[i]["FCustomer"].ToString();
                receivableDataSet.FsettleOrg          = dataSet.Tables[0].Rows[i]["FsettleOrg"].ToString();
                receivableDataSet.FpayOrg             = dataSet.Tables[0].Rows[i]["FpayOrg"].ToString();
                receivableDataSet.FpurchaseOrg        = dataSet.Tables[0].Rows[i]["FSaleOrg"].ToString();
                receivableDataSet.Fcurrency           = dataSet.Tables[0].Rows[i]["Fcurrency"].ToString();
                receivableDataSet.Fmaterial           = dataSet.Tables[0].Rows[i]["Fmaterial"].ToString();
                receivableDataSet.FpriceUnit          = dataSet.Tables[0].Rows[i]["FpriceUnit"].ToString();
                receivableDataSet.Fprice              = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["Fprice"]);
                receivableDataSet.FpriceQty           = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FpriceQty"]);
                receivableDataSet.FtaxPrice           = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FtaxPrice"]);
                receivableDataSet.FentryTaxRate       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FentryTaxRate"]);
                receivableDataSet.FEntryDiscountRate  = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FEntryDiscountRate"]);
                receivableDataSet.FdiscountAmountFor  = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FdiscountAmountFor"]);
                receivableDataSet.FNoTaxAmountFor     = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FNoTaxAmountFor"]);
                receivableDataSet.FTaxAmountFor       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FTaxAmountFor"]);
                receivableDataSet.FallAmountFor       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FallAmountFor"]);
                receivableDataSet.Fremark             = dataSet.Tables[0].Rows[i]["FREMARK"].ToString();
                receivableDataSetList.Add(receivableDataSet);
            }
            for (int i = 0; i < receivableDataSetList.Count; i++)
            {
                //分录
                FEntityDetail fentryDetail = new FEntityDetail();
                //1.物料
                FMATERIALID fMATERIALID = new FMATERIALID();
                fMATERIALID.FNumber      = receivableDataSetList[i].Fmaterial;
                fentryDetail.FMATERIALID = fMATERIALID;
                //2.计价单位编码
                FPRICEUNITID fPRICEUNITID = new FPRICEUNITID();
                //if ("Pcs".Equals(receivableDataSetList[i].FpriceUnit)) {
                //    fPRICEUNITID.FNumber = "10101";
                //}
                fPRICEUNITID.FNumber      = receivableDataSetList[i].FpriceUnit;
                fentryDetail.FPRICEUNITID = fPRICEUNITID;
                //3.单价
                fentryDetail.FPrice = receivableDataSetList[i].Fprice;
                //4.含税单价
                fentryDetail.FTaxPrice = receivableDataSetList[i].FtaxPrice;
                //5.税率(%)
                fentryDetail.FEntryTaxRate = receivableDataSetList[i].FentryTaxRate;
                //6.折扣率(%)
                fentryDetail.FEntryDiscountRate = receivableDataSetList[i].FEntryDiscountRate;
                //7.折扣额
                fentryDetail.FDISCOUNTAMOUNTFOR = receivableDataSetList[i].FdiscountAmountFor;
                //8.价税合计
                fentryDetail.FALLAMOUNTFOR_D = receivableDataSetList[i].FallAmountFor;
                //9.计价数量
                fentryDetail.FPriceQty = receivableDataSetList[i].FpriceQty;
                //10. 不含税金额
                fentryDetail.FNoTaxAmountFor_D = receivableDataSetList[i].FNoTaxAmountFor;
                //11.税额
                fentryDetail.FTaxAmountFor_D = receivableDataSetList[i].FTaxAmountFor;
                //12.
                FSalUnitId fSalUnitId = new FSalUnitId();
                fSalUnitId.FNumber      = receivableDataSetList[i].FpriceUnit;
                fentryDetail.FSalUnitId = fSalUnitId;

                if (i + 1 < receivableDataSetList.Count)
                {
                    // fentryList.Add(fentryDetail);
                    if (receivableDataSetList[i].FNumber != receivableDataSetList[i + 1].FNumber)
                    {
                        fentryList.Add(fentryDetail);
                        ReceivableInfoSaveObject receivableInfoSaveObject = new ReceivableInfoSaveObject();
                        Model model = new Model();
                        List <FEntityDetail> fEntityA = new List <FEntityDetail>();
                        fEntityA.AddRange(fentryList);
                        model.FEntityDetail = fEntityA;

                        //1.单据类型
                        FBillTypeID fBillTypeID = new FBillTypeID();
                        fBillTypeID.FNumber = "YSD01_SYS";
                        model.FBillTypeID   = fBillTypeID;
                        //2.单号
                        model.FBillNo = receivableDataSetList[i].FNumber;
                        //3.客户
                        FCUSTOMERID fCUSTOMERID = new FCUSTOMERID();
                        fCUSTOMERID.FNumber = receivableDataSetList[i].FCustomer;
                        model.FCUSTOMERID   = fCUSTOMERID;
                        //4.作废状态
                        model.FCancelStatus = "A";
                        //5.业务类型 默认普通采购
                        model.FBUSINESSTYPE = "BZ";
                        //6.单据状态
                        model.FDOCUMENTSTATUS = "A";
                        //7.业务日期
                        model.FDATE = receivableDataSetList[i].Fdate;
                        //8.到期日
                        model.FENDDATE_H = receivableDataSetList[i].FendDate;
                        //9.币别
                        FCURRENCYID fCURRENCYID = new FCURRENCYID();
                        fCURRENCYID.FNumber = receivableDataSetList[i].Fcurrency;
                        model.FCURRENCYID   = fCURRENCYID;
                        //10.结算组织
                        FSETTLEORGID fSETTLEORGID = new FSETTLEORGID();
                        fSETTLEORGID.FNumber = receivableDataSetList[i].FsettleOrg;
                        model.FSETTLEORGID   = fSETTLEORGID;
                        //11.付款组织
                        FPAYORGID fPAYORGID = new FPAYORGID();
                        fPAYORGID.FNumber = receivableDataSetList[i].FpayOrg;
                        model.FPAYORGID   = fPAYORGID;

                        model.FAR_Remark = receivableDataSetList[i].Fremark;

                        ////12.采购组织
                        //FPURCHASEORGID fPURCHASEORGID = new FPURCHASEORGID();
                        //fPURCHASEORGID.FNumber = receivableDataSetList[i].FpurchaseOrg;
                        //model.FPURCHASEORGID = fPURCHASEORGID;
                        //13.头部财务信息
                        FsubHeadFinc fsubHeadFinc = new FsubHeadFinc();
                        //13.1 到期日计算日期
                        fsubHeadFinc.FACCNTTIMEJUDGETIME = receivableDataSetList[i].FaccntTimeJudgeTime;
                        //13.2 不含税金额
                        //fsubHeadFinc.FNoTaxAmountFor = receivableDataSetList[i].FNoTaxAmountFor;
                        ////13.3 税额
                        //fsubHeadFinc.FTaxAmountFor = receivableDataSetList[i].FTaxAmountFor;
                        model.FsubHeadFinc = fsubHeadFinc;
                        List <FEntityDetail> fEntityB = new List <FEntityDetail>();
                        fEntityB.AddRange(fentryList);
                        model.FEntityDetail            = fEntityB;
                        receivableInfoSaveObject.Model = model;
                        receivableSaveInfoObjList.Add(receivableInfoSaveObject);
                        fentryList.Clear();
                    }
                    else
                    {
                        fentryList.Add(fentryDetail);
                    }
                }
                if (receivableDataSetList.Count == i + 1)
                {
                    fentryList.Add(fentryDetail);
                    ReceivableInfoSaveObject receivableInfoSaveObject = new ReceivableInfoSaveObject();
                    Model model = new Model();
                    //1.单据类型
                    FBillTypeID fBillTypeID = new FBillTypeID();
                    fBillTypeID.FNumber = "YSD01_SYS";
                    model.FBillTypeID   = fBillTypeID;
                    //2.单号
                    model.FBillNo = receivableDataSetList[i].FNumber;
                    //3.客户
                    FCUSTOMERID fCUSTOMERID = new FCUSTOMERID();
                    fCUSTOMERID.FNumber = receivableDataSetList[i].FCustomer;
                    model.FCUSTOMERID   = fCUSTOMERID;
                    //4.作废状态
                    model.FCancelStatus = "A";
                    //5.业务类型 默认普通采购
                    model.FBUSINESSTYPE = "BZ";
                    //6.单据状态
                    model.FDOCUMENTSTATUS = "A";
                    //7.业务日期
                    model.FDATE = receivableDataSetList[i].Fdate;
                    //8.到期日
                    model.FENDDATE_H = receivableDataSetList[i].FendDate;
                    //9.币别
                    FCURRENCYID fCURRENCYID = new FCURRENCYID();
                    fCURRENCYID.FNumber = receivableDataSetList[i].Fcurrency;
                    model.FCURRENCYID   = fCURRENCYID;
                    //10.结算组织
                    FSETTLEORGID fSETTLEORGID = new FSETTLEORGID();
                    fSETTLEORGID.FNumber = receivableDataSetList[i].FsettleOrg;
                    model.FSETTLEORGID   = fSETTLEORGID;
                    //11.付款组织
                    FPAYORGID fPAYORGID = new FPAYORGID();
                    fPAYORGID.FNumber = receivableDataSetList[i].FpayOrg;
                    model.FPAYORGID   = fPAYORGID;

                    model.FAR_Remark = receivableDataSetList[i].Fremark;
                    ////12.采购组织
                    //FPURCHASEORGID fPURCHASEORGID = new FPURCHASEORGID();
                    //fPURCHASEORGID.FNumber = receivableDataSetList[i].FpurchaseOrg;
                    //model.FPURCHASEORGID = fPURCHASEORGID;
                    //13.头部财务信息
                    FsubHeadFinc fsubHeadFinc = new FsubHeadFinc();
                    //13.1 到期日计算日期
                    fsubHeadFinc.FACCNTTIMEJUDGETIME = receivableDataSetList[i].FaccntTimeJudgeTime;
                    ////13.2 不含税金额
                    //fsubHeadFinc.FNoTaxAmountFor = receivableDataSetList[i].FNoTaxAmountFor;
                    ////13.3 税额
                    //fsubHeadFinc.FTaxAmountFor = receivableDataSetList[i].FTaxAmountFor;
                    model.FsubHeadFinc = fsubHeadFinc;
                    List <FEntityDetail> fEntityB = new List <FEntityDetail>();
                    fEntityB.AddRange(fentryList);
                    model.FEntityDetail            = fEntityB;
                    receivableInfoSaveObject.Model = model;
                    receivableSaveInfoObjList.Add(receivableInfoSaveObject);
                    fentryList.Clear();
                }
            }

            return((List <T>)(object) receivableSaveInfoObjList);
        }
예제 #2
0
        public override List <T> handleData <T>(DataSet dataSet)
        {
            List <PayableInfoSaveObject> payableSaveInfoObjList = new List <PayableInfoSaveObject>();

            fentryList.Clear();
            List <PayableDataSet> payableDataSetList = new List <PayableDataSet>();

            for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
            {
                PayableDataSet payableDataSet = new PayableDataSet();
                payableDataSet.FNumber             = dataSet.Tables[0].Rows[i]["FNumber"].ToString();
                payableDataSet.Fdate               = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["Fdate"]);
                payableDataSet.FendDate            = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["FendDate"]);
                payableDataSet.FaccntTimeJudgeTime = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["FaccntTimeJudgeTime"]);
                payableDataSet.Fsupplier           = dataSet.Tables[0].Rows[i]["Fsupplier"].ToString();
                payableDataSet.FsettleOrg          = dataSet.Tables[0].Rows[i]["FsettleOrg"].ToString();
                payableDataSet.FpayOrg             = dataSet.Tables[0].Rows[i]["FpayOrg"].ToString();
                payableDataSet.FpurchaseOrg        = dataSet.Tables[0].Rows[i]["FpurchaseOrg"].ToString();
                payableDataSet.Fcurrency           = dataSet.Tables[0].Rows[i]["Fcurrency"].ToString();
                payableDataSet.Fmaterial           = dataSet.Tables[0].Rows[i]["Fmaterial"].ToString();
                payableDataSet.FpriceUnit          = dataSet.Tables[0].Rows[i]["FpriceUnit"].ToString();
                payableDataSet.Fprice              = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["Fprice"]);
                payableDataSet.FpriceQty           = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FpriceQty"]);
                payableDataSet.FtaxPrice           = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FtaxPrice"]);
                payableDataSet.FentryTaxRate       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FentryTaxRate"]);
                payableDataSet.FEntryDiscountRate  = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FEntryDiscountRate"]);
                payableDataSet.FdiscountAmountFor  = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FdiscountAmountFor"]);
                payableDataSet.FNoTaxAmountFor     = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FNoTaxAmountFor"]);
                payableDataSet.FTaxAmountFor       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FTaxAmountFor"]);
                payableDataSet.FallAmountFor       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FallAmountFor"]);
                payableDataSet.Fremark             = dataSet.Tables[0].Rows[i]["FREMARK"].ToString();
                payableDataSetList.Add(payableDataSet);
            }


            int j = 0;

            for (int i = 0; i < payableDataSetList.Count; i++)
            {
                //分录
                FEntityDetail fentryDetail = new FEntityDetail();
                //1.物料
                FMATERIALID fMATERIALID = new FMATERIALID();
                fMATERIALID.FNumber      = payableDataSetList[i].Fmaterial;
                fentryDetail.FMATERIALID = fMATERIALID;
                //2.计价单位编码
                FPRICEUNITID fPRICEUNITID = new FPRICEUNITID();
                fPRICEUNITID.FNumber      = payableDataSetList[i].FpriceUnit;
                fentryDetail.FPRICEUNITID = fPRICEUNITID;
                ///3.计价 数量
                fentryDetail.FPriceQty = payableDataSetList[i].FpriceQty;
                //3.单价
                fentryDetail.FPrice = payableDataSetList[i].Fprice;
                //4.含税单价
                fentryDetail.FTaxPrice = payableDataSetList[i].FtaxPrice;
                //5.税率(%)
                fentryDetail.FentryTaxRate = payableDataSetList[i].FentryTaxRate;
                //6.折扣率(%)
                fentryDetail.FEntryDiscountRate = payableDataSetList[i].FEntryDiscountRate;
                //7.折扣额
                fentryDetail.FdiscountAmountFor = payableDataSetList[i].FdiscountAmountFor;
                //8.价税合计
                fentryDetail.FALLAMOUNTFOR_D = payableDataSetList[i].FallAmountFor;

                ///10.不含税金额
                fentryDetail.FNoTaxAmountFor_D = payableDataSetList[i].FNoTaxAmountFor;
                ///11. 税额
                fentryDetail.FTAXAMOUNTFOR_D = payableDataSetList[i].FTaxAmountFor;

                if (i + 1 < payableDataSetList.Count)
                {
                    //fentryList.Add(fentryDetail);
                    if (payableDataSetList[i].FNumber != payableDataSetList[i + 1].FNumber)
                    {
                        fentryList.Add(fentryDetail);
                        PayableInfoSaveObject payableInfoSaveObject = new PayableInfoSaveObject();
                        Model model = new Model();
                        List <FEntityDetail> fEntityA = new List <FEntityDetail>();
                        fEntityA.AddRange(fentryList);
                        model.FEntityDetail = fEntityA;

                        //1.单据类型
                        FBillTypeID fBillTypeID = new FBillTypeID();
                        fBillTypeID.FNumber = "YFD01_SYS";
                        model.FBillTypeID   = fBillTypeID;
                        //2.单号
                        model.FBillNo = payableDataSetList[i].FNumber;
                        //3.供应商
                        FSUPPLIERID fSUPPLIERID = new FSUPPLIERID();
                        fSUPPLIERID.FNumber = payableDataSetList[i].Fsupplier;
                        model.FSUPPLIERID   = fSUPPLIERID;
                        //4.作废状态
                        model.FCancelStatus = "A";
                        //5.业务类型 默认普通采购
                        model.FBUSINESSTYPE = "CG";
                        //6.单据状态
                        model.FDOCUMENTSTATUS = "A";
                        //7.业务日期
                        model.FDATE = payableDataSetList[i].Fdate;
                        //8.到期日
                        model.FENDDATE_H = payableDataSetList[i].FendDate;
                        //9.币别
                        FCURRENCYID fCURRENCYID = new FCURRENCYID();
                        fCURRENCYID.FNumber = payableDataSetList[i].Fcurrency;
                        model.FCURRENCYID   = fCURRENCYID;
                        //10.结算组织
                        FSETTLEORGID fSETTLEORGID = new FSETTLEORGID();
                        fSETTLEORGID.FNumber = payableDataSetList[i].FsettleOrg;
                        model.FSETTLEORGID   = fSETTLEORGID;
                        //11.付款组织
                        FPAYORGID fPAYORGID = new FPAYORGID();
                        fPAYORGID.FNumber = payableDataSetList[i].FpayOrg;
                        model.FPAYORGID   = fPAYORGID;
                        //12.采购组织
                        FPURCHASEORGID fPURCHASEORGID = new FPURCHASEORGID();
                        fPURCHASEORGID.FNumber = payableDataSetList[i].FpurchaseOrg;
                        model.FPURCHASEORGID   = fPURCHASEORGID;

                        model.FAP_Remark = payableDataSetList[i].Fremark;

                        //13.头部财务信息
                        FsubHeadFinc fsubHeadFinc = new FsubHeadFinc();
                        //13.1 到期日计算日期
                        fsubHeadFinc.FaccntTimeJudgeTime = payableDataSetList[i].FaccntTimeJudgeTime;
                        //13.2 不含税金额
                        fsubHeadFinc.FNoTaxAmountFor = payableDataSetList[i].FNoTaxAmountFor;
                        //13.3 税额
                        fsubHeadFinc.FTaxAmountFor = payableDataSetList[i].FTaxAmountFor;
                        model.FsubHeadFinc         = fsubHeadFinc;
                        List <FEntityDetail> fEntityB = new List <FEntityDetail>();
                        fEntityB.AddRange(fentryList);
                        model.FEntityDetail         = fEntityB;
                        payableInfoSaveObject.Model = model;
                        payableSaveInfoObjList.Add(payableInfoSaveObject);
                        fentryList.Clear();
                    }
                    else
                    {
                        fentryList.Add(fentryDetail);
                    }
                }
                if (payableDataSetList.Count == i + 1)
                {
                    PayableInfoSaveObject payableInfoSaveObject = new PayableInfoSaveObject();
                    fentryList.Add(fentryDetail);
                    Model model = new Model();
                    //1.单据类型
                    FBillTypeID fBillTypeID = new FBillTypeID();
                    fBillTypeID.FNumber = "YFD01_SYS";
                    model.FBillTypeID   = fBillTypeID;
                    //2.单号
                    model.FBillNo = payableDataSetList[i].FNumber;
                    //3.供应商
                    FSUPPLIERID fSUPPLIERID = new FSUPPLIERID();
                    fSUPPLIERID.FNumber = payableDataSetList[i].Fsupplier;
                    model.FSUPPLIERID   = fSUPPLIERID;
                    //4.作废状态
                    model.FCancelStatus = "A";
                    //5.业务类型 默认普通采购
                    model.FBUSINESSTYPE = "CG";
                    //6.单据状态
                    model.FDOCUMENTSTATUS = "A";
                    //7.业务日期
                    model.FDATE = payableDataSetList[i].Fdate;
                    //8.到期日
                    model.FENDDATE_H = payableDataSetList[i].FendDate;
                    //9.币别
                    FCURRENCYID fCURRENCYID = new FCURRENCYID();
                    fCURRENCYID.FNumber = payableDataSetList[i].Fcurrency;
                    model.FCURRENCYID   = fCURRENCYID;
                    //10.结算组织
                    FSETTLEORGID fSETTLEORGID = new FSETTLEORGID();
                    fSETTLEORGID.FNumber = payableDataSetList[i].FsettleOrg;
                    model.FSETTLEORGID   = fSETTLEORGID;
                    //11.付款组织
                    FPAYORGID fPAYORGID = new FPAYORGID();
                    fPAYORGID.FNumber = payableDataSetList[i].FpayOrg;
                    model.FPAYORGID   = fPAYORGID;
                    //12.采购组织
                    FPURCHASEORGID fPURCHASEORGID = new FPURCHASEORGID();
                    fPURCHASEORGID.FNumber = payableDataSetList[i].FpurchaseOrg;
                    model.FPURCHASEORGID   = fPURCHASEORGID;
                    //备注
                    model.FAP_Remark = payableDataSetList[i].Fremark;
                    //13.头部财务信息
                    FsubHeadFinc fsubHeadFinc = new FsubHeadFinc();
                    //13.1 到期日计算日期
                    fsubHeadFinc.FaccntTimeJudgeTime = payableDataSetList[i].FaccntTimeJudgeTime;
                    //13.2 不含税金额
                    fsubHeadFinc.FNoTaxAmountFor = payableDataSetList[i].FNoTaxAmountFor;
                    //13.3 税额
                    fsubHeadFinc.FTaxAmountFor = payableDataSetList[i].FTaxAmountFor;
                    model.FsubHeadFinc         = fsubHeadFinc;
                    List <FEntityDetail> fEntityB = new List <FEntityDetail>();
                    fEntityB.AddRange(fentryList);
                    model.FEntityDetail         = fEntityB;
                    payableInfoSaveObject.Model = model;
                    payableSaveInfoObjList.Add(payableInfoSaveObject);
                }
            }

            return((List <T>)(object) payableSaveInfoObjList);
        }
예제 #3
0
        public override List <T> handleData <T>(DataSet dataSet)
        {
            fentryList.Clear();
            List <OtherRecAbleInfoSaveObject> otherRecAbleSaveInfoObjList = new List <OtherRecAbleInfoSaveObject>();
            List <OtherRecAbleDataSet>        otherRecAbleDataSetList     = new List <OtherRecAbleDataSet>();

            for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
            {
                OtherRecAbleDataSet otherRecAbleDataSet = new OtherRecAbleDataSet();
                otherRecAbleDataSet.FNumber             = dataSet.Tables[0].Rows[i]["FNumber"].ToString();
                otherRecAbleDataSet.Fdate               = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["Fdate"]);
                otherRecAbleDataSet.FendDate            = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["FendDate"]);
                otherRecAbleDataSet.FaccntTimeJudgeTime = Convert.ToDateTime(dataSet.Tables[0].Rows[i]["FaccntTimeJudgeTime"]);
                otherRecAbleDataSet.FContactUnitType    = dataSet.Tables[0].Rows[i]["FContactUnitType"].ToString();
                otherRecAbleDataSet.FContactUnit        = dataSet.Tables[0].Rows[i]["FContactUnit"].ToString();
                otherRecAbleDataSet.FCurrency           = dataSet.Tables[0].Rows[i]["FCurrency"].ToString();
                otherRecAbleDataSet.FsettleOrg          = dataSet.Tables[0].Rows[i]["FsettleOrg"].ToString();
                otherRecAbleDataSet.FpayOrg             = dataSet.Tables[0].Rows[i]["FpayOrg"].ToString();
                otherRecAbleDataSet.FCost               = dataSet.Tables[0].Rows[i]["FCost"].ToString();
                otherRecAbleDataSet.FCostDepartment     = dataSet.Tables[0].Rows[i]["FCostDepartment"].ToString();
                otherRecAbleDataSet.FInvoiceType        = dataSet.Tables[0].Rows[i]["FInvoiceType"].ToString();
                otherRecAbleDataSet.FEntryTaxRate       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FEntryTaxRate"]);
                otherRecAbleDataSet.FNoTaxAmountFor     = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FNoTaxAmountFor"]);
                otherRecAbleDataSet.FTaxAmountFor       = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FTaxAmountFor"]);
                otherRecAbleDataSet.FAmountFor          = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["FAmountFor"]);
                otherRecAbleDataSet.Fremark             = dataSet.Tables[0].Rows[i]["FREMARK"].ToString();
                otherRecAbleDataSetList.Add(otherRecAbleDataSet);
            }

            for (int i = 0; i < otherRecAbleDataSetList.Count; i++)
            {
                //分录
                FEntity fentry = new FEntity();
                //1.费用项目编码
                FCOSTID fCOSTID = new FCOSTID();
                fCOSTID.FNumber = otherRecAbleDataSetList[i].FCost;
                fentry.FCOSTID  = fCOSTID;
                //2.费用承担部门编码
                FCOSTDEPARTMENTID fCOSTDEPARTMENTID = new FCOSTDEPARTMENTID();
                fCOSTDEPARTMENTID.FNumber = otherRecAbleDataSetList[i].FCostDepartment;
                fentry.FCOSTDEPARTMENTID  = fCOSTDEPARTMENTID;
                //3.发票类型: 0普通发票;1 增值税发票
                fentry.FINVOICETYPE = otherRecAbleDataSetList[i].FInvoiceType;
                //4.税率(%)
                fentry.FEntryTaxRate = otherRecAbleDataSetList[i].FEntryTaxRate;
                //5. 不含税金额
                fentry.FNOTAXAMOUNTFOR = otherRecAbleDataSetList[i].FNoTaxAmountFor;
                //6.税额
                fentry.FTAXAMOUNTFOR = otherRecAbleDataSetList[i].FTaxAmountFor;
                //7.总金额
                fentry.FAMOUNTFOR_D = otherRecAbleDataSetList[i].FAmountFor;
                if (i + 1 < otherRecAbleDataSetList.Count)
                {
                    if (otherRecAbleDataSetList[i].FNumber != otherRecAbleDataSetList[i + 1].FNumber)
                    {
                        fentryList.Add(fentry);
                        OtherRecAbleInfoSaveObject otherRecAbleInfoSaveObject = new OtherRecAbleInfoSaveObject();
                        Model          model    = new Model();
                        List <FEntity> fEntityA = new List <FEntity>();
                        fEntityA.AddRange(fentryList);
                        model.FEntity = fEntityA;
                        //1.单据类型
                        FBillTypeID fBillTypeID = new FBillTypeID();
                        fBillTypeID.FNumber = "QTYSD01_SYS";
                        model.FBillTypeID   = fBillTypeID;
                        //2.单号
                        model.FBillNo = otherRecAbleDataSetList[i].FNumber;
                        //3.业务日期
                        model.FDate = otherRecAbleDataSetList[i].Fdate;
                        //4.到期日
                        model.FENDDATE_H = otherRecAbleDataSetList[i].FendDate;
                        //5. 到期日计算日期
                        model.FACCNTTIMEJUDGETIME = otherRecAbleDataSetList[i].FaccntTimeJudgeTime;
                        //6.往来单位类型:供应商、客户、员工、部门、其他往来单位
                        if (otherRecAbleDataSetList[i].FContactUnitType.Equals("供应商"))
                        {
                            model.FCONTACTUNITTYPE = "BD_Supplier";
                        }
                        if (otherRecAbleDataSetList[i].FContactUnitType.Equals("客户"))
                        {
                            model.FCONTACTUNITTYPE = "BD_Customer";
                        }
                        if (otherRecAbleDataSetList[i].FContactUnitType.Equals("员工"))
                        {
                            model.FCONTACTUNITTYPE = "BD_Empinfo";
                        }
                        if (otherRecAbleDataSetList[i].FContactUnitType.Equals("部门"))
                        {
                            model.FCONTACTUNITTYPE = "BD_Department";
                        }
                        if (otherRecAbleDataSetList[i].FContactUnitType.Equals("其他往来单位"))
                        {
                            model.FCONTACTUNITTYPE = "FIN_OTHERS";
                        }

                        //7.往来单位编码
                        FCONTACTUNIT fCONTACTUNIT = new FCONTACTUNIT();
                        fCONTACTUNIT.FNumber = otherRecAbleDataSetList[i].FContactUnit;
                        model.FCONTACTUNIT   = fCONTACTUNIT;
                        //8.币别
                        FCURRENCYID fCURRENCYID = new FCURRENCYID();
                        fCURRENCYID.FNumber = otherRecAbleDataSetList[i].FCurrency;
                        model.FCURRENCYID   = fCURRENCYID;
                        //9.结算组织
                        FSETTLEORGID fSETTLEORGID = new FSETTLEORGID();
                        fSETTLEORGID.FNumber = otherRecAbleDataSetList[i].FsettleOrg;
                        model.FSETTLEORGID   = fSETTLEORGID;
                        //10.收款组织
                        FPAYORGID fPAYORGID = new FPAYORGID();
                        fPAYORGID.FNumber = otherRecAbleDataSetList[i].FpayOrg;
                        model.FPAYORGID   = fPAYORGID;
                        ////11.总金额
                        //model.FAMOUNTFOR = otherRecAbleDataSetList[i].FAmountFor;
                        //12.本位币
                        //model.FMAINBOOKSTDCURRID=
                        model.FAR_OtherRemarks = otherRecAbleDataSetList[i].Fremark;
                        List <FEntity> fEntityB = new List <FEntity>();
                        fEntityB.AddRange(fentryList);
                        model.FEntity = fEntityB;
                        otherRecAbleInfoSaveObject.Model = model;
                        otherRecAbleSaveInfoObjList.Add(otherRecAbleInfoSaveObject);
                        fentryList.Clear();
                    }
                    else
                    {
                        fentryList.Add(fentry);
                    }
                }
                if (otherRecAbleDataSetList.Count == i + 1)
                {
                    OtherRecAbleInfoSaveObject otherRecAbleInfoSaveObject = new OtherRecAbleInfoSaveObject();
                    fentryList.Add(fentry);
                    Model model = new Model();

                    //1.单据类型
                    FBillTypeID fBillTypeID = new FBillTypeID();
                    fBillTypeID.FNumber = "QTYSD01_SYS";
                    model.FBillTypeID   = fBillTypeID;
                    //2.单号
                    model.FBillNo = otherRecAbleDataSetList[i].FNumber;
                    //3.业务日期
                    model.FDate = otherRecAbleDataSetList[i].Fdate;
                    //4.到期日
                    model.FENDDATE_H = otherRecAbleDataSetList[i].FendDate;
                    //5. 到期日计算日期
                    model.FACCNTTIMEJUDGETIME = otherRecAbleDataSetList[i].FaccntTimeJudgeTime;
                    //6.往来单位类型:供应商、客户、员工、部门、其他往来单位
                    if (otherRecAbleDataSetList[i].FContactUnitType.Equals("供应商"))
                    {
                        model.FCONTACTUNITTYPE = "BD_Supplier";
                    }
                    if (otherRecAbleDataSetList[i].FContactUnitType.Equals("客户"))
                    {
                        model.FCONTACTUNITTYPE = "BD_Customer";
                    }
                    if (otherRecAbleDataSetList[i].FContactUnitType.Equals("员工"))
                    {
                        model.FCONTACTUNITTYPE = "BD_Empinfo";
                    }
                    if (otherRecAbleDataSetList[i].FContactUnitType.Equals("部门"))
                    {
                        model.FCONTACTUNITTYPE = "BD_Department";
                    }
                    if (otherRecAbleDataSetList[i].FContactUnitType.Equals("其他往来单位"))
                    {
                        model.FCONTACTUNITTYPE = "FIN_OTHERS";
                    }
                    //7.往来单位编码
                    FCONTACTUNIT fCONTACTUNIT = new FCONTACTUNIT();
                    fCONTACTUNIT.FNumber = otherRecAbleDataSetList[i].FContactUnit;
                    model.FCONTACTUNIT   = fCONTACTUNIT;
                    //8.币别
                    FCURRENCYID fCURRENCYID = new FCURRENCYID();
                    fCURRENCYID.FNumber = otherRecAbleDataSetList[i].FCurrency;
                    model.FCURRENCYID   = fCURRENCYID;
                    //9.结算组织
                    FSETTLEORGID fSETTLEORGID = new FSETTLEORGID();
                    fSETTLEORGID.FNumber = otherRecAbleDataSetList[i].FsettleOrg;
                    model.FSETTLEORGID   = fSETTLEORGID;
                    //10.收款组织
                    FPAYORGID fPAYORGID = new FPAYORGID();
                    fPAYORGID.FNumber = otherRecAbleDataSetList[i].FpayOrg;
                    model.FPAYORGID   = fPAYORGID;
                    //11.总金额
                    // model.FAMOUNTFOR = otherRecAbleDataSetList[i].FAmountFor;
                    model.FAR_OtherRemarks = otherRecAbleDataSetList[i].Fremark;
                    List <FEntity> fEntityB = new List <FEntity>();
                    fEntityB.AddRange(fentryList);
                    model.FEntity = fEntityB;
                    otherRecAbleInfoSaveObject.Model = model;
                    otherRecAbleSaveInfoObjList.Add(otherRecAbleInfoSaveObject);
                }
            }
            return((List <T>)(object) otherRecAbleSaveInfoObjList);
        }