protected void BtnSiguiente_Click(object sender, EventArgs e) { if (TbIdCobro.Text == string.Empty) { if (Session["CobroDetalle"] != null) { Cob = (CobroCxC)Session["CobroDetalle"]; } OtenerDatos(); if (Cob.Insertar()) { Alert("CobroCxC Se Guardo Corectamente"); Limpiar(); } else { Alert("CobroCxC No Se Pudo Guardar Corectamente"); } } else { OtenerDatos(); Limpiar(); if (Cob.Modificar()) { Alert("CobroCxC Se Modificada Corectamente"); } else { Alert("CobroCxC No Se Modificar Corectamente"); } } }
protected void BtnConsulta_Click(object sender, EventArgs e) { if (Tipo() == "Fecha") { GridViewVista.DataSource = CobroCxC.ListaF(TbDesde.Text, TbHasta.Text); GridViewVista.DataBind(); } else { GridViewVista.DataSource = CobroCxC.Lista("*", "CobroCxC Where " + Tipo() + " like'" + TbBuscar.Text + "%'"); GridViewVista.DataBind(); } }
protected void BtnAgregar_Click(object sender, EventArgs e) { if (Session["CobroDetalle"] != null) { Cob = (CobroCxC)Session["CobroDetalle"]; } Cob.AgregarDetalle(Convert.ToInt32(DdIdCxC.SelectedValue), Convert.ToDouble(TbValorDetalle.Text)); VistaGridView.DataSource = Cob.cobroDetalle; VistaGridView.DataBind(); Session["CobroDetalle"] = Cob; LimpiarDetalle(); }