protected void BtnGuardar_Click(object sender, EventArgs e) { if (TbIdPago.Text == string.Empty) { if (Session["PagoDetalle"] != null) { pag = (PagosCxP)Session["PagoDetalle"]; } OtenerDatos(); if (pag.Insertar()) { Alert("PagoCxP Se Guardo Corectamente"); Limpiar(); } else { Alert("PagoCxP No Se Pudo Guardar Corectamente"); } } else { OtenerDatos(); Limpiar(); if (pag.Modificar()) { Alert("PagoCxP Se Modificada Corectamente"); } else { Alert("PagoCxP No Se Modificar Corectamente"); } } }
protected void BtnConsulta_Click(object sender, EventArgs e) { if (Tipo() == "Fecha") { GridViewVista.DataSource = PagosCxP.ListaF(TbDesde.Text, TbHasta.Text); GridViewVista.DataBind(); } else { GridViewVista.DataSource = PagosCxP.Lista("*", "PagoCxP Where " + Tipo() + " like'" + TbBuscar.Text + "%'"); GridViewVista.DataBind(); } }
protected void BtnAgregar_Click(object sender, EventArgs e) { if (Session["PagoDetalle"] != null) { pag = (PagosCxP)Session["PagoDetalle"]; } pag.AgregarDetalle(Convert.ToInt32(DdIdCxP.SelectedValue), Convert.ToDouble(TbValorDetalle.Text)); VistaGridView.DataSource = pag.pagoDetalle; VistaGridView.DataBind(); Session["PagoDetalle"] = pag; LimpiarDetelle(); }