示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                string str = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "deudor");
                this.txtnomDeudor.Text = Session["snomdeudor"].ToString();

                if (Session["snoperacion"] == null)
                {
                    txtNrooperacion.Text = ALCSA.FWK.Web.Sitio.ExtraerValorQueryString(Request, "estado");
                }
                else
                {
                    txtNrooperacion.Text = Session["snoperacion"].ToString();
                }

                this.txtRutDeudor.Text = Session["srutdeudor"].ToString();

                DataTable table = ConsultasEspecificas.ConMostrarDomicilios(str);
                Session["Excel_domi_cilios"] = table;
                Grilla.DataSource            = table;
                Grilla.DataBind();

                if (ALCSA.FWK.Web.Sitio.ExtraerValorQueryStringComoEntero(Request, "cerrar").Equals(1))
                {
                    btnCerrar.OnClientClick = "window.close();";
                }
            }
        }
示例#2
0
    private void CargarAlumnos()
    {
        cAlumno   alumno = new cAlumno();
        DataTable trdo   = alumno.GetAlumnos();

        Grilla.DataSource = trdo;
        Grilla.DataBind();
    }
 protected void btnLimpiar_Click(object sender, EventArgs e)
 {
     txtId.Value       = "0";
     txtNombre.Text    = "";
     chkActivo.Checked = false;
     tu.limpiar();
     txtNombre.Focus();
     Grilla.DataSource = null;
     Grilla.DataBind();
 }
 protected void btnLimpiar_Click(object sender, EventArgs e)
 {
     txtId.Value         = "";
     txtNombre.Text      = "";
     txtRut.Text         = "";
     txtDigito.Text      = "";
     txtRazonSocial.Text = "";
     txtTelefono1.Text   = "";
     txtTelefono2.Text   = "";
     txtEmail.Text       = "";
     chkActivo.Checked   = false;
     proveedor.limpiar();
     txtNombre.Focus();
     Grilla.DataSource = null;
     Grilla.DataBind();
 }
示例#5
0
        private void CargaGrilla(int indice)
        {
            DataTable table = ConsultasEspecificas.ConsultaDatosGrillaDomicilios(
                txtRut.Text,
                txtNroOperacion.Text,
                ddlCliente.SelectedValue
                );

            if (table != null && table.Rows.Count > 0)
            {
                Session["snomdeudor"] = table.Rows[0]["nomdeudor"].ToString();
                Session["srutdeudor"] = table.Rows[0]["rut_deudor"].ToString();
            }

            Grilla.PageIndex  = indice;
            Grilla.DataSource = table;
            Grilla.DataBind();
        }
        void muestra_productos()
        {
            String queryString = "Lista_Prod_Stock";

            lbl_error.Text = "";
            //lbl_status.Text = "";
            using (MySqlConnection conn = new MySqlConnection(SMysql))
            {
                try
                {
                    conn.Open();
                    MySqlCommand command = new MySqlCommand(queryString, conn);
                    command.CommandType = CommandType.StoredProcedure;

                    if (txt_codigo.Text == "")
                    {
                        command.Parameters.AddWithValue("@v_codigo", DBNull.Value);
                    }
                    else
                    {
                        command.Parameters.AddWithValue("@v_codigo", txt_codigo.Text);
                    }
                    command.Parameters["@v_codigo"].Direction = ParameterDirection.Input;

                    if (LstLineaVtas.SelectedItem.Value.ToString() == "0")
                    {
                        command.Parameters.AddWithValue("@v_id_linea_vta", DBNull.Value);
                    }
                    else
                    {
                        command.Parameters.AddWithValue("@v_id_linea_vta", LstLineaVtas.SelectedItem.Value.ToString());
                    }
                    command.Parameters["@v_id_linea_vta"].Direction = ParameterDirection.Input;

                    //var result = command.ExecuteNonQuery();

                    DataSet          ds        = new DataSet();
                    DataTable        table     = new DataTable();
                    MySqlDataAdapter mysqlDAdp = new MySqlDataAdapter(command);

                    ///MySqlDataReader dr = command.ExecuteReader();
                    mysqlDAdp.Fill(table);

                    if (table.Rows.Count == 0)
                    {
                        lbl_mensaje.Text = "Sin Resultados";
                    }
                    else
                    {
                        Grilla.DataSource = table;
                        Grilla.DataBind();
                    }

                    lbl_mensaje.Text = "Cantidad de Registros: " + Grilla.Rows.Count.ToString();
                    conn.Close();
                    conn.Dispose();
                }
                catch (Exception ex)
                {
                    conn.Close();
                    conn.Dispose();
                    lbl_error.Text = ex.Message;
                }
            }
        }
 protected void btnListar_Click(object sender, EventArgs e)
 {
     tu.Nombre         = txtNombre.Text;
     Grilla.DataSource = tu.listar();
     Grilla.DataBind();
 }
示例#8
0
        void carga_clientes()
        {
            String queryString = "";

            lbl_mensaje.Text = "";
            queryString      = "select cl.id_cliente, cl.rut + '-' + cl.Dv_Rut Rut, SUBSTRING(cl.razon_social,1,30) razon_social , pe.id_item ID_Item,  pe.codigo, SUBSTRING(pe.descripcion,1,30) descripcion, mn.Sigla Moneda, pe.precio_lista , pe.precio, ";
            queryString      = queryString + "IFNULL(pe.fecha_vigencia,IFNULL(pe.fecha_vigencia,DATE_SUB(NOW(),INTERVAL 24 HOUR))) fecha_vigencia, ";
            queryString      = queryString + "IF(DATEDIFF(IFNULL(date(pe.fecha_vigencia),date(DATE_SUB(NOW(),INTERVAL 24 HOUR))),date(NOW())) > 0, 'S','N') Vigente ";
            queryString      = queryString + "from tbl_clientes cl, tbl_precios_especiales pe, tbl_Monedas mn ";
            queryString      = queryString + "where cl.ID_Cliente = pe.ID_Cliente ";
            queryString      = queryString + "and pe.id_moneda = mn.ID_Moneda ";

            if (txt_idw.Text != "")
            {
                queryString = queryString + "and cl.id_cliente = " + txt_idw.Text;
            }
            if (txt_rutw.Text != "")
            {
                queryString = queryString + "and cl.rut = " + txt_rutw.Text;
            }
            if (txt_razonw.Text != "")
            {
                queryString = queryString + "and cl.Razon_Social like '%" + txt_razonw.Text + "%'";
            }

            queryString = queryString + " order by cl.ID_Cliente ";

            using (MySqlConnection conn = new MySqlConnection(SMysql))
            {
                try
                {
                    conn.Open();
                    DataSet          ds      = new DataSet();
                    MySqlDataAdapter adapter = new MySqlDataAdapter();
                    adapter.SelectCommand = new MySqlCommand(queryString, conn);
                    adapter.Fill(ds);


                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        lbl_mensaje.Text = "Sin Resultados";
                    }
                    else
                    {
                        Grilla.DataSource = ds;
                        Grilla.DataBind();
                    }

                    //Productos.DataMember = "tbl_items";

                    conn.Close();
                    conn.Dispose();
                }
                catch (Exception ex)
                {
                    lbl_error.Text = ex.Message;
                    conn.Close();
                    conn.Dispose();
                }
            }
        }