private bool ValidarBuscar() { if (GastosBLL.Buscar(String(BuscarTextBox.Text)) == null) { base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('No Existe');</script>"); return(false); } return(true); }
protected void BuscarButton_Click(object sender, EventArgs e) { if (IdTextBox.Text == "") { base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debes llenar el campo Id para realizar la busqueda!');</script>"); } else { BuscarGasto(GastosBLL.Buscar(String(IdTextBox.Text))); } }
public void BuscarGasto(Entidades.Gastos g) { if (GastosBLL.Buscar(String(IdTextBox.Text)) == null) { base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('No Existe');</script>"); } else { VendedorIdTextBox.Text = Convert.ToString(g.VendedorId); ConceptoTextBox.Text = g.Concepto; g.Fecha = Convert.ToDateTime(FechaTextBox.Text); MontoTextBox.Text = Convert.ToString(g.Monto); } }
protected void AnularButton_Click(object sender, EventArgs e) { if (IdTextBox.Text == "") { Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debes Llenar el Campo Id');</script>"); } else { if (GastosBLL.Buscar(String(IdTextBox.Text)) == null) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('No existe ');</script>"); } else { GastosBLL.Eliminar(String(IdTextBox.Text)); Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Proceso Completado');</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int.TryParse(Request.QueryString["GastoId"], out GastoId); if (GastoId > 0) { g.Buscar(GastoId); ConceptoTextBox.Text = gasto.Concepto; //g.Fecha = Convert.ToDateTime(FechaTextBox.Text); MontoTextBox.Text = Convert.ToString(gasto.Monto); Buscar(GastoId); } } FechaTextBox.Text = DateTime.Now.ToString("dd/MM/yyyy"); if (!Page.IsPostBack) { //todo: query string que permita buscar un id LLenarComboVendedor(); } }