Exemple #1
0
        public DataSet ListaServicios(int codID, ref string codPlan, ref string desPlan)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("p_co_id",  DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("p_tmcode", DbType.String, ParameterDirection.Output),
                new DAABRequest.Parameter("p_tmdes",  DbType.String, ParameterDirection.Output),
                new DAABRequest.Parameter("p_cursor", DbType.Object, ParameterDirection.Output),
                new DAABRequest.Parameter("v_errnum", DbType.Int64,  ParameterDirection.Output),
                new DAABRequest.Parameter("v_errmsj", DbType.String, ParameterDirection.Output)
            };

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

            arrParam[0].Value = codID;

            BDBSCS      obj       = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.SP_LISTA_SERVICIOS;
            obRequest.Parameters.AddRange(arrParam);


            DataSet ds = null;

            try
            {
                ds = obRequest.Factory.ExecuteDataset(ref obRequest);

                IDataParameter pSalida1;
                IDataParameter pSalida2;
                pSalida1 = (IDataParameter)obRequest.Parameters[1];
                codPlan  = Funciones.CheckStr(pSalida1.Value);

                pSalida2 = (IDataParameter)obRequest.Parameters[2];
                desPlan  = Funciones.CheckStr(pSalida2.Value);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                obRequest.Parameters.Clear();
                obRequest.Factory.Dispose();
            }
            return(ds);
        }
Exemple #2
0
        //****************************************** INICIO WHZR ********************************************//

        public int ValidarPlanesLTG4G(string pstrNumLinea, ref string strMSG)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_MSISDN",    DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_COD_PROD",  DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_RESULTADO", DbType.Int32,  ParameterDirection.Output),
                new DAABRequest.Parameter("P_MSGERR",    DbType.String, ParameterDirection.Output)
            };
            int i;

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

            arrParam[0].Value = pstrNumLinea;

            int         retorno   = 0;
            BDBSCS      obj       = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.TIM150_VAL_SALE_4G;
            obRequest.Parameters.AddRange(arrParam);
            obRequest.Transactional = true;

            try
            {
                obRequest.Factory.ExecuteNonQuery(ref obRequest);
                obRequest.Factory.CommitTransaction();

                IDataParameter parRetorno;
                parRetorno = (IDataParameter)obRequest.Parameters[1];
                retorno    = Funciones.CheckInt(parRetorno.Value);

                parRetorno = (IDataParameter)obRequest.Parameters[2];
                strMSG     = Funciones.CheckStr(parRetorno.Value);
            }
            catch (Exception ex)
            {
                retorno = 0;
                obRequest.Factory.RollBackTransaction();
                throw ex;
            }
            finally
            {
                obRequest.Factory.Dispose();
                obRequest.Parameters.Clear();
            }
            return(retorno);
        }
