Ejemplo n.º 1
0
            public Clempresas seleccionarUno(Clempresas x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion SELECT y retorna un campo desde una operacion en SP_ADM_EMPRESAS"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();

                DataTable dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_adm_empresas", parametros(x, operacion));

                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows[0]["emp_direccion"] != DBNull.Value)
                        {
                            x.direccion = (string)dt.Rows[0]["emp_direccion"];
                        }
                        if (dt.Rows[0]["emp_nombre"] != DBNull.Value)
                        {
                            x.nombre = (string)dt.Rows[0]["emp_nombre"];
                        }
                        if (dt.Rows[0]["emp_telefono"] != DBNull.Value)
                        {
                            x.telefono = (string)dt.Rows[0]["emp_telefono"];
                        }
                        if (dt.Rows[0]["emp_email"] != DBNull.Value)
                        {
                            x.email = (string)dt.Rows[0]["emp_email"];
                        }
                        if (dt.Rows[0]["emp_activo"] != DBNull.Value)
                        {
                            x.activo = (int)dt.Rows[0]["emp_activo"];
                        }
                        if (dt.Rows[0]["emp_id"] != DBNull.Value)
                        {
                            x.id = (int)dt.Rows[0]["emp_id"];
                        }
                        return(x);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }
Ejemplo n.º 2
0
            public Cleventos seleccionarUno(Cleventos x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion SELECT y retorna un campo desde una operacion en SP_ADM_EVENTOS"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();

                DataTable dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_adm_eventos", parametros(x, operacion));

                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows[0]["eve_fecha_creacion"] != DBNull.Value)
                        {
                            x.fecha_creacion = (DateTime)dt.Rows[0]["eve_fecha_creacion"];
                        }
                        if (dt.Rows[0]["eve_fecha_evento"] != DBNull.Value)
                        {
                            x.fecha_evento = (DateTime)dt.Rows[0]["eve_fecha_evento"];
                        }
                        if (dt.Rows[0]["eve_id"] != DBNull.Value)
                        {
                            x.id = (int)dt.Rows[0]["eve_id"];
                        }
                        if (dt.Rows[0]["eve_descripcion"] != DBNull.Value)
                        {
                            x.descripcion = (string)dt.Rows[0]["eve_descripcion"];
                        }
                        if (dt.Rows[0]["eve_propiedad"] != DBNull.Value)
                        {
                            x.propiedad = (int)dt.Rows[0]["eve_propiedad"];
                        }
                        if (dt.Rows[0]["eve_activo"] != DBNull.Value)
                        {
                            x.activo = (int)dt.Rows[0]["eve_activo"];
                        }
                        return(x);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }
Ejemplo n.º 3
0
            public Clpais seleccionarUno(Clpais x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion SELECT y retorna un campo desde una operacion en SP_SYS_PAIS"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();

                DataTable dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_sys_pais", parametros(x, operacion));

                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows[0]["pai_codigo"] != DBNull.Value)
                        {
                            x.codigo = (string)dt.Rows[0]["pai_codigo"];
                        }
                        if (dt.Rows[0]["pai_activo"] != DBNull.Value)
                        {
                            x.activo = (int)dt.Rows[0]["pai_activo"];
                        }
                        if (dt.Rows[0]["pai_abreviatura"] != DBNull.Value)
                        {
                            x.abreviatura = (string)dt.Rows[0]["pai_abreviatura"];
                        }
                        if (dt.Rows[0]["pai_id"] != DBNull.Value)
                        {
                            x.id = (int)dt.Rows[0]["pai_id"];
                        }
                        if (dt.Rows[0]["pai_descripcion"] != DBNull.Value)
                        {
                            x.descripcion = (string)dt.Rows[0]["pai_descripcion"];
                        }
                        return(x);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }
Ejemplo n.º 4
0
            public Clticket_persona seleccionarUno(Clticket_persona x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion SELECT y retorna un campo desde una operacion en SP_ADM_TICKET_PERSONA"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();

                DataTable dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_adm_ticket_persona", parametros(x, operacion));

                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows[0]["tpe_id"] != DBNull.Value)
                        {
                            x.id = (int)dt.Rows[0]["tpe_id"];
                        }
                        if (dt.Rows[0]["tpe_usuario"] != DBNull.Value)
                        {
                            x.usuario = (int)dt.Rows[0]["tpe_usuario"];
                        }
                        if (dt.Rows[0]["tpe_persona"] != DBNull.Value)
                        {
                            x.persona = (int)dt.Rows[0]["tpe_persona"];
                        }
                        if (dt.Rows[0]["tpe_ticket"] != DBNull.Value)
                        {
                            x.ticket = (int)dt.Rows[0]["tpe_ticket"];
                        }
                        if (dt.Rows[0]["tpe_fecha_envio"] != DBNull.Value)
                        {
                            x.fecha_envio = (int)dt.Rows[0]["tpe_fecha_envio"];
                        }
                        return(x);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }
