示例#1
0
        public bool InsertarVas(ServicioVas objDetalle)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("K_RESULTADO",          DbType.Int64,  ParameterDirection.Output),
                new DAABRequest.Parameter("P_VSERC_CLIE_TIP_DOC", DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERV_CLIE_DOC",     DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERV_CLIE_TELF",    DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERN_COD_PAQ",      DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERV_DIR_EMAIL",    DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERN_COD_PROV",     DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERN_COD_VAS",      DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERV_USU_CREA",     DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERN_COS_SERV",     DbType.Double, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERV_FRECUENCIA",   DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERC_FLAG_ACT",     DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_VSERC_FLAG_TIPF",    DbType.String, ParameterDirection.Input)
            };

            for (int i = 0; i < arrParam.Length; i++)
            {
                arrParam[i].Value = DBNull.Value;
            }

            arrParam[1].Value  = objDetalle.VSERC_CLIE_TIP_DOC;
            arrParam[2].Value  = objDetalle.VSERV_CLIE_DOC;
            arrParam[3].Value  = objDetalle.VSERV_CLIE_TELF;
            arrParam[4].Value  = objDetalle.VSERN_COD_PAQ;
            arrParam[5].Value  = objDetalle.VSERV_DIR_EMAIL;
            arrParam[6].Value  = objDetalle.VSERN_COD_PROV;
            arrParam[7].Value  = objDetalle.VSERN_COD_VAS;
            arrParam[8].Value  = objDetalle.VSERV_USU_CREA;
            arrParam[9].Value  = objDetalle.VSERN_COS_SERV;
            arrParam[10].Value = objDetalle.VSERV_FRECUENCIA;
            arrParam[11].Value = objDetalle.VSERC_FLAG_ACT;
            arrParam[12].Value = objDetalle.VSERC_FLAG_TIPF;

            bool salida = false;

            BDSISACT    obj       = new BDSISACT(BaseDatos.BD_SISACT);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.PKG_SISACT_SERVICIO_VAS + ".SISACT_INS_ACTIVACION_VAS";
            obRequest.Parameters.AddRange(arrParam);
            obRequest.Transactional = true;
            try
            {
                obRequest.Factory.ExecuteNonQuery(ref obRequest);
                obRequest.Factory.CommitTransaction();
                salida = true;
            }
            catch (Exception ex)
            {
                obRequest.Factory.RollBackTransaction();
                throw ex;
            }
            finally
            {
                IDataParameter pSalida1;
                pSalida1 = (IDataParameter)obRequest.Parameters[0];
                obRequest.Factory.Dispose();
            }
            return(salida);
        }
示例#2
0
        public bool InsertarVas(ServicioVas objDetalle)
        {
            ServicioVasDatos obj = new ServicioVasDatos();

            return(obj.InsertarVas(objDetalle));
        }