Exemple #3
0
        public ArrayList Listar_LineasActivas(int intTipDoc, string strDocumento)
        {
            DAABRequest.Parameter[] arrParam = { new DAABRequest.Parameter("P_TIPO_DOC",   DbType.Int32,  ParameterDirection.Input),
                                                 new DAABRequest.Parameter("P_DOCUMENTO",  DbType.String, ParameterDirection.Input),
                                                 new DAABRequest.Parameter("CUR_TELEFONO", DbType.Object, ParameterDirection.Output),
                                                 new DAABRequest.Parameter("P_COD_RESULT", DbType.Int32,  ParameterDirection.Output),
                                                 new DAABRequest.Parameter("P_DES_RESULT", DbType.String, ParameterDirection.Output) };

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

            arrParam[0].Value = intTipDoc;
            arrParam[1].Value = strDocumento;

            BDBSCS      obj       = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.BSCS_LINEAS_ACTIVAS;
            obRequest.Parameters.AddRange(arrParam);

            ArrayList   filas = new ArrayList();
            IDataReader dr    = null;

            try
            {
                dr = obRequest.Factory.ExecuteReader(ref obRequest).ReturnDataReader;
                while (dr.Read())
                {
                    ItemGenerico item = new ItemGenerico();
                    item.Codigo      = Funciones.CheckStr(dr["telefono"]);
                    item.Descripcion = Funciones.CheckStr(dr["telefono"]);
                    filas.Add(item);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (dr != null && dr.IsClosed == false)
                {
                    dr.Close();
                }
                obRequest.Parameters.Clear();
                obRequest.Factory.Dispose();
            }
            return(filas);
        }
        /* -----------------------------------------------------------------------------------
         * Objetivo : Permite insertar un ajuste por reclamo
         * Creación : E77281  / 15-10-2012
         * -----------------------------------------------------------------------------------*/
        public Int32 InsertarAjustesXReclamos(Int64 vCUSTOMERID, string vCodOCC, string vFecha, string vPeriodo, double vMonto, string vComentario)
        {
            Int32 iRetorno = 0;

            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("p_CodCli", DbType.Int64,  vCUSTOMERID, ParameterDirection.Input),
                new DAABRequest.Parameter("p_CodOCC", DbType.String, vCodOCC,     ParameterDirection.Input),
                new DAABRequest.Parameter("p_FecVig", DbType.String, vFecha,      ParameterDirection.Input),
                new DAABRequest.Parameter("p_NumCuo", DbType.String, vPeriodo,    ParameterDirection.Input),
                new DAABRequest.Parameter("p_Monto",  DbType.Double, vMonto,      ParameterDirection.Input),
                new DAABRequest.Parameter("p_Coment", DbType.String, vComentario, ParameterDirection.Input),
                new DAABRequest.Parameter("p_Result", DbType.Int32,  ParameterDirection.Output)
            };

            BDBSCS objBSCS = new BDBSCS(BaseDatos.BD_BSCS);

            DAABRequest obRequest = objBSCS.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.NOMBRE_PACKAGE_BSCS_SIAC_TRAN + ".sp_insert_occ";
            obRequest.Parameters.AddRange(arrParam);

            try
            {
                obRequest.Factory.ExecuteNonQuery(ref obRequest);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                IDataParameter parSalida1;
                parSalida1 = (IDataParameter)obRequest.Parameters[obRequest.Parameters.Count - 1];
                iRetorno   = (Int32)parSalida1.Value;
                obRequest.Factory.Dispose();
            }
            return(iRetorno);
        }
Exemple #5
0
//fin gaa20130724
//gaa20131104
        public DataTable ListarPlanServicioBSCS(string pstrPlanCodigo)
        {
            DataTable dtResultado = new DataTable();

            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("p_co_plan", DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("p_co_paq",  DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("p_co_ser",  DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("p_cursor",  DbType.Object, ParameterDirection.Output)
            };
            for (int i = 0; i < arrParam.Length; i++)
            {
                arrParam[i].Value = DBNull.Value;
            }

            arrParam[0].Value = pstrPlanCodigo;

            BDBSCS      oBDBSCS      = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest oDAABRequest = oBDBSCS.CreaRequest();

            oDAABRequest.CommandType = CommandType.StoredProcedure;
            oDAABRequest.Command     = "tim.pp006_sisact.sp_consultar_asocplanxserv";
            oDAABRequest.Parameters.AddRange(arrParam);

            try
            {
                dtResultado = oDAABRequest.Factory.ExecuteDataset(ref oDAABRequest).Tables[0];
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                oDAABRequest.Parameters.Clear();
                oDAABRequest.Factory.Dispose();
            }
            return(dtResultado);
        }
Exemple #6
0
        // FES *****


        public Boolean ConsultaStatusContrato(int p_co_id, ref string estadoContrato, ref string estadoBloqueo)
        {
            Boolean resultado = false;

            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_CO_ID",     DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_CH_STATUS", DbType.String, ParameterDirection.Output),
                new DAABRequest.Parameter("P_BLOQ",      DbType.String, ParameterDirection.Output)
            };

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

            if (p_co_id != 1)
            {
                arrParam[0].Value = p_co_id;
            }

            String strEsquemaBSCS = System.Configuration.ConfigurationSettings.AppSettings["EsquemaBSCS"];

            BDBSCS      obj       = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;

            if (strEsquemaBSCS == "")
            {
                obRequest.Command = "TIM114_GET_STATUS_COID";
            }
            else
            {
                obRequest.Command = strEsquemaBSCS + ".TIM114_GET_STATUS_COID";
            }


            obRequest.Parameters.AddRange(arrParam);

            try
            {
                obRequest.Factory.ExecuteNonQuery(ref obRequest);
                resultado = true;
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                IDataParameter parSalida1;
                parSalida1     = (IDataParameter)obRequest.Parameters[1];
                estadoContrato = Funciones.CheckStr(parSalida1.Value);


                IDataParameter parSalida2;
                parSalida2    = (IDataParameter)obRequest.Parameters[2];
                estadoBloqueo = Funciones.CheckStr(parSalida2.Value);

                obRequest.Parameters.Clear();
                obRequest.Factory.Dispose();
            }

            return(resultado);
        }