Ejemplo n.º 5
0
            public int ejecutar(Clpropiedad x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion de INSERTAR, ACTUALIZAR O ELIMINAR desde una operacion en SP_ADM_PROPIEDAD"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();
                try
                {
                    return(md.modificarTabla("sp_adm_propiedad", parametros(x, operacion)));
                }
                catch (Exception)
                {
                    throw;
                }
            }
Ejemplo n.º 6
0
            public int ejecutar(Cltipo_ticket x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion de INSERTAR, ACTUALIZAR O ELIMINAR desde una operacion en SP_SYS_TIPO_TICKET"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();
                try
                {
                    return(md.modificarTabla("sp_sys_tipo_ticket", parametros(x, operacion)));
                }
                catch (Exception)
                {
                    throw;
                }
            }
Ejemplo n.º 7
0
            public Cl_personas seleccionarUno(Cl_personas x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion SELECT y retorna un campo desde una operacion en SP_TIPO_PERSONAS"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();

                DataTable dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_tipo_personas", parametros(x, operacion));

                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows[0]["tus_activo"] != DBNull.Value)
                        {
                            x.activo = (int)dt.Rows[0]["tus_activo"];
                        }
                        if (dt.Rows[0]["tus_id"] != DBNull.Value)
                        {
                            x.id = (int)dt.Rows[0]["tus_id"];
                        }
                        if (dt.Rows[0]["tus_descripcion"] != DBNull.Value)
                        {
                            x.descripcion = (string)dt.Rows[0]["tus_descripcion"];
                        }
                        return(x);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }
Ejemplo n.º 8
0
            public DataTable seleccionarTodos(Clpropiedad x, int operacion = 0)
            {
                /// <summary>
                ///     Retorna un DataTable de una funcion SELECT en una operacion desde SP_ADM_PROPIEDAD"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();
                DataTable             dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_adm_propiedad", parametros(x, operacion));
                    return(dt);
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }
Ejemplo n.º 9
0
            public DataTable seleccionarTodos(Cltipo_ticket x, int operacion = 0)
            {
                /// <summary>
                ///     Retorna un DataTable de una funcion SELECT en una operacion desde SP_SYS_TIPO_TICKET"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();
                DataTable             dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_sys_tipo_ticket", parametros(x, operacion));
                    return(dt);
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }
Ejemplo n.º 10
0
            public Clpersonas seleccionarUno(Clpersonas x, int operacion = 0)
            {
                /// <summary>
                ///     Ejecuta una funcion SELECT y retorna un campo desde una operacion en SP_ADM_PERSONAS"
                /// </summary>
                /// <param name="x"></param>
                /// <param name="operacion"></param>

                Layer_Data.mdConexion md = new Layer_Data.mdConexion();

                DataTable dt = new DataTable();

                try
                {
                    dt = md.ejecutarStoredProcedure("sp_adm_personas", parametros(x, operacion));

                    if (dt.Rows.Count > 0)
                    {
                        if (dt.Rows[0]["per_tipo_persona"] != DBNull.Value)
                        {
                            x.tipo_persona = (int)dt.Rows[0]["per_tipo_persona"];
                        }
                        if (dt.Rows[0]["per_pais"] != DBNull.Value)
                        {
                            x.pais = (int)dt.Rows[0]["per_pais"];
                        }
                        if (dt.Rows[0]["per_identificacion"] != DBNull.Value)
                        {
                            x.identificacion = (string)dt.Rows[0]["per_identificacion"];
                        }
                        if (dt.Rows[0]["per_ciudad"] != DBNull.Value)
                        {
                            x.ciudad = (int)dt.Rows[0]["per_ciudad"];
                        }
                        if (dt.Rows[0]["per_nombre"] != DBNull.Value)
                        {
                            x.nombre = (string)dt.Rows[0]["per_nombre"];
                        }
                        if (dt.Rows[0]["per_correo"] != DBNull.Value)
                        {
                            x.correo = (string)dt.Rows[0]["per_correo"];
                        }
                        if (dt.Rows[0]["per_codigo"] != DBNull.Value)
                        {
                            x.codigo = (string)dt.Rows[0]["per_codigo"];
                        }
                        if (dt.Rows[0]["per_id"] != DBNull.Value)
                        {
                            x.id = (int)dt.Rows[0]["per_id"];
                        }
                        if (dt.Rows[0]["per_activo"] != DBNull.Value)
                        {
                            x.activo = (int)dt.Rows[0]["per_activo"];
                        }
                        if (dt.Rows[0]["per_apellido"] != DBNull.Value)
                        {
                            x.apellido = (string)dt.Rows[0]["per_apellido"];
                        }
                        if (dt.Rows[0]["per_tipo_identicicacion"] != DBNull.Value)
                        {
                            x.tipo_identicicacion = (int)dt.Rows[0]["per_tipo_identicicacion"];
                        }
                        return(x);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception)
                {
                    return(null);

                    throw;
                }
            }