/// <summary>
        /// Inserta un SALDOSSAP
        /// </summary>
        internal int Insert(Models.SALDOSSAP oSALDOSSAP)
        {
            try
            {
                SqlParameter[] dbparams = new SqlParameter[40] {
                    Param(enumDBFields.MANDT, oSALDOSSAP.MANDT),
                    Param(enumDBFields.BUKRS, oSALDOSSAP.BUKRS),
                    Param(enumDBFields.KUNNR, oSALDOSSAP.KUNNR),
                    Param(enumDBFields.AUGDT, oSALDOSSAP.AUGDT),
                    Param(enumDBFields.AUGBL, oSALDOSSAP.AUGBL),
                    Param(enumDBFields.AUGGJ, oSALDOSSAP.AUGGJ),
                    Param(enumDBFields.GJAHR, oSALDOSSAP.GJAHR),
                    Param(enumDBFields.BELNR, oSALDOSSAP.BELNR),
                    Param(enumDBFields.UMSKS, oSALDOSSAP.UMSKS),
                    Param(enumDBFields.UMSKZ, oSALDOSSAP.UMSKZ),
                    Param(enumDBFields.BUZEI, oSALDOSSAP.BUZEI),
                    Param(enumDBFields.ZUONR, oSALDOSSAP.ZUONR),
                    Param(enumDBFields.POSNR, oSALDOSSAP.POSNR),
                    Param(enumDBFields.PARVW, oSALDOSSAP.PARVW),
                    Param(enumDBFields.XBLNR, oSALDOSSAP.XBLNR),
                    Param(enumDBFields.VBELN, oSALDOSSAP.VBELN),
                    Param(enumDBFields.REBZG, oSALDOSSAP.REBZG),
                    Param(enumDBFields.LIFNR, oSALDOSSAP.LIFNR),
                    Param(enumDBFields.ZTERM, oSALDOSSAP.ZTERM),
                    Param(enumDBFields.FKDAT, oSALDOSSAP.FKDAT),
                    Param(enumDBFields.SHKZG, oSALDOSSAP.SHKZG),
                    Param(enumDBFields.DMBTR, oSALDOSSAP.DMBTR),
                    Param(enumDBFields.MWSKZ, oSALDOSSAP.MWSKZ),
                    Param(enumDBFields.MWSK1, oSALDOSSAP.MWSK1),
                    Param(enumDBFields.DMBT1, oSALDOSSAP.DMBT1),
                    Param(enumDBFields.MWSK2, oSALDOSSAP.MWSK2),
                    Param(enumDBFields.DMBT2, oSALDOSSAP.DMBT2),
                    Param(enumDBFields.MWSK3, oSALDOSSAP.MWSK3),
                    Param(enumDBFields.DMBT3, oSALDOSSAP.DMBT3),
                    Param(enumDBFields.SGTXT, oSALDOSSAP.SGTXT),
                    Param(enumDBFields.HKONT, oSALDOSSAP.HKONT),
                    Param(enumDBFields.BUDAT, oSALDOSSAP.BUDAT),
                    Param(enumDBFields.ZFBDT, oSALDOSSAP.ZFBDT),
                    Param(enumDBFields.ZBD1T, oSALDOSSAP.ZBD1T),
                    Param(enumDBFields.ZBD2T, oSALDOSSAP.ZBD2T),
                    Param(enumDBFields.ZBD3T, oSALDOSSAP.ZBD3T),
                    Param(enumDBFields.ZVENC, oSALDOSSAP.ZVENC),
                    Param(enumDBFields.BUSAB, oSALDOSSAP.BUSAB),
                    Param(enumDBFields.MANSP, oSALDOSSAP.MANSP),
                    Param(enumDBFields.ZLSCH, oSALDOSSAP.ZLSCH)
                };

                return((int)cDblib.Execute("SUP_SALDOSSAP_INS", dbparams));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int Insert(Models.SALDOSSAP oSALDOSSAP)
        {
            Guid methodOwnerID = new Guid("00e023c4-b023-40c9-a0a9-35babef8c832");

            OpenDbConn();

            if (cDblib.Transaction.ownerID.Equals(new Guid()))
            {
                cDblib.beginTransaction(methodOwnerID);
            }

            try
            {
                DAL.SALDOSSAP cSALDOSSAP = new DAL.SALDOSSAP(cDblib);

                int idSALDOSSAP = cSALDOSSAP.Insert(oSALDOSSAP);

                //Finalizar transacción
                if (cDblib.Transaction.ownerID.Equals(methodOwnerID))
                {
                    cDblib.commitTransaction(methodOwnerID);
                }

                return(idSALDOSSAP);
            }
            catch (Exception ex)
            {
                //rollback
                //if (cDblib.Transaction.ownerID.Equals(new Guid())) cDblib.rollbackTransaction(methodOwnerID);
                if (cDblib.Transaction.ownerID.Equals(methodOwnerID))
                {
                    cDblib.rollbackTransaction(methodOwnerID);
                }
                throw ex;
            }
        }
        /// <summary>
        /// Obtiene todos los SALDOSSAP
        /// </summary>
        internal List <Models.SALDOSSAP> Catalogo()
        {
            Models.SALDOSSAP        oSALDOSSAP = null;
            List <Models.SALDOSSAP> lst        = new List <Models.SALDOSSAP>();
            IDataReader             dr         = null;

            try
            {
                SqlParameter[] dbparams = new SqlParameter[0] {
                };

                dr = cDblib.DataReader("SUP_SALDOSSAP_CAT", dbparams);
                while (dr.Read())
                {
                    oSALDOSSAP = new Models.SALDOSSAP();
                    if (!Convert.IsDBNull(dr["MANDT"]))
                    {
                        oSALDOSSAP.MANDT = Convert.ToString(dr["MANDT"]);
                    }
                    if (!Convert.IsDBNull(dr["BUKRS"]))
                    {
                        oSALDOSSAP.BUKRS = Convert.ToString(dr["BUKRS"]);
                    }
                    if (!Convert.IsDBNull(dr["KUNNR"]))
                    {
                        oSALDOSSAP.KUNNR = Convert.ToString(dr["KUNNR"]);
                    }
                    if (!Convert.IsDBNull(dr["AUGDT"]))
                    {
                        oSALDOSSAP.AUGDT = Convert.ToString(dr["AUGDT"]);
                    }
                    if (!Convert.IsDBNull(dr["AUGBL"]))
                    {
                        oSALDOSSAP.AUGBL = Convert.ToString(dr["AUGBL"]);
                    }
                    if (!Convert.IsDBNull(dr["AUGGJ"]))
                    {
                        oSALDOSSAP.AUGGJ = Convert.ToString(dr["AUGGJ"]);
                    }
                    if (!Convert.IsDBNull(dr["GJAHR"]))
                    {
                        oSALDOSSAP.GJAHR = Convert.ToString(dr["GJAHR"]);
                    }
                    if (!Convert.IsDBNull(dr["BELNR"]))
                    {
                        oSALDOSSAP.BELNR = Convert.ToString(dr["BELNR"]);
                    }
                    if (!Convert.IsDBNull(dr["UMSKS"]))
                    {
                        oSALDOSSAP.UMSKS = Convert.ToString(dr["UMSKS"]);
                    }
                    if (!Convert.IsDBNull(dr["UMSKZ"]))
                    {
                        oSALDOSSAP.UMSKZ = Convert.ToString(dr["UMSKZ"]);
                    }
                    if (!Convert.IsDBNull(dr["BUZEI"]))
                    {
                        oSALDOSSAP.BUZEI = Convert.ToString(dr["BUZEI"]);
                    }
                    if (!Convert.IsDBNull(dr["ZUONR"]))
                    {
                        oSALDOSSAP.ZUONR = Convert.ToString(dr["ZUONR"]);
                    }
                    if (!Convert.IsDBNull(dr["POSNR"]))
                    {
                        oSALDOSSAP.POSNR = Convert.ToString(dr["POSNR"]);
                    }
                    if (!Convert.IsDBNull(dr["PARVW"]))
                    {
                        oSALDOSSAP.PARVW = Convert.ToString(dr["PARVW"]);
                    }
                    if (!Convert.IsDBNull(dr["XBLNR"]))
                    {
                        oSALDOSSAP.XBLNR = Convert.ToString(dr["XBLNR"]);
                    }
                    if (!Convert.IsDBNull(dr["VBELN"]))
                    {
                        oSALDOSSAP.VBELN = Convert.ToString(dr["VBELN"]);
                    }
                    if (!Convert.IsDBNull(dr["REBZG"]))
                    {
                        oSALDOSSAP.REBZG = Convert.ToString(dr["REBZG"]);
                    }
                    if (!Convert.IsDBNull(dr["LIFNR"]))
                    {
                        oSALDOSSAP.LIFNR = Convert.ToString(dr["LIFNR"]);
                    }
                    if (!Convert.IsDBNull(dr["ZTERM"]))
                    {
                        oSALDOSSAP.ZTERM = Convert.ToString(dr["ZTERM"]);
                    }
                    if (!Convert.IsDBNull(dr["FKDAT"]))
                    {
                        oSALDOSSAP.FKDAT = Convert.ToString(dr["FKDAT"]);
                    }
                    if (!Convert.IsDBNull(dr["SHKZG"]))
                    {
                        oSALDOSSAP.SHKZG = Convert.ToString(dr["SHKZG"]);
                    }
                    if (!Convert.IsDBNull(dr["DMBTR"]))
                    {
                        oSALDOSSAP.DMBTR = (decimal)dr["DMBTR"];
                    }
                    if (!Convert.IsDBNull(dr["MWSKZ"]))
                    {
                        oSALDOSSAP.MWSKZ = Convert.ToString(dr["MWSKZ"]);
                    }
                    if (!Convert.IsDBNull(dr["MWSK1"]))
                    {
                        oSALDOSSAP.MWSK1 = Convert.ToString(dr["MWSK1"]);
                    }
                    if (!Convert.IsDBNull(dr["DMBT1"]))
                    {
                        oSALDOSSAP.DMBT1 = (decimal)dr["DMBT1"];
                    }
                    if (!Convert.IsDBNull(dr["MWSK2"]))
                    {
                        oSALDOSSAP.MWSK2 = Convert.ToString(dr["MWSK2"]);
                    }
                    if (!Convert.IsDBNull(dr["DMBT2"]))
                    {
                        oSALDOSSAP.DMBT2 = (decimal)dr["DMBT2"];
                    }
                    if (!Convert.IsDBNull(dr["MWSK3"]))
                    {
                        oSALDOSSAP.MWSK3 = Convert.ToString(dr["MWSK3"]);
                    }
                    if (!Convert.IsDBNull(dr["DMBT3"]))
                    {
                        oSALDOSSAP.DMBT3 = (decimal)dr["DMBT3"];
                    }
                    if (!Convert.IsDBNull(dr["SGTXT"]))
                    {
                        oSALDOSSAP.SGTXT = Convert.ToString(dr["SGTXT"]);
                    }
                    if (!Convert.IsDBNull(dr["HKONT"]))
                    {
                        oSALDOSSAP.HKONT = Convert.ToString(dr["HKONT"]);
                    }
                    if (!Convert.IsDBNull(dr["BUDAT"]))
                    {
                        oSALDOSSAP.BUDAT = Convert.ToString(dr["BUDAT"]);
                    }
                    if (!Convert.IsDBNull(dr["ZFBDT"]))
                    {
                        oSALDOSSAP.ZFBDT = Convert.ToString(dr["ZFBDT"]);
                    }
                    if (!Convert.IsDBNull(dr["ZBD1T"]))
                    {
                        oSALDOSSAP.ZBD1T = (decimal)dr["ZBD1T"];
                    }
                    if (!Convert.IsDBNull(dr["ZBD2T"]))
                    {
                        oSALDOSSAP.ZBD2T = (decimal)dr["ZBD2T"];
                    }
                    if (!Convert.IsDBNull(dr["ZBD3T"]))
                    {
                        oSALDOSSAP.ZBD3T = (decimal)dr["ZBD3T"];
                    }
                    if (!Convert.IsDBNull(dr["ZVENC"]))
                    {
                        oSALDOSSAP.ZVENC = Convert.ToString(dr["ZVENC"]);
                    }
                    if (!Convert.IsDBNull(dr["BUSAB"]))
                    {
                        oSALDOSSAP.BUSAB = Convert.ToString(dr["BUSAB"]);
                    }
                    if (!Convert.IsDBNull(dr["MANSP"]))
                    {
                        oSALDOSSAP.MANSP = Convert.ToString(dr["MANSP"]);
                    }
                    if (!Convert.IsDBNull(dr["ZLSCH"]))
                    {
                        oSALDOSSAP.ZLSCH = Convert.ToString(dr["ZLSCH"]);
                    }

                    lst.Add(oSALDOSSAP);
                }
                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    if (!dr.IsClosed)
                    {
                        dr.Close();
                    }
                    dr.Dispose();
                }
            }
        }