Пример #1
0
 protected void btnAsignar_Click(object sender, EventArgs e)
 {
     if (controlUsuario.obtenerUsuarioDeSession(this).fk_idtipo == 0)
     {
         if (Convert.ToInt32(tabItemSeleccionado.Value) < 2 && !String.IsNullOrWhiteSpace(idEventoSeleccionado.Value))
         {
                 registroEvento = controlEventos.obtenerEvento(Convert.ToInt32(idEventoSeleccionado.Value));
                 cbSeguimiento.SelectedValue = registroEvento.tblservicio.fk_idusuario_apoyo.ToString();
                 cbSoporte.SelectedValue = registroEvento.tblservicio.fk_idusuario_soporte.ToString();
                 ScriptManager.RegisterStartupScript(this.UpdateBtns, GetType(), "btnAsignarActivado", "$('#ModalAsignar').modal('show');", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.UpdateBtns, GetType(), "restriccion", "alertify.error('Seleccione un evento abierto o en proceso')", true);
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this.UpdateBtns, GetType(), "restriccion", "alertify.error('Acción solamente para usuarios de soporte')", true);
     }
 }
Пример #2
0
 protected void prepararModalRecursos(int idEvento, UpdatePanel iniciador)
 {
     registroEvento = controlEventos.obtenerEvento(idEvento);
     idEventoSeleccionado.Value = idEvento.ToString();
     txtTitulo.Text = registroEvento.nombre;
     txtObservaciones.Text = registroEvento.observacion;
     this.cargarTablasRequerimientos();
     ScriptManager.RegisterStartupScript(iniciador, GetType(), "btnRecursosActivado", "$('#ModalRecursos').modal('show');", true);
 }
Пример #3
0
        protected void btnEditar_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(tabItemSeleccionado.Value) < 2 && !String.IsNullOrWhiteSpace(idEventoSeleccionado.Value))
                {

                    this.configurarModal("Modificar eventos", false, false);
                    registroEvento = controlEventos.obtenerEvento(Convert.ToInt32(idEventoSeleccionado.Value));
                    txtTituloNuevo.Text = registroEvento.nombre;
                    cbAcomodo.SelectedValue = registroEvento.fk_idacomodo.ToString();
                    cbTipo.SelectedValue = registroEvento.fk_idtipo.ToString();
                    txtAsistencia.Text = registroEvento.asistencia.ToString();
                    txtDescripcion.Text = registroEvento.tblservicio.descripcion;
                    cbLugares.SelectedValue = registroEvento.fk_idlugar.ToString();
                    txtFecha.Text = registroEvento.fecha_realizacion.Date.ToString("yyyy-MM-dd");
                    txtHoraFinal.Text = registroEvento.tblservicio.hora_final.Value.TimeOfDay.ToString();
                    txtHoraInicial.Text = registroEvento.tblservicio.hora_inicial.Value.TimeOfDay.ToString();
                    accion.Value = "editar";
                    ScriptManager.RegisterStartupScript(this.UpdateBtns, GetType(), "btnEditarActivado", "$('#ModalNuevo').modal('show');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.UpdateBtns, GetType(), "restriccion", "alertify.error('Seleccione un evento abierto o en proceso')", true);
                }
        }
Пример #4
0
        public static bool insertarCompleto(int idSolicitante, int soporte, int seguimiento, string titulo, int lugar, int acomodo, int tipo, DateTime fecha, int asistencia, DateTime horaInicial, DateTime? horafinal, string descripcion, DateTime FechaSolicitud, DateTime? FechaCierre)
        {
            try
            {
                var servicio = controlServicios.insertar(descripcion, idSolicitante, soporte, seguimiento, 2, FechaSolicitud, FechaCierre, horaInicial, horafinal);

                if (servicio)
                {
                    var evento = new tblevento
                    {
                        id = obtenerUltimoEvento() + 1,
                        fk_idacomodo = acomodo,
                        asistencia = asistencia,
                        fecha_realizacion = fecha,
                        fk_idtipo = tipo,
                        fk_idlugar = lugar,
                        nombre = titulo,
                        observacion = "Sin observaciones",
                        fk_idservicio = controlServicios.obtenerUltimoServicio()
                    };
                    if (evento != null)
                    {
                        dbhelp.modelo.tblevento.Add(evento);
                        dbhelp.modelo.SaveChanges();

                        var encuesta = controlEncuestas.insertar(controlServicios.obtenerUltimoServicio());
                        if (encuesta)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }
            catch
            {
                dbhelp.UndoAll(dbhelp.modelo);
                return false;
            }
        }