protected void BotonReportesIngresos_Click(object sender, EventArgs e) { String MensajeDevuelto = ""; try { if(Page.IsValid) { validarFechaInicio(); validarFechaFinal(); cSGPRINGRESONegocios Ingreso = new cSGPRINGRESONegocios(Global.gCOD_APLICACION, "CA", 2, "cosejo"); string[] arregloFechas = TextBoxFechaInicio.Text.Split('/'); string fechaInicio = arregloFechas[1] + "/" + arregloFechas[0] + "/" + arregloFechas[2]; arregloFechas = TextBoxFechaFinal.Text.Split('/'); string fechaFinal = arregloFechas[1] + "/" + arregloFechas[0] + "/" + arregloFechas[2]; DataTable DT_Ingresos = Ingreso.SeleccionarPorFecha(Convert.ToDateTime(fechaInicio), Convert.ToDateTime(fechaFinal)); llenarTablaIngresos(TextBoxFechaInicio.Text, TextBoxFechaFinal.Text, DT_Ingresos); } LabelMensaje.ForeColor = System.Drawing.Color.Blue; } catch (Exception ex) { MensajeDevuelto = ex.Message; LabelMensaje.ForeColor = System.Drawing.Color.Red; } LabelMensaje.Text = MensajeDevuelto; }
protected void ButRegistrar_Click(object sender, EventArgs e) { try { cSGPRINGRESONegocios Negocios = new cSGPRINGRESONegocios(Global.gCOD_APLICACION, "CA", 1, "naquiros"); string[] stringFecha = TextBoxFecha.Text.Split('/'); DateTime fecha = new DateTime(Int32.Parse(stringFecha[2]), Int32.Parse(stringFecha[0]), Int32.Parse(stringFecha[1])); Negocios.FEC_INGRESO = fecha; Negocios.FEC_SISTEMA = DateTime.Now.Date; Negocios.CAR_USUARIOGIMNASIO = TextBoxId.Text; Negocios.Insertar(); Response.Write("<SCRIPT>alert('Se ha registrado correctamente dentro del sistema.')</SCRIPT>"); LabelNombre.Text = "Se ha registrado correctamente dentro del sistema"; LabelNombre.ForeColor = System.Drawing.Color.Blue; LabelNombre.Visible = true; } catch (Exception ex) { Response.Write("<SCRIPT>alert(''" + ex.Message + ")</SCRIPT>"); } }