Exemple #7
0
        public string ConsultaLineaBloqueada(int p_co_id, int p_sncode)
        {
            String resultado = "";

            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_CO_ID",  DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_SNCODE", DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("P_ESTADO", DbType.String, ParameterDirection.Output)
            };

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

            if (p_co_id != 1)
            {
                arrParam[0].Value = p_co_id;
            }
            if (p_sncode != 1)
            {
                arrParam[1].Value = p_sncode;
            }

            String strEsquemaBSCS = System.Configuration.ConfigurationSettings.AppSettings["EsquemaBSCS"];

            BDBSCS      obj       = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;

            if (strEsquemaBSCS == "")
            {
                obRequest.Command = "tim075_estado_servicio";
            }
            else
            {
                obRequest.Command = strEsquemaBSCS + ".tim075_estado_servicio";
            }


            obRequest.Parameters.AddRange(arrParam);

            try
            {
                obRequest.Factory.ExecuteNonQuery(ref obRequest);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                IDataParameter parSalida1;
                parSalida1 = (IDataParameter)obRequest.Parameters[2];
                resultado  = Funciones.CheckStr(parSalida1.Value);

                obRequest.Parameters.Clear();
                obRequest.Factory.Dispose();
            }

            return(resultado);
        }
Exemple #8
0
        public ArrayList ConsultaLineaBloqueada(string flag_buscar, string p_condicion, int p_tipo_doc)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_FLAG_BUSCAR", DbType.String,                         1, ParameterDirection.Input),
                new DAABRequest.Parameter("P_CONDICION",   DbType.String,                        15, ParameterDirection.Input),
                new DAABRequest.Parameter("P_TIPO_DOC",    DbType.Int64,  ParameterDirection.Input),
                new DAABRequest.Parameter("CUR_TELEFONO",  DbType.Object, ParameterDirection.Output)
            };

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

            if (flag_buscar != "")
            {
                arrParam[0].Value = flag_buscar;
            }
            if (p_condicion != "")
            {
                arrParam[1].Value = p_condicion;
            }
            if (p_tipo_doc != 1)
            {
                arrParam[2].Value = p_tipo_doc;
            }


            BDBSCS      obj       = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;
            obRequest.Command     = BaseDatos.PKG_BSCS_PARAMETRICO_BLOQUEO + ".BUSCAR_TELEFONO_BLOQUEO";
            obRequest.Parameters.AddRange(arrParam);

            ArrayList   filas = new ArrayList();
            IDataReader dr    = null;

            try
            {
                dr = obRequest.Factory.ExecuteReader(ref obRequest).ReturnDataReader;
                while (dr.Read())
                {
                    ItemGenerico item = new ItemGenerico();
                    item.Codigo      = Funciones.CheckStr(dr["TICKLER_CODE"]);
                    item.Descripcion = Funciones.CheckStr(dr["SHORT_DESCRIPTION"]);
                    filas.Add(item);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (dr != null && dr.IsClosed == false)
                {
                    dr.Close();
                }
                obRequest.Parameters.Clear();
                obRequest.Factory.Dispose();
            }
            return(filas);
        }
