Exemple #1
0
        protected void btnbuscar_Click(object sender, EventArgs e)
        {
            PanillaDAO db = new PanillaDAO();
            string     fi = txtfechainicia.Text;
            string     ff = txtfechafinal.Text;

            if (txtzonmer.Text.Length == 1)
            {
                grvplanilla.DataSource = db.BuscarxZona(txtzonmer.Text, fi, ff);
                grvplanilla.DataBind();
            }
            else if (txtzonmer.Text.Length == 2)
            {
                string zona    = txtzonmer.Text.Substring(0, 1);
                string mercado = txtzonmer.Text.Substring(1, 1);
                grvplanilla.DataSource = db.BuscarxZonaMercado(zona, mercado, fi, ff);
                grvplanilla.DataBind();
            }
            else
            {
                txtmensaje.Text = "";
                txtmensaje.Text = "Debe ingresar la zona o el mercado.";
                string script = "openModal();";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "error", script, true);
            }
            lbltotal.Text = "";
        }
Exemple #2
0
 protected void grvplanilla_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         int fila = Convert.ToInt32(e.CommandArgument);
         if (e.CommandName == "Eliminar")
         {
             int        id = Convert.ToInt32(grvplanilla.Rows[fila].Cells[0].Text);
             PagoDAO    pg = new PagoDAO();
             PanillaDAO db = new PanillaDAO();
             pg.Eliminar(id);
             db.Eliminar(id);
             cargar();
         }
         else if (e.CommandName == "Agregar")
         {
             int id      = Convert.ToInt32(grvplanilla.Rows[fila].Cells[0].Text);
             int cliente = Convert.ToInt32(grvplanilla.Rows[fila].Cells[1].Text);
             Response.Redirect("Agregar.aspx?ID=" + id + "&Cl=" + cliente, true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
        void listar()
        {
            PanillaDAO db = new PanillaDAO();

            grvplanilla.DataSource = db.ListarPlanilla();
            grvplanilla.DataBind();
        }
Exemple #4
0
        protected void ddlclie_SelectedIndexChanged(object sender, EventArgs e)
        {
            PanillaDAO db = new PanillaDAO();
            string     id = ddlclie.SelectedValue;

            txtnumero.Text         = "";
            grvplanilla.DataSource = db.Buscarxcliente(id);
            grvplanilla.DataBind();
        }
Exemple #5
0
        protected void txtnumero_TextChanged(object sender, EventArgs e)
        {
            PanillaDAO db = new PanillaDAO();
            string     id = txtnumero.Text;

            ddlclie.SelectedValue  = "0";
            grvplanilla.DataSource = db.Buscarxnumeropedido(id);
            grvplanilla.DataBind();
        }