This repository has been archived by the owner on Mar 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Se añadió un botón para consultar notas Actualizado icono App optimizada en tamaño y rendimiento Ventanas centradas a la pantalla Corregido error que no desactivaba notificaciones
- Loading branch information
Showing
67 changed files
with
9,440 additions
and
5,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"CurrentProjectSetting": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"ExpandedNodes": [ | ||
"" | ||
], | ||
"SelectedNode": "\\lxMeets.sln", | ||
"PreviewInSolutionExplorer": false | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Drawing; | ||
using System.Net; | ||
using System.Text.RegularExpressions; | ||
using System.Windows.Forms; | ||
|
||
namespace lxMeets | ||
{ | ||
public partial class GradeWindow : Form | ||
{ | ||
WebClient client = new WebClient(); | ||
string cedula = ""; | ||
public GradeWindow() | ||
{ | ||
InitializeComponent(); | ||
|
||
if (Properties.Settings.Default.Cedula.Length > 2) { cedula = Properties.Settings.Default.Cedula; } | ||
|
||
else | ||
{ | ||
cedula = lxMessageInputBox.ShowDialog("Ingresar número de cédula", "Ingresar número de cédula"); | ||
|
||
while ((cedula.Length < 9 && cedula.Length > 0) || !Regex.IsMatch(cedula, @"^\d+$")) | ||
{ | ||
if (cedula == "Cancel") break; | ||
MessageBox.Show("Cédula Inválida"); cedula = lxMessageInputBox.ShowDialog("Ingresar número de cédula", "Ingresar número de cédula"); | ||
} | ||
} | ||
if (cedula != "Cancel") fetchAPI(cedula); | ||
|
||
|
||
} | ||
|
||
private async void fetchAPI(string cedula) | ||
{ | ||
/* | ||
TODO | ||
Implementar selección de Año Lectivo | ||
API ya lista para consultar con año lectivo | ||
*/ | ||
try | ||
{ | ||
string url = @"https://api.lxndr.dev/uae/notas/?ced=" + cedula + "&aLect"; | ||
if (cedula.Length == 0) this.Close(); | ||
var json = await client.DownloadStringTaskAsync(url); | ||
dynamic stuff = JsonConvert.DeserializeObject(json); | ||
cargandoPicture.Visible = false; | ||
if ((bool)stuff.error) { MessageBox.Show(stuff.message.ToString()); this.Close(); } | ||
otraCButton.Visible = true; | ||
nombresLabel.Text = stuff.apellidos + " " + stuff.nombres; | ||
carreraLabel.Text = stuff.carrera; | ||
facultadLabel.Text = stuff.facultad; | ||
GenerateTable(stuff.parciales.Count, stuff.parciales[0].Count, tablaParcial, stuff, "parciales"); | ||
GenerateTable(stuff.promedios.Count, stuff.promedios[0].Count, tablaPromedio, stuff, "promedios"); | ||
} | ||
catch (Exception e) { } | ||
} | ||
|
||
private void GenerateTable(int rowCount, int columnCount, TableLayoutPanel tableController, dynamic stuff, string tipo) | ||
{ | ||
tableController.Controls.Clear(); | ||
tableController.ColumnStyles.Clear(); | ||
tableController.RowStyles.Clear(); | ||
tableController.AutoScroll = true; | ||
tableController.ColumnCount = columnCount; | ||
tableController.RowCount = rowCount; | ||
|
||
for (int x = 0; x < columnCount; x++) | ||
{ | ||
tableController.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); | ||
|
||
for (int y = 0; y < rowCount; y++) | ||
{ | ||
string toWrite = stuff[tipo][y][x].ToString(); | ||
Console.WriteLine(toWrite); | ||
if (x == 0) | ||
{ | ||
tableController.RowStyles.Add(new RowStyle(SizeType.AutoSize)); | ||
} | ||
|
||
Label cmd = new Label(); | ||
cmd.ForeColor = Color.White; | ||
cmd.Text = toWrite; | ||
tableController.Controls.Add(cmd, x, y); | ||
} | ||
} | ||
} | ||
|
||
|
||
private void button1_Click(object sender, EventArgs e) | ||
{ | ||
this.Close(); | ||
} | ||
|
||
private void otraCButton_Click(object sender, EventArgs e) | ||
{ | ||
cedula = lxMessageInputBox.ShowDialog("Ingresar número de cédula", "Ingresar número de cédula"); | ||
|
||
while ((cedula.Length < 9 && cedula.Length > 0) || !Regex.IsMatch(cedula, @"^\d+$")) | ||
{ | ||
if (cedula == "Cancel") break; | ||
MessageBox.Show("Cédula Inválida"); cedula = lxMessageInputBox.ShowDialog("Ingresar número de cédula", "Ingresar número de cédula"); | ||
} | ||
|
||
cargandoPicture.Visible = true; | ||
if (cedula == "Cancel") this.Close(); | ||
} | ||
|
||
private void GradeWindow_Shown(object sender, EventArgs e) | ||
{ | ||
if (cedula == "Cancel") this.Close(); | ||
} | ||
} | ||
} |
Oops, something went wrong.