private void CargarEmpresa()
        {
            //EUsuario objE = new EUsuario();

            WebHelper.LoadListControl3(cbEmpresa, BGeneral.ObtenerDatoEmpresa(""));

            Dato d = new Dato();
            d.id = cbEmpresa.SelectedValue.ToString();

            cbPeriodo.DataSource = BGeneral.ObtenerDatoEmpresaPeriodo(d);
            cbPeriodo.DisplayMember = "idPeriodo";
            cbPeriodo.ValueMember = "idPeriodo";

            DateTime thisDay = DateTime.Today;
            cbPeriodo.SelectedValue = thisDay.Year.ToString();
        }
        /// <summary>
        /// codigo desktop 
        /// </summary>
        /// <param name="pais"></param>
        /// <param name="depa"></param>
        /// <returns></returns>
        /// 
        public static List<Dato> MG_Departamento_qry01_(String pais)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@Pais", pais);
            IDataReader reader = db.ExecuteReader("MG_Departamento_qry02");
            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["idDepa"].ToString();
                _dato.desc = reader["dsNombre"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        /// <summary>
        /// codigo para desktop
        /// </summary>
        /// <param name="Codigo"></param>
        /// <returns></returns>
        public static List<Dato> MG_TablaGrupo_qry01_()
        {
            List<Dato> _lista = new List<Dato>();

               DBAccess db = new DBAccess();
               IDataReader reader = db.ExecuteReader("MG_grupo_qry01");

               while (reader.Read())
               {
               Dato _dato = new Dato();

               _dato.id = reader["id_grupo"].ToString();
               _dato.desc = reader["ds_grupo"].ToString();
               _lista.Add(_dato);
               }
               return _lista;
        }
        public static List<Dato> ObtenerDato()
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();

            IDataReader reader = db.ExecuteReader("MG_RutaProceso_qry02");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["idRutaProces"].ToString();
                _dato.desc = reader["dsRutaProces"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatoUN(string commandtext, string par1, string par2, EUnidadNegocio emp)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@pidEmpresa", emp.IdEmpresa);
            IDataReader reader = db.ExecuteReader(commandtext);

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader[par1].ToString();
                _dato.desc = reader[par2].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDato(string commandtext, string par1, string par2)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();

            IDataReader reader = db.ExecuteReader(commandtext);

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader[par1].ToString();
                _dato.desc = reader[par2].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObteneModulo()
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();

            IDataReader reader = db.ExecuteReader("SY_Modulo_qry");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["idModulo"].ToString();
                _dato.desc = reader["ds_modulo"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            string Usu = txtUser.Text.Trim();

            string password = txtPass.Text.Trim();

            string iduser;
            EUsuario u = new EUsuario();

            // comparamos la infomacion si es igual al de mi base de datos

            u.IdLogon = Usu;
            u.ds_password = password;

            EUsuario usuarioo;
            usuarioo = Usuarioco.UsuarioFill(u);

            try
            {
                if (usuarioo.StAnulado.ToString() == "0")
                {

                   d = new Dato();
                   d.id = txtUser.Text;
                   d.dsu = usuarioo.DsNombres;
                   d.idUser = usuarioo.IdUser.ToString();

                   //MessageBox.Show(iduser.ToString());

                    wfChgEmpPer frm = new wfChgEmpPer();
                    frm.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("La contraseña es incorrecta. Inténtelo de nuevo", "Aviso");
                }

            }
            catch (Exception ex)
            {
              MessageBox.Show(ex.ToString());
            }
        }
        //desktop
        public static List<Dato> tablaGeneral(String Codigo)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@id_tabla", Codigo);

            IDataReader reader = db.ExecuteReader("MG_TablaGeneral_qry01");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_item"].ToString();
                _dato.desc = reader["ds_item"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
Example #10
0
        public static List<Dato> Color_qry06(String Codigo)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@idEmpresa", Codigo);

            IDataReader reader = db.ExecuteReader("TJ_Color_GenCod");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_color"].ToString();
                _dato.desc = reader["id_color"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> MG_Vendedor_qry02(String obj)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@dsRazonSocial", obj);

            IDataReader reader = db.ExecuteReader("MG_Vendedor_qry02");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_Vendedor"].ToString();
                _dato.desc = reader["dsRazsocial"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatEmpresaPeriodo( Dato d)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();

            db.AddParameter("@pidEmpresa", d.id);
            db.AddParameter("@pidPeriodo", "");
            IDataReader reader = db.ExecuteReader("SY_EmpPeriodo_qry04");

            while (reader.Read())
            {
                Dato _dato = new Dato();
                _dato.idperiodo = reader["idPeriodo"].ToString();
                _dato.periodo = reader["idPeriodo"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerFormulario( string modulo)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@idModulo", modulo);

            IDataReader reader = db.ExecuteReader("SY_Formulario_qry");
            _lista.Clear();
            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_formulario"].ToString();
                _dato.desc = reader["ds_formulario"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        /// <summary>
        /// obtener datos de impuesto en para desktop
        /// </summary>
        /// <param name="commandtext"></param>
        /// <param name="par1"></param>
        /// <param name="par2"></param>
        /// <param name="prov"></param>
        /// <returns></returns>
        public static List<Dato> _Impuesto_qry01(string commandtext, string par1, string par2, EDTipImpuesto imp)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();

            db.AddParameter("@idPeriodo", imp.IdPeriodo);

            IDataReader reader = db.ExecuteReader(commandtext);

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader[par1].ToString();
                _dato.desc = (reader[par2]).ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (cbEmpresa.Text != "" && cbPeriodo.Text != "")
            {
                datos = new Dato();
                datos.idEmpresa = cbEmpresa.SelectedValue.ToString();
                datos.idperiodo = cbPeriodo.SelectedValue.ToString();
                datos.dsEmpresa = cbEmpresa.Text;

                frmMDI mdi = new frmMDI();
                mdi.Show();

                this.Dispose();

            }
            else
            {
                MessageBox.Show("Falta Ingresar Datos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// codigo desktop
        public static List<Dato> Exportacion_qry01_(string idPeriodo, string idEmpresa)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@idPeriodo", idPeriodo);
            db.AddParameter("@idEmpresa", idEmpresa);

            IDataReader reader = db.ExecuteReader("MG_GencodigoExportacion");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_Exportacion"].ToString();

                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatoTg(string commandtext, string par1, string par2, ETipGasto tg)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@idEmpresa", tg.Id_empresa);
            db.AddParameter("@idunegocio", tg.Id_unegocio);
            db.AddParameter("@idCCosto", tg.Id_ccosto);

            IDataReader reader = db.ExecuteReader(commandtext);

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader[par1].ToString();
                _dato.desc = reader[par2].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> TJ_TejeduriaGenCod(string idEmpresa, string idProducto)
        {
            List<Dato> _lista = new List<Dato>();

              DBAccess db = new DBAccess();

              db.AddParameter("@pidEmpresa", idEmpresa);
              db.AddParameter("@pid_producto", idProducto);

              IDataReader reader = db.ExecuteReader("TJ_TejeduriaGenCod");

              while (reader.Read())
              {
              Dato _dato = new Dato();

              _dato.id = reader["tj_idNucorre"].ToString();

              _lista.Add(_dato);
              }
              return _lista;
        }
        public static List<Dato> ObtenerDatoMenu(Dato d)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();

            db.AddParameter("@pidUser", d.idu);

            IDataReader reader = db.ExecuteReader("SY_UsuMenu_qry10");

            while (reader.Read())
            {
                Dato _dato = new Dato();
                _dato.idMenu = reader["idMenu"].ToString();
                _dato.dsMenu = reader["dsMenu"].ToString();
                _dato.dsWinForms = reader["dsWebPage"].ToString();
                _dato.idPadre = reader["idPadre"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatoFPago(string commandtext, string par1, string par2, ECondicionPago condp)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@psintypesel", condp.psintypesel);
            db.AddParameter("@ds_condpago", condp.Ds_condpago);
            db.AddParameter("@id_condpago", condp.Id_condpago);

            IDataReader reader = db.ExecuteReader(commandtext);

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader[par1].ToString();
                _dato.desc = reader[par2].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> GenCodTejido_qry01(EProducto prod)
        {
            List<Dato> _lista = new List<Dato>();

               DBAccess db = new DBAccess();
               db.AddParameter("@pchr_idgrupo", prod.Id_grupo);
               db.AddParameter("@pchr_idfamilia", prod.Id_familia);
               db.AddParameter("@pchr_idsubfami", prod.Id_subfami);
               db.AddParameter("@idEmpresa", prod.IdEmpresa);
               IDataReader reader = db.ExecuteReader("MG_GenerarCodTejido");

               while (reader.Read())
               {
               Dato _dato = new Dato();

               _dato.id = reader["id_Producto"].ToString();

               _lista.Add(_dato);
               }
               return _lista;
        }
        public static List<Dato> ObtenerDatoVendedor(EVendedor prov)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@psintypesel", prov.psintypesel);
            db.AddParameter("@pidVendedor", prov.Id_Vendedor);
            db.AddParameter("@pnuDocIden", prov.Nu_dni);
            db.AddParameter("@pdsApellNom", prov.Ds_razsoc);

            IDataReader reader = db.ExecuteReader("MG_Vendedor_qry01");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_Vendedor"].ToString();
                _dato.desc = reader["dsRazsocial"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
Example #23
0
        public static List<Dato> ObtenerDatoColor(EColor c)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();

            db.AddParameter("@psintypesel", c.psintypesel);
            db.AddParameter("@pidEmpresa", c.IdEmpresa);
            db.AddParameter("@pid_color", c.Id_color);
            db.AddParameter("@pds_color", c.Ds_color);

            IDataReader reader = db.ExecuteReader("MG_Color_qry01");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_color"].ToString();
                _dato.desc = reader["ds_color"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatoProveedor(string commandtext, string par1, string par2, EProveedor prov)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@psintypesel", prov.psintypesel);
            db.AddParameter("@raszoc", prov.Ds_raznombre);
            db.AddParameter("@id_clipro", prov.Id_clipro);
            db.AddParameter("@nu_ruc", prov.Nu_ruc);
            db.AddParameter("@id_empresa", prov.Id_empresa);

            IDataReader reader = db.ExecuteReader(commandtext);

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader[par1].ToString();
                _dato.desc = reader[par2].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatoExport( Eexportacion exp)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@psintypesel", exp.psintypesel);
            db.AddParameter("@idExportacion", exp.Id_Exporta);
            db.AddParameter("@dsExportacion", exp.Ds_Exporta);
            db.AddParameter("@idEmpresa", exp.Id_Empresa);

            IDataReader reader = db.ExecuteReader("MG_Exportacion_qry01");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.desc = reader["Descripcion"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatoImport( EImportacion imp)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@psintypesel", imp.psintypesel);
            db.AddParameter("@idImporta", imp.Id_importa);
            db.AddParameter("@dsImporta", imp.Ds_importa);
            db.AddParameter("@idEmpresa", imp.Id_empresa);

            IDataReader reader = db.ExecuteReader("MG_Importacion_qry01");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                //_dato.id = reader[par1].ToString();
                _dato.desc = reader["Descripcion"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> ObtenerDatoCliente(ECliente c)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@psintypesel", c.psintypesel);
            db.AddParameter("@raszoc", c.Ds_raznombre);
            db.AddParameter("@id_clipro", c.Id_clipro);
            db.AddParameter("@nu_ruc", c.Nu_ruc);
            db.AddParameter("@id_empresa", c.IdEmpresa);

            IDataReader reader = db.ExecuteReader("MG_Cliente_qry01");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["Codigo"].ToString();
                _dato.desc = reader["Razon Social"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
        public static List<Dato> Terceros_qry02_(String Codigo)
        {
            List<Dato> _lista = new List<Dato>();

            DBAccess db = new DBAccess();
            db.AddParameter("@idEmpresa", Codigo);

            IDataReader reader = db.ExecuteReader("MG_GencodigoTercero");

            while (reader.Read())
            {
                Dato _dato = new Dato();

                _dato.id = reader["id_clipro"].ToString();
                _dato.desc = reader["id_clipro"].ToString();
                _lista.Add(_dato);
            }
            return _lista;
        }
 public static List<Dato> ObtenerModulo(Dato d)
 {
     return DGeneral.ObtenerModulo(d);
 }
 public static List<Dato> ObtenerDatoMenu(Dato d)
 {
     return DGeneral.ObtenerDatoMenu(d);
 }