Example #1
0
        protected void btnGuardarTurno_Click(object sender, EventArgs e)
        {
            int      codigoCancha  = int.Parse(gvTurnos.GetRowValues(gvTurnos.FocusedRowIndex, "codigoCancha" + Session["nombreCancha"]).ToString());
            int      HoraDesde     = int.Parse(gvTurnos.GetRowValues(gvTurnos.FocusedRowIndex, "HoraDesde").ToString());
            int      HoraHasta     = int.Parse(gvTurnos.GetRowValues(gvTurnos.FocusedRowIndex, "HoraHasta").ToString());
            DateTime fechaDelTurno = Convert.ToDateTime(txtFechaGrillaTurnos.Date.ToString("dd/MM/yyyy"));

            ControladorTurnos.InsertarActualizarTurnoVariable(0, codigoCancha, fechaDelTurno.AddHours(HoraDesde), fechaDelTurno.AddHours(HoraHasta),
                                                              1, "", txtResponsable.Text, double.Parse(txtSeña.Text));

            pcTurno.ShowOnPageLoad = false;
            LoadGrillaTurnosNew();
        }
Example #2
0
        public string InsertarActualizarTurnoVariable(int codigoTurnoVariable, int codigoCancha, string fecha, int horaDesde, int horaHasta, int codigoUsuarioApp, string observaciones)
        {
            try
            {
                DateTime fechaHoraDesde = Convert.ToDateTime(fecha + " " + horaDesde.ToString("00") + ":00:00");
                DateTime fechaHoraHasta = Convert.ToDateTime(fecha + " " + horaHasta.ToString("00") + ":00:00");

                if (ControladorTurnos.ValidarTurnoDesocupado(fechaHoraDesde, fechaHoraHasta, codigoCancha))
                {
                    ControladorTurnos.InsertarActualizarTurnoVariable(codigoTurnoVariable, codigoCancha, fechaHoraDesde, fechaHoraHasta, codigoUsuarioApp, observaciones, string.Empty, 0.0);
                    return("ok");
                }
                else
                {
                    return("turnoOcupado");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }