private void ListTipoCliente()
        {
            ConfiguracionBLL capanegocios = new ConfiguracionBLL();
            int Parametro;

            try
            {
                Parametro = Convert.ToInt32(Constante.Numeros.Uno);
                var lstConfiguracion = new ConfiguracionBLL().GetValue(Parametro);

                ddlTipoCliente.DataSource     = lstConfiguracion;
                ddlTipoCliente.DataValueField = "Key";
                ddlTipoCliente.DataTextField  = "Value";
                ddlTipoCliente.DataBind();
                ddlTipoCliente.SelectedIndex = Convert.ToInt32(Constante.Numeros.Cero);

                ddlFilTipoCliente.DataSource     = lstConfiguracion;
                ddlFilTipoCliente.DataValueField = "Key";
                ddlFilTipoCliente.DataTextField  = "Value";
                ddlFilTipoCliente.DataBind();
                ddlFilTipoCliente.Items.Insert(0, new ListItem("-- TODOS --", "0"));
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
Exemplo n.º 2
0
        private void ListTipoClasificacion()
        {
            ConfiguracionBLL capanegocios = new ConfiguracionBLL();
            int       Parametro;
            DataTable dt = new DataTable();

            try
            {
                Parametro = Convert.ToInt32(Constante.Numeros.Ocho);
                var lstConfiguracion = new ConfiguracionBLL().GetValue(Parametro);

                dt.Columns.Add("key");
                dt.Columns.Add("Value");

                foreach (var row in lstConfiguracion)
                {
                    if (Convert.ToInt32(row.Key) != Convert.ToInt32(Constante.Numeros.Uno)) //PARTICULAR
                    {
                        dt.Rows.Add(row.Key, row.Value);
                    }
                }

                ddlClasificacion.DataSource     = lstConfiguracion;
                ddlClasificacion.DataValueField = "Key";
                ddlClasificacion.DataTextField  = "Value";
                ddlClasificacion.DataBind();
                ddlClasificacion.Items.Insert(0, new ListItem("-- Seleccione --", "0"));
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
Exemplo n.º 3
0
        private void ListArea()
        {
            ConfiguracionBLL capanegocios = new ConfiguracionBLL();
            int Parametro;

            try
            {
                Parametro = Convert.ToInt32(Constante.Numeros.Cuatro);
                var lstConfiguracion = new ConfiguracionBLL().GetListArea(Parametro);

                ddlFArea.DataSource     = lstConfiguracion;
                ddlFArea.DataValueField = "Key";
                ddlFArea.DataTextField  = "Value";
                ddlFArea.DataBind();
                ddlFArea.Items.Insert(0, new ListItem("-- TODOS --", "0"));

                ddlArea.DataSource     = lstConfiguracion;
                ddlArea.DataValueField = "Key";
                ddlArea.DataTextField  = "Value";
                ddlArea.DataBind();
                ddlArea.Items.Insert(0, new ListItem("-- Seleccione --", "0"));
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
Exemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (txtImpresora.Text == "" || txtNombreInstitucion.Text == "")
            {
                MessageBox.Show("No puese dejar campos en blanco", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                Configuracion c = new Configuracion
                {
                    Id = 1, //El Id siempre es el mismo
                    NombreImpresora   = txtImpresora.Text,
                    NombreInstitucion = txtNombreInstitucion.Text
                };

                Resultado result = ConfiguracionBLL.AgregarConfiguracion(c);

                if (result.Codigo == 1)
                {
                    MessageBox.Show(result.Mensaje, "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    control.NombresImpresora(); // llamada al metodo para cargar las variables con los datos nuevos
                }
                else
                {
                    MessageBox.Show(result.Mensaje);
                }
            }
        }
Exemplo n.º 5
0
        public void cargarDatosForm()
        {
            Configuracion c = ConfiguracionBLL.BuscarConfiguracion();

            if (c != null)
            {
                txtImpresora.Text         = c.NombreImpresora;
                txtNombreInstitucion.Text = c.NombreInstitucion;
            }
        }
Exemplo n.º 6
0
        public void NombresImpresora()
        {
            //traer el nombre de la institucion y impresora que esta en la BD

            Configuracion c = ConfiguracionBLL.BuscarConfiguracion();

            if (c != null)
            {
                NombreImpresora   = c.NombreImpresora;
                NombreInstitucion = c.NombreInstitucion;
            }
            else
            {
                NombreImpresora   = "";
                NombreInstitucion = "";
            }
        }
Exemplo n.º 7
0
        private int ObtenerPlazosAlertasInternas()
        {
            ConfiguracionBLL capanegocios = new ConfiguracionBLL();
            int Padre, Parametro;

            try
            {
                Padre     = Convert.ToInt32(Constante.Numeros.Cuatro);
                Parametro = Convert.ToInt32(Constante.Numeros.Cinco);

                var lstConfiguracion = new ConfiguracionBLL().GetListValue(Padre, Parametro);

                Dias = Convert.ToInt32(lstConfiguracion.Where(pair => pair.Value == Convert.ToString(Constante.Area.FISICOQUIMICA))
                                       .Select(pair => pair.Key)
                                       .FirstOrDefault());
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }

            return(Dias);
        }