protected void Button4_Click(object sender, EventArgs e) { string str = TextBox1.Text.Trim(); int Num; bool isNum = int.TryParse(str, out Num); if (!isNum) { Response.Write("<script>alert('Introduce un NIT')</script>"); } else { int SiExiste = DatosCl.SiExisteCliente(Convert.ToInt32(TextBox1.Text)); if (SiExiste == 0) { Button3_ModalPopupExtender.Show(); TextBox5.Text = TextBox1.Text; } else { tabla = DatosCl.ListaUncliente(Convert.ToInt32(TextBox1.Text)); IDc = Convert.ToInt32(tabla.Rows[0][0]); nom = tabla.Rows[0][7].ToString(); TextBox3.Text = nom; Label1.Text = IDc.ToString(); } } }
protected void Button2_Click(object sender, EventArgs e) { Nit = Convert.ToInt32(TextBox1.Text); decimal totalpagar = 0; foreach (GridViewRow row in GridView1.Rows) { CheckBox chkitem = (CheckBox)(row.FindControl("CheckItem")); if (chkitem.Checked) { totalpagar += Convert.ToDecimal(row.Cells[4].Text); contador++; } } Label5.Text = "Ah seleccionado " + contador + " itmes." + "TOTAL A PAGAR: " + totalpagar; Button3_ModalPopupExtender.Show(); // Response.Redirect("Credito2.aspx"); }