Esempio n. 1
0
        protected void noConfirmarBtn_Click(object sender, EventArgs e)
        {
            Resultado resultado = new Resultado();

            try
            {
                LinkButton link = new LinkButton();
                link        = (LinkButton)sender;
                reserva.Tag = "NO_CONFIRMADA";
                string[] datos = link.CommandName.Split('-');
                reserva.IdSesion  = datos[0];
                reserva.IdUsuario = datos[1];
                resultado         = new ReservaLogica().Acciones(reserva);


                if (resultado.TipoResultado == "OK")
                {
                    string script = "swal('Excelente', 'Proceso exitoso', 'success'); ";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
                    reservasLst.DataSource = null;
                    reservasLst.DataBind();
                    ObtenerListado();
                }
                else
                {
                    string script = "swal('Lo sentimos, ha ocurrido un error', '" + resultado.Mensaje + "', 'error'); ";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
                }
            }
            catch (Exception ex)
            {
                string script = "swal('Error', '" + ex + "', 'error'); ";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
            }
        }
Esempio n. 2
0
        private void ObtenerListado()
        {
            Resultado resultado = new Resultado();

            try
            {
                reserva.Tag = "LISTADO_PENDIENTE";
                resultado   = new ReservaLogica().Acciones(reserva);
                if (resultado.TipoResultado == "OK")
                {
                    reservas = (List <Reserva>)resultado.ObjetoResultado;
                    reservasLst.DataSource = reservas;
                    reservasLst.DataBind();
                }
                else
                {
                    string script = "swal('Lo sentimos,', '" + resultado.Mensaje + "', 'info'); ";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
                }
            }
            catch (Exception ex)
            {
                string script = "swal('Lo sentimos,', '" + resultado.Mensaje + "', 'info'); ";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, true);
            }
        }