Exemple #9
0
        public ArrayList BuscarClienteCompletoDes(string strFlagBuscar, string strCondicion, int inttipodoc)
        {
            DAABRequest.Parameter[] arrParam =
            {
                new DAABRequest.Parameter("P_FLAG_BUSCAR", DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_CONDICION",   DbType.String, ParameterDirection.Input),
                new DAABRequest.Parameter("P_TIPO_DOC",    DbType.Int16,  ParameterDirection.Input),
                new DAABRequest.Parameter("CUR_Cliente",   DbType.Object, ParameterDirection.Output),
                new DAABRequest.Parameter("CUR_Cliente2",  DbType.Object, ParameterDirection.Output),
                new DAABRequest.Parameter("CUR_Cliente3",  DbType.Object, ParameterDirection.Output),
                new DAABRequest.Parameter("CUR_Cliente4",  DbType.Object, ParameterDirection.Output)
            };

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

            arrParam[0].Value = strFlagBuscar;
            arrParam[1].Value = strCondicion;
            arrParam[2].Value = inttipodoc;

            BDBSCS      obj       = new BDBSCS(BaseDatos.BD_BSCS);
            DAABRequest obRequest = obj.CreaRequest();

            obRequest.CommandType = CommandType.StoredProcedure;

            obRequest.Command = BaseDatos.PKG_BSCS_CONSULTA_CONS + ".BUSCAR_CLIENTE_COMPLETO";

            obRequest.Parameters.AddRange(arrParam);
            ArrayList lisRetorno = new ArrayList();
            DataSet   ds         = new DataSet();

            try
            {
                ds = obRequest.Factory.ExecuteDataset(ref obRequest);
                foreach (DataTable ItemTabla in ds.Tables)
                {
                    ArrayList arraTabla = new ArrayList();
                    foreach (DataRow dr in ItemTabla.Rows)
                    {
                        Cliente_Cons objDatoCliente_Cons = new Cliente_Cons();
                        foreach (DataColumn dc in ItemTabla.Columns)
                        {
                            //APLICAMOS Reflection para el llenado de los campos disponibles en la clase
                            MemberInfo[] objMiembro = objDatoCliente_Cons.GetType().GetMember(dc.ColumnName);                           // Nos aseguramos que el campo exista como Miembro de la clase
                            if (objMiembro.Length > 0)
                            {
                                PropertyInfo objpropiedad = objDatoCliente_Cons.GetType().GetProperty(dc.ColumnName);
                                if (dr[dc.ColumnName] != DBNull.Value)                               //Revisamos que el contenido del campo tenga un valor
                                {
                                    Object objDatoNuevo;
                                    switch (objpropiedad.PropertyType.ToString())
                                    {
                                    case "System.Int64": objDatoNuevo = Convert.ToInt64(dr[dc.ColumnName]);
                                        break;

                                    case "System.String": objDatoNuevo = Convert.ToString(dr[dc.ColumnName]);
                                        break;

                                    case "System.Double": objDatoNuevo = Convert.ToDouble(dr[dc.ColumnName]);
                                        break;

                                    default: objDatoNuevo = Convert.ToInt16(dr[dc.ColumnName]);
                                        break;
                                    }
                                    objpropiedad.SetValue(objDatoCliente_Cons, objDatoNuevo, null);
                                }
                            }
                            else
                            {
                                //Punto que identifica los miembros inexistentes: Aqui se debe implementar en caso sea necesario un error controlado para el mantenimiento.
                            }
                        }
                        arraTabla.Add(objDatoCliente_Cons);
                    }
                    lisRetorno.Add(arraTabla);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                ds.Dispose();
                obRequest.Parameters.Clear();
                obRequest.Factory.Dispose();
            }
            return(lisRetorno);
        }