Пример #1
0
        private async void RegistraTema()
        {
            if (string.IsNullOrEmpty(Nombre))
            {
                Util.mensaje(1, "El nombre esta vacío");
                return;
            }

            this.Proceso = true;

            var conexion = await this.apiServicio.verificaConexion();

            if (!conexion.IsSuccess)
            {
                this.Proceso = false;
                Util.mensaje(1, conexion.Mensaje);
                return;
            }

            var client = MainVistaModelo.getInstancia().getWS();

            client.Timeout = 10000;

            cursoModelo cursoN = new cursoModelo {
                idCurso = this.idCurso
            };

            temaModelo tema = new temaModelo {
                nombre = this.Nombre, curso = cursoN
            };

            bool res = false;

            await Task.Run(() => res = client.agregaTema(tema));

            if (!res)
            {
                Util.mensaje(1, "El tema no pudo ser creado");
                this.Proceso = false;
                return;
            }

            CursoVistaModelo.getInstancia().cargaTemas();
            this.Proceso = false;
            Util.pantallaAnterior();
        }
Пример #2
0
 public TemaVistaModelo(int opcion, temaModelo tema, int idCurso)
 {
     this.tema        = tema;
     this.idCurso     = idCurso;
     this.apiServicio = new APIServicio();
     instancia        = this;
     //0 Indica que se debe de mostrar el registro del tema
     //1 Indica que se debe de mostrar la subida del archivo
     if (opcion == 0 && tema == null)
     {
         this.EsRegistro  = true;
         this.BotonActivo = true;
     }
     else
     {
         this.EsActividad = true;
         this.BotonActivo = true;
         this.cargaActividades();
     }
 }
        public ActividadVistaModelo(temaModelo tema, actividadModelo actividad)
        {
            this.tema      = tema;
            this.actividad = actividad;

            if (tema != null)
            {
                this.BotonActivo        = true;
                this.ResgistraActividad = true;
                this.FechaInicio        = DateTime.Today;
                this.FechaFin           = DateTime.Today;
                this.HoraInicio         = DateTime.Today;
                this.HoraFin            = DateTime.Today;
                this.ResgistraActividad = true;
            }

            if (actividad != null)
            {
                this.MuestraActividad = true;
                this.Descripcion      = actividad.descripcion;

                this.CargaArchivo();
            }
        }