/// <summary>
        /// Funcion Buscar Detalle de Precio
        /// </summary>
        /// <param name="cod_per">Codigo del Detalle</param>
        /// <param name="val_bus">Valor de la busqueda</param>
        /// <param name="prm_bus">Parametro de busqueda (1=codigo Persona ; 2=Nombre Persona 3=Codigo Libreta 4=Nombre Libreta)</param>
        /// <param name="est_bus">Estado de la Actividad (0=todos ; 1=Valido/habilitado ; 2=Nulo/Deshabilitado )</param>
        /// <returns></returns>
        /// <returns></returns>
        public DataTable _01(int cod_per, string val_bus, int prm_bus)
        {
            try
            {
                vv_str_sql = new StringBuilder();
                vv_str_sql.AppendLine("SELECT ecp005.va_cod_plg,va_des_plg,ecp006.va_cod_lib,va_des_lib,adm010.va_cod_per,va_nom_com,va_mto_lim,va_max_cuo,va_fec_exp FROM ecp006,ecp007,ecp005,adm010 ");
                vv_str_sql.AppendLine(" WHERE ecp007.va_cod_plg=ecp005.va_cod_plg ");
                vv_str_sql.AppendLine(" and ecp007.va_cod_per=adm010.va_cod_per ");
                vv_str_sql.AppendLine(" and ecp007.va_cod_lib=ecp006.va_cod_lib ");
                vv_str_sql.AppendLine(" and adm010.va_cod_per ='" + cod_per + "'");

                switch (prm_bus)
                {
                case 1: vv_str_sql.AppendLine(" and ecp007.va_cod_lib like '" + val_bus + "%' "); break;

                case 2: vv_str_sql.AppendLine(" and va_des_lib like '" + val_bus + "%' "); break;
                }


                return(o_cnx000.fu_exe_sql_si(vv_str_sql.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Funcion "Buscar Capitulo/Agrupador"
        /// </summary>
        /// <param name="val_bus">Valor de la busqueda</param>
        /// <param name="prm_bus">Parametro de Busqueda (1=codigo ; 2=Nombre )</param>
        /// <returns></returns>
        public DataTable _01(string val_bus, int prm_bus, string est_bus)
        {
            try
            {
                vv_str_sql = new StringBuilder();
                vv_str_sql.AppendLine(" select * from ctb002  ");

                switch (prm_bus)
                {
                case 1: vv_str_sql.AppendLine(" where va_cod_cap like '" + val_bus + "%' "); break;

                case 2: vv_str_sql.AppendLine(" where va_nom_cap like '" + val_bus + "%' "); break;
                }

                switch (est_bus)
                {
                case "0": est_bus = "T"; break;

                case "1": est_bus = "H"; break;

                case "2": est_bus = "N"; break;
                }

                if (est_bus != "T")
                {
                    vv_str_sql.AppendLine(" and va_est_ado ='" + est_bus + "'");
                }

                return(o_cnx000.fu_exe_sql_si(vv_str_sql.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// FUNCION GLOBAL: Obtiene la fecha actual del servidor///
        /// </summary>
        /// <returns></returns>
        public DateTime fg_fec_act()
        {
            string   StrSql = " select CURRENT_TIMESTAMP";
            DateTime fe_cha = Convert.ToDateTime(o_cnx000.fu_exe_sql_si(StrSql).Rows[0][0].ToString());

            return(fe_cha);
        }
        /// <summary>
        /// Funcion "Buscar VENDEDOR"
        /// </summary>
        /// <param name="val_bus">Valor de la busqued</param>
        /// <param name="prm_bus">Parametro de busqueda (1=codigo ; 2=Nombre)</param>
        /// <param name="est_bus">Estado de Vendedor (0=todos ; 1=Valido/habilitado ; 2=Nulo/Deshabilitado )(</param>
        /// <returns></returns>
        public DataTable _01(string val_bus, int prm_bus, string est_bus)
        {
            try
            {
                vv_str_sql = new StringBuilder();

                vv_str_sql.AppendLine(" select * from cmr003  ");

                if (true)
                {
                }
                switch (prm_bus)
                {
                case 1: vv_str_sql.AppendFormat(" where va_cod_ven like '{0}%'", val_bus); break;

                case 2: vv_str_sql.AppendFormat(" where va_nom_ven like '{0}%'", val_bus); break;
                }

                switch (est_bus)
                {
                case "0": est_bus = "T"; break;

                case "1": est_bus = "H"; break;

                case "2": est_bus = "N"; break;
                }

                if (est_bus != "T")
                {
                    vv_str_sql.AppendFormat(" and va_est_ado ='{0}'", est_bus);
                }


                return(o_cnx000.fu_exe_sql_si(vv_str_sql.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #5
0
        /// <summary>
        /// Funcion Buscar Detalle de Precio
        /// </summary>
        /// <param name="cod_lis">Codigo del Detalle</param>
        /// <param name="val_bus">Valor de la busqueda</param>
        /// <param name="prm_bus">Parametro de busqueda (1=codigo ; 2=Nombre )</param>
        /// <param name="est_bus">Estado de la Actividad (0=todos ; 1=Valido/habilitado ; 2=Nulo/Deshabilitado )</param>
        /// <returns></returns>
        /// <returns></returns>
        public DataTable _01(int cod_lis, string val_bus, int prm_bus, string est_bus)
        {
            try
            {
                vv_str_sql = new StringBuilder();
                vv_str_sql.AppendLine(" SELECT inv002.va_cod_pro,va_nom_pro,va_pre_cio,va_est_ado,va_cod_lis FROM cmr002,inv002 ");
                vv_str_sql.AppendLine(" WHERE cmr002.va_cod_pro=inv002.va_cod_pro ");
                vv_str_sql.AppendLine(" and va_cod_lis =' " + cod_lis + " '");

                switch (prm_bus)
                {
                case 1: vv_str_sql.AppendLine(" and inv002.va_cod_pro like '" + val_bus + "%' "); break;

                case 2: vv_str_sql.AppendLine(" and va_nom_pro like '" + val_bus + "%' "); break;
                }
                switch (est_bus)
                {
                case "0": est_bus = "T"; break;

                case "1": est_bus = "H"; break;

                case "2": est_bus = "N"; break;
                }

                if (est_bus != "T")
                {
                    vv_str_sql.AppendLine(" and va_est_ado ='" + est_bus + "'");
                }


                return(o_cnx000.fu_exe_sql_si(vv_str_sql.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #6
0
        /// <summary>
        /// Funcion "Consulta Permisos de Usuario sobre Vendedor"
        /// </summary>
        /// <param name="cod_usr">Codigo del usuario</param>
        /// <returns></returns>
        public DataTable _05(string cod_usr)
        {
            try
            {
                vv_str_sql = new StringBuilder();
                vv_str_sql.AppendLine(" SELECT va_cod_ven FROM seg024 ");
                vv_str_sql.AppendLine(" WHERE  va_cod_usr = '******' ");

                return(o_cnx000.fu_exe_sql_si(vv_str_sql.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Buscar
        /// </summary>
        /// <param name="cod_pro">cod producto</param>
        /// <returns></returns>
        public DataTable _01(string cod_pro)
        {
            try
            {
                vv_str_sql = new StringBuilder();
                vv_str_sql.AppendLine(" select * from inv008  ");

                vv_str_sql.AppendLine("where va_cod_pro = '" + cod_pro + " '");

                return(o_cnx000.fu_exe_sql_si(vv_str_sql.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }