protected void Page_Load(object sender, EventArgs e) { this.FechaTextBox.Text = string.Format("{0:G}", DateTime.Now); if (!Page.IsPostBack) { LLenarComboVendedor(); } int Id; { if (IsPostBack == false) { if (Request.QueryString["Id"] != null) { Id = Utilidades.TOINT(Request.QueryString["Id"].ToString()); if (Id > 0) { Subsidios subsidios = new Subsidios(); SubsidiosBLL.Buscar(Id); Utilidades.ShowToastr(this, "Registro no encontrado", "Error", "Danger"); Limpiar(); } else { IdTextBox.Text = Id.ToString(); } } } } }
protected void GuardarButton_Click(object sender, EventArgs e) { Subsidios subsidios = new Subsidios(); Llenar(subsidios); SubsidiosBLL.Guardar(subsidios); Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert(' Se Guardo Correctamente');</script>"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Listas = SubsidiosBLL.ListarTodo(); GridViewConsultaVenta.DataSource = Listas; GridViewConsultaVenta.DataBind(); } }
protected void BuscarButton_Click(object sender, EventArgs e) { if (IdTextBox.Text == "") { Utilidades.ShowToastr(this, "Debes Llenar el Campo Id ", "Advertencia", "Warning"); } else { BuscarSubcidios(SubsidiosBLL.Buscar(Utilidades.TOINT(IdTextBox.Text))); } }
protected void AnularButton_Click(object sender, EventArgs e) { if (IdTextBox.Text == "") { Utilidades.ShowToastr(this, "Debes Llenar el Campo Id ", "Advertencia", "Warning"); } else { SubsidiosBLL.Eliminar(Utilidades.TOINT(IdTextBox.Text)); Utilidades.ShowToastr(this, "Proceso Completado", "Exito", "success"); } }
public void BuscarSubcidios(Entidades.Subsidios s) { if (SubsidiosBLL.Buscar(Utilidades.TOINT(IdTextBox.Text)) == null) { Utilidades.ShowToastr(this, "No Existe", "Que Mal", "Error"); } else { ConceptoTextBox.Text = s.Concepto; s.Fecha = Convert.ToDateTime(FechaTextBox.Text); MontoTextBox.Text = Convert.ToString(s.Monto); } }
protected void GuardarButton_Click(object sender, EventArgs e) { if (ConceptoTextBox.Text == "" || MontoTextBox.Text == "") { Utilidades.ShowToastr(this, "Completar Campos (*) ", "Advertencia", "Warning"); } else { Subsidios subsidios = new Subsidios(); Llenar(subsidios); SubsidiosBLL.Guardar(subsidios); Utilidades.ShowToastr(this, "Guardado con Exitos", "Exito", "success"); } }
private void BuscarSelecCombo() { Listas = null; if (DropDownListFiltro.SelectedIndex == 0) { Listas = SubsidiosBLL.ListarTodo(); } else if (DropDownListFiltro.SelectedIndex == 1) { if (TextBoxFiltrar.Text == "") { base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debe de Insertar la descripcion');</script>"); } else { int Busqueda = Utilidades.TOINT(TextBoxFiltrar.Text); Listas = SubsidiosBLL.GetList(a => a.VendedorId == Busqueda); GridViewConsultaVenta.DataSource = Listas; GridViewConsultaVenta.DataBind(); } } else if (DropDownListFiltro.SelectedIndex == 2) { if (TextBoxFiltrar.Text == "") { base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debe de Insertar la descripcion');</script>"); } else { int Busqueda = Utilidades.TOINT(TextBoxFiltrar.Text); Listas = SubsidiosBLL.GetList(p => p.VendedorId == Busqueda); GridViewConsultaVenta.DataSource = Listas; GridViewConsultaVenta.DataBind(); } } GridViewConsultaVenta.DataSource = Listas; GridViewConsultaVenta.DataBind(); }