Пример #1
0
        public object[] Insert(IEntityBase value)
        {
            ESubsidio objE = (ESubsidio)value;

            //----------- Generacion de Codigos ------------------
            TablaCorre objDO = new TablaCorre();
            ETablaCorre objECorre = new ETablaCorre();

            objECorre.IdPeriodo = objE.IdPeriodo;
            objECorre.IdEmpresa = objE.IdEmpresa;
            objECorre.IdTabla = "RH_Subsidio";

            string strNewCode = objDO.GenNewCode(objECorre);
            objE.IdSubsidio = strNewCode;

            //----------------------------------------------------
            ArrayList arrPrm = BuildParamInterface(objE);

            try
            {
                int intRes = this.ExecuteNonQuery("RH_Subsidio_mnt01", arrPrm);

                return new object[] { objE.IdSubsidio };

            }
            catch (Exception ex)
            {

                ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
                throw objEx;

            }
        }
Пример #2
0
        public object[] Insert(IEntityBase value)
        {
            EPlanilla objE = (EPlanilla)value;

            //----------- Generacion de Codigos ------------------
            TablaCorre objDO = new TablaCorre();
            ETablaCorre objECorre = new ETablaCorre();
            objECorre.IdPeriodo = ConstDefaultValue.PERIODO;
            objECorre.IdEmpresa = ConstDefaultValue.EMPRESA;
            objECorre.IdTabla = "RH_Planilla";

            string strNewCode = objDO.GenNewCode(objECorre);
            objE.IdPlanilla = strNewCode;

            //----------------------------------------------------
            ArrayList arrPrm = BuildParamInterface(objE);

            try
            {
                int intRes = this.ExecuteNonQuery("RH_Planilla_mnt01", arrPrm);

                return new object[] { objE.IdPlanilla };

            }
            catch (Exception ex)
            {

                ServerObjectException objEx = (ServerObjectException)this.GetException(MethodBase.GetCurrentMethod(), ex);
                throw objEx;

            }
        }
Пример #3
0
        private ArrayList BuildParamInterface(ETablaCorre value)
        {
            ArrayList arrPrm = new ArrayList();

             arrPrm.Add(DataHelper.CreateParameter("@pidPeriodo", SqlDbType.Char, 4, value.IdPeriodo));
             arrPrm.Add(DataHelper.CreateParameter("@pidEmpresa", SqlDbType.Char, 3, value.IdEmpresa));
             arrPrm.Add(DataHelper.CreateParameter("@pidTabla", SqlDbType.VarChar, 30, value.IdTabla));
             arrPrm.Add(DataHelper.CreateParameter("@pnuIni", SqlDbType.Int, value.NuIni));
             arrPrm.Add(DataHelper.CreateParameter("@pnuFin", SqlDbType.Int, value.NuFin));
             arrPrm.Add(DataHelper.CreateParameter("@pnuIntervalo", SqlDbType.Int, value.NuIntervalo));
             arrPrm.Add(DataHelper.CreateParameter("@pnuUltGen", SqlDbType.Int, value.NuUltGen));
             arrPrm.Add(DataHelper.CreateParameter("@pdsFormato", SqlDbType.VarChar, 10, value.DsFormato));

             return arrPrm;
        }