Beispiel #1
0
 protected void Gridview_Venta_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Gridview_Venta.DataSource = cuenta.CuentaXCobrarReporte2(txtSearch.Text.Trim());
         Gridview_Venta.DataBind();
         foreach (GridViewRow row in Gridview_Venta.Rows)
         {
             if (row.RowIndex == Gridview_Venta.SelectedIndex)
             {
                 row.BackColor = ColorTranslator.FromHtml("#A1DCF2");
                 row.ToolTip   = string.Empty;
                 cedula        = row.Cells[0].Text;
             }
             else
             {
                 row.BackColor = ColorTranslator.FromHtml("#FFFFFF");
                 row.ToolTip   = "Click para seleccionar esta fila.";
             }
         }
         ScriptManager.RegisterStartupScript(Page, typeof(Page), "scrollAgregar", "setTimeout(scrollAgregar, 1);", true);
     }
     catch
     {
         string scripts = @"<script type='text/javascript'>
             alert('No se pudo realizar la operación!');
             </script>";
         ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", scripts, false);
     }
 }
Beispiel #2
0
        protected void Gridview_CxC_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                foreach (GridViewRow row in Gridview_CxC.Rows)
                {
                    if (row.RowIndex == Gridview_CxC.SelectedIndex)
                    {
                        row.BackColor = ColorTranslator.FromHtml("#A1DCF2");
                        row.ToolTip   = string.Empty;
                        codigoVenta   = row.Cells[0].Text;
                        saldoVenta    = Convert.ToDouble(row.Cells[6].Text);
                        String    detalle = cuenta.BuscarDetalle(codigoVenta);
                        DataTable tabla   = cuenta.DetalleAbono(codigoVenta);
                        if (tabla.Rows.Count <= 0)
                        {
                            string scripts = @"<script type='text/javascript'>
                                document.getElementById('cabecera').style.display = 'none';
                                document.getElementById('abonosNo').style.display = 'block';
                                document.getElementById('seccionAbono').style.display = 'block';
                                </script>";
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", scripts, false);
                            lbl_detalle1.Text = detalle;
                        }
                        else
                        {
                            string scriptt = @"<script type='text/javascript'>
                                    document.getElementById('abonosNo').style.display = 'none';
                                    document.getElementById('cabecera').style.display = 'block';
                                    document.getElementById('seccionAbono').style.display = 'block';
                                    </script>";
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", scriptt, false);
                            ScriptManager.RegisterStartupScript(Page, typeof(Page), "scrollCXC", "setTimeout(scrollCXC, 1);", true);

                            lbl_detalle.Text          = detalle;
                            Gridview_Venta.DataSource = tabla;
                            Gridview_Venta.DataBind();
                        }

                        txt_abono.Focus();
                    }
                    else
                    {
                        row.BackColor = ColorTranslator.FromHtml("#FFFFFF");
                        row.ToolTip   = "Click para seleccionar esta fila.";
                    }
                }
            }
            catch
            {
                string scripts = @"<script type='text/javascript'>
                    alert('No se pudo realizar la operación!');
                    </script>";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", scripts, false);
            }
        }
Beispiel #3
0
        protected void btn_buscar_Click(object sender, EventArgs e)
        {
            try
            {
                tabla1 = buscar.BuscarVenta(txt_fecha1.Value, txt_fecha2.Value);
                if (tabla1.Rows.Count > 0)
                {
                    Gridview_Venta.DataSource = tabla1;
                    Gridview_Venta.DataBind();
                    string script = @"<script type='text/javascript'>
                            document.getElementById('busqueda').style.display = 'block';
                            </script>";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
                    Double suma  = 0;
                    Double suma2 = 0;

                    int limite = tabla1.Rows.Count - 1;
                    for (int i = 0; i <= limite; i++)
                    {
                        suma  = suma + Convert.ToInt32(tabla1.Rows[i][4]);
                        suma2 = suma2 + Convert.ToInt32(tabla1.Rows[i][5]);
                    }
                    lbl_total.InnerText = suma.ToString() + " ";
                    lbl_saldo.InnerText = suma2.ToString();
                }
                else
                {
                    string script = @"<script type='text/javascript'>
                            alert('No hay registro de ventas en ese rango de fechas!');
                            </script>";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
                    txt_fecha1.Value = "";
                    txt_fecha2.Value = "";
                    txt_fecha1.Focus();
                }
            }
            catch
            {
                string script = @"<script type='text/javascript'>
                            alert('No se pudo realizar la operación!');
                            </script>";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
            }
        }
Beispiel #4
0
 protected void btn_uno_Click(object sender, EventArgs e)
 {
     try
     {
         Gridview_Venta.DataSource = cuenta.CuentaXCobrarReporte2(txtSearch.Text.Trim());
         Gridview_Venta.DataBind();
         string script = @"<script type='text/javascript'>
                     document.getElementById('botones').style.display = 'none';
                     document.getElementById('busqueda').style.display = 'block';
                     </script>";
         ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
     }
     catch
     {
         string scripts = @"<script type='text/javascript'>
             alert('No se pudo realizar la operación!');
             </script>";
         ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", scripts, false);
     }
 }
Beispiel #5
0
 protected void Gridview_Paciente_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         foreach (GridViewRow row in Gridview_Paciente.Rows)
         {
             if (row.RowIndex == Gridview_Paciente.SelectedIndex)
             {
                 row.BackColor             = ColorTranslator.FromHtml("#A1DCF2");
                 row.ToolTip               = string.Empty;
                 cedula                    = row.Cells[0].Text;
                 Gridview_Venta.DataSource = venta.DetalleVenta(cedula);
                 Gridview_Venta.DataBind();
                 Double suma = 0;
                 tabla1 = venta.DetalleVenta(cedula);
                 limite = tabla1.Rows.Count - 1;
                 for (int i = 0; i <= limite; i++)
                 {
                     suma = suma + Convert.ToInt32(tabla1.Rows[i][3]);
                 }
                 lbl_total.InnerText = suma.ToString();
                 string script = @"<script type='text/javascript'>
                 document.getElementById('cabecera').style.display = 'block';
                 </script>";
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
                 ScriptManager.RegisterStartupScript(Page, typeof(Page), "scrollVenta", "setTimeout(scrollVenta, 1);", true);
             }
             else
             {
                 row.BackColor = ColorTranslator.FromHtml("#FFFFFF");
                 row.ToolTip   = "Click para seleccionar esta fila.";
             }
         }
     }
     catch
     {
     }
 }
Beispiel #6
0
 protected void InvisButton_Click(object sender, EventArgs e)
 {
     Gridview_Venta.DataSource = cuenta.CuentaXCobrarReporte2(txtSearch.Text.Trim());
     Gridview_Venta.DataBind();
 }
Beispiel #7
0
 protected void Gridview_Venta_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     Gridview_Venta.DataSource = cuenta.CuentaXCobrarReporte2(txtSearch.Text.Trim());
     Gridview_Venta.PageIndex  = e.NewPageIndex;
     Gridview_Venta.DataBind();
 }