コード例 #1
0
        public async Task <List <Modelos.CargaAcademica> > listaCargaAcademica()
        {
            List <Modelos.CargaAcademica> listaCarga = null;

            try
            {
                http             = new HttpClient();
                http.BaseAddress = new Uri(Settings.Settings.ip);

                //var authData = string.Format("{0}:{1}", "intertecs", "1nt3rt3c5");                        //auth
                //var authHeaderValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(authData)); //auth
                //http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeaderValue);

                var result = await http.GetAsync("/ws/sii/cargaacademica/" + Settings.Settings.nocont + "/" + Settings.Settings.token);//+Settings.settings.token);

                var cadena = result.Content.ReadAsStringAsync().Result;
                listaCarga = new List <Modelos.CargaAcademica>();
                var objJson = JObject.Parse(cadena);
                var arrJson = objJson.SelectToken("carga").ToList();

                Modelos.CargaAcademica carga;
                foreach (var kar in arrJson)
                {
                    carga = new Modelos.CargaAcademica();
                    carga = JsonConvert.DeserializeObject <Modelos.CargaAcademica>(kar.ToString());
                    listaCarga.Add(carga);
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }
            return(listaCarga);
        }
コード例 #2
0
        public CargaAcademica()
        {
            list_cargaAcademica = new List <Modelos.CargaAcademica>();
            objWSCarga          = new WSCargaAcademica();
            Title = "Carga Academica";
            Label lblCargaClave = new Label
            {
                Text          = "Clave",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            Label lblCargaGrupo = new Label
            {
                Text          = "Grupo",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            Label lblCargaMateria = new Label
            {
                Text          = "Materia",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            StackLayout stkCarga1 = new StackLayout
            {
                Padding           = new Thickness(10),
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Horizontal,
                BackgroundColor   = Color.FromHex("#2196F3"),
                Children          =
                {
                    lblCargaClave,
                    lblCargaGrupo,
                    lblCargaMateria
                }
            };

            lv_cargaAcademica = new ListView()
            {
                HasUnevenRows = true,
                ItemTemplate  = new DataTemplate(typeof(ResultCellCargaAcademica))
            };
            lv_cargaAcademica.ItemSelected += (sender, e) =>
            {
                Modelos.CargaAcademica sub = (Modelos.CargaAcademica)e.SelectedItem;
                DisplayAlert("Correcto", "Seleccion " + sub.cvemat, "Aceptar");
            };
            StackLayout st_inst = new StackLayout()
            {
                Orientation       = StackOrientation.Vertical,
                Padding           = new Thickness(10),
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Children          =
                {
                    stkCarga1,
                    lv_cargaAcademica
                }
            };

            Content = st_inst;
        }
コード例 #3
0
        private void crearGUI()
        {
            Title = Settings.Settings.nocont;
            var command = new Command(async() =>
            {
                await App.Current.MainPage.DisplayActionSheet(
                    "Información de " + Settings.Settings.nombreAlumno,
                    "Aceptar", null,
                    "No. Control: " + Settings.Settings.nocont,
                    "Nombre: " + Settings.Settings.nombreAlumno,
                    "Especialidad: " + Settings.Settings.especialidad);
            });
            ImageButton btnAlumno = new ImageButton
            {
                Source        = "a" + Settings.Settings.nocont + ".png",
                WidthRequest  = 80,
                Command       = command,
                HeightRequest = 80
            };
            StackLayout stkBarra1 = new StackLayout
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Vertical,
                WidthRequest      = 100,
                Children          =
                {
                    btnAlumno
                }
            };
            Label lblNombre = new Label
            {
                Text          = "Nombre",
                TextColor     = Color.Black,
                WidthRequest  = 100,
                HeightRequest = 30,
            };
            Label lblNoCont = new Label
            {
                Text          = "No. Control",
                TextColor     = Color.Black,
                WidthRequest  = 100,
                HeightRequest = 30,
            };
            Label lblEspecialidad = new Label
            {
                Text          = "Especialidad",
                TextColor     = Color.Black,
                WidthRequest  = 100,
                HeightRequest = 30,
            };
            StackLayout stkBarra2 = new StackLayout
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Vertical,
                WidthRequest      = 100,
                Children          =
                {
                    lblNombre,
                    lblNoCont,
                    lblEspecialidad
                }
            };

            lv_alumno = new ListView()
            {
                HasUnevenRows = true,
                ItemTemplate  = new DataTemplate(typeof(ResultCelll))
            };
            StackLayout stkBarra3 = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                Orientation       = StackOrientation.Vertical,
                WidthRequest      = 100,
                Children          =
                {
                    lv_alumno
                }
            };

            seccion1 = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Horizontal,
                HeightRequest     = 100,
                Children          =
                {
                    stkBarra1,
                    stkBarra2,
                    stkBarra3
                }
            };
            Label lblCargaClave = new Label
            {
                Text          = "Clave",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            Label lblCargaGrupo = new Label
            {
                Text          = "Grupo",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            Label lblCargaMateria = new Label
            {
                Text          = "Materia",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            Label lblCargaCal1 = new Label
            {
                Text          = "Ca1",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            Label lblCargaCal2 = new Label
            {
                Text          = "Cal2",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            Label lblCargaCal3 = new Label
            {
                Text          = "Cal3",
                TextColor     = Color.White,
                WidthRequest  = 100,
                HeightRequest = 35,
            };
            StackLayout stkCarga1 = new StackLayout
            {
                Padding           = new Thickness(10),
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Horizontal,
                BackgroundColor   = Color.FromHex("#2196F3"),
                Children          =
                {
                    lblCargaClave,
                    lblCargaGrupo,
                    lblCargaMateria,
                    lblCargaCal1,
                    lblCargaCal2,
                    lblCargaCal3
                }
            };

            lv_cargaAcademica = new ListView()
            {
                HasUnevenRows = true,
                ItemTemplate  = new DataTemplate(typeof(ResultCellCarga))
            };
            lv_cargaAcademica.ItemSelected += (sender, e) =>
            {
                Modelos.CargaAcademica sub = (Modelos.CargaAcademica)e.SelectedItem;
                DisplayAlert("Correcto", "Seleccion " + sub.cvemat, "Aceptar");
            };
            seccion2 = new StackLayout
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Vertical,
                HeightRequest     = 315,
                Children          =
                {
                    stkCarga1,
                    lv_cargaAcademica
                }
            };
            btnKardex = new ImageButton
            {
                Source            = "iconoFondoKardex.png",
                Aspect            = Aspect.Fill,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                WidthRequest      = Application.Current.MainPage.Width,
                HeightRequest     = 100
            };
            btnKardex.Clicked += async(sender, args) => await Navigation.PushModalAsync(new DashBoardKardex());

            btnCargaAcademica = new ImageButton
            {
                Source            = "iconoFondoCargaAcademica.png",
                Aspect            = Aspect.Fill,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                WidthRequest      = Application.Current.MainPage.Width,
                HeightRequest     = 100
            };
            btnCargaAcademica.Clicked += async(sender, args) => await Navigation.PushModalAsync(new DashBoardCargaAcademica());

            btnOrdenEntrada = new ImageButton
            {
                Source            = "iconoFondoOrdenEntrada.png",
                Aspect            = Aspect.Fill,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                WidthRequest      = Application.Current.MainPage.Width,
                HeightRequest     = 100
            };
            btnOrdenEntrada.Clicked += async(sender, args) => await Navigation.PushModalAsync(new DashBoardOrdenEntrada());

            btnDatosPersonales = new ImageButton
            {
                Source            = "iconoFondoDatosPersonales.png",
                Aspect            = Aspect.Fill,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                WidthRequest      = Application.Current.MainPage.Width,
                HeightRequest     = 100
            };
            btnDatosPersonales.Clicked += async(sender, args) => await Navigation.PushModalAsync(new DashBoardDatosPersonales());

            btnEncuesta = new ImageButton
            {
                Source            = "iconoFondoEncuesta.png",
                Aspect            = Aspect.Fill,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                WidthRequest      = Application.Current.MainPage.Width,
                HeightRequest     = 100
            };
            btnEncuesta.Clicked += async(sender, args) => await Navigation.PushModalAsync(new DashBoardEncuesta());

            btnHorariosSemestre = new ImageButton
            {
                Source            = "iconoHorariosSemestre.png",
                Aspect            = Aspect.Fill,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                WidthRequest      = Application.Current.MainPage.Width,
                HeightRequest     = 100
            };
            btnHorariosSemestre.Clicked += async(sender, args) => await Navigation.PushModalAsync(new DashBoardHorariosSemestre());

            btnInscripcion = new ImageButton
            {
                Source            = "iconoFondoInscripcion.png",
                Aspect            = Aspect.Fill,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                WidthRequest      = Application.Current.MainPage.Width,
                HeightRequest     = 100
            };
            btnInscripcion.Clicked += async(sender, args) => await Navigation.PushModalAsync(new DashBoardInscripcion());

            stkLinea1 = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    = { btnKardex }
            };
            stkLinea2 = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    = { btnCargaAcademica }
            };
            stkLinea3 = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    = { btnDatosPersonales }
            };
            stkLinea4 = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    = { btnEncuesta }
            };
            stkLinea5 = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    = { btnOrdenEntrada }
            };
            stkLinea6 = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    = { btnHorariosSemestre }
            };
            stkLinea7 = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                Children    = { btnInscripcion }
            };
            seccion3 = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Vertical,
                Children          =
                {
                    stkLinea1,
                    stkLinea2,
                    stkLinea3,
                    stkLinea4,
                    stkLinea5,
                    stkLinea6,
                    stkLinea7
                }
            };
            layout = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Orientation       = StackOrientation.Vertical,
                Children          =
                {
                    seccion1,
                    seccion2,
                    seccion3
                }
            };
            scroll = new ScrollView
            {
                Content = layout
            };
            Content = scroll;
        }