Skip to content

Commit

Permalink
[ADD]New page
Browse files Browse the repository at this point in the history
  • Loading branch information
shev05 committed May 12, 2024
1 parent 28d778f commit 9dbcbb8
Show file tree
Hide file tree
Showing 30 changed files with 673 additions and 37 deletions.
18 changes: 15 additions & 3 deletions source/EduCATS/Data/DataAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,27 @@ public async static Task<CalendarSubjectModelTest> GetSchedule(string date)
var dataAccess = new DataAccess<CalendarSubjectModelTest>(
"today_calendar_error", getScheduleCallback(date), GlobalConsts.DataGetCalendarKey);
return await GetDataObject(dataAccess, false) as CalendarSubjectModelTest;
}

}

/// <summary>
/// Fetch schedule calendar data.
/// </summary>
/// <param name="username">Username.</param>
/// <returns>Calendar data.</returns>
public async static Task<CalendarEventModelTest> GetEvent(string date)
{
var dataAccess = new DataAccess<CalendarEventModelTest>(
"today_calendar_error", getEventCallback(date), GlobalConsts.DataGetCalendarKey);
return await GetDataObject(dataAccess, false) as CalendarEventModelTest;
}

/// <summary>
/// Fetch statistics.
/// </summary>
/// <param name="subjectId">Subject ID.</param>
/// <param name="groupId">Group ID.</param>
/// <returns>Statistics data.</returns>
public async static Task<StatsModel> GetStatistics(int subjectId, int groupId)
public async static Task<StatsModel> GetStatistics(int subjectId, int groupId)
{
var dataAccess = new DataAccess<StatsModel>(
"stats_marks_error", getStatsCallback(subjectId, groupId),
Expand Down
8 changes: 8 additions & 0 deletions source/EduCATS/Data/DataAccessCallbacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ public static partial class DataAccess
static async Task<object> getScheduleCallback(
string date) => await AppServices.GetSchedule(date);

/// <summary>
/// Schedule callback.
/// </summary>
/// <param name="username">Username.</param>
/// <returns>Calendar data.</returns>
static async Task<object> getEventCallback(
string date) => await AppServices.GetEvent(date);

/// <summary>
/// Statistics callback.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion source/EduCATS/Data/DataAccessTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void ResetData()
public async static Task<object> GetDataObject<T>(IDataAccess<T> dataAccess, bool isList)
{
object objectToGet;

var x = dataAccess;
if (isList) {
objectToGet = await dataAccess.GetList();
} else {
Expand Down
39 changes: 39 additions & 0 deletions source/EduCATS/Data/Models/Calendar/CalendarEventModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace EduCATS.Data.Models.Calendar
{
public class CalendarEventModelTest
{
[JsonProperty("Notes")]
public List<Event> Event { get; set; }

public CalendarEventModelTest()
{
Event = new List<Event>();
}
}

public class Event
{
[JsonProperty("Color")]
public string Color { get; set; }

[JsonProperty("EndTime")]
public string End { get; set; }

[JsonProperty("Text")]
public string Name { get; set; }

[JsonProperty("StartTime")]
public string Start { get; set; }

/*
[JsonProperty("Notes")]
public string[] Notes { get; set; }
*/
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public class Schedule

[JsonProperty("Type")]
public int Type { get; set; }

[JsonProperty("Notes")]
public string[] Notes { get; set; }

}

Expand Down
2 changes: 0 additions & 2 deletions source/EduCATS/EduCATS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<Folder Include="Helpers\Date\Extensions\" />
<Folder Include="Helpers\Date\Enums\" />
<Folder Include="Data\Models\News\" />
<Folder Include="Data\Models\Calendar\" />
<Folder Include="Pages\Today\NewsDetails\" />
<Folder Include="Pages\Today\NewsDetails\Views\" />
<Folder Include="Pages\Today\NewsDetails\ViewModels\" />
Expand Down Expand Up @@ -119,7 +118,6 @@
<Folder Include="Pages\Recommendations\Views\ViewCells\" />
<Folder Include="Pages\Recommendations\ViewModels\" />
<Folder Include="Pages\Recommendations\Models\" />
<Folder Include="Pages\Settings\" />
<Folder Include="Pages\Settings\Base\" />
<Folder Include="Pages\Settings\Base\Models\" />
<Folder Include="Pages\Settings\Base\ViewModels\" />
Expand Down
8 changes: 8 additions & 0 deletions source/EduCATS/Helpers/Forms/Pages/AppPages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using EduCATS.Pages.SaveLabsAndPracticeMarks.Views;
using EduCATS.Pages.SaveMarks.Views;
using EduCATS.Pages.Settings.About.Views;
using EduCATS.Pages.Settings.Profile.Views;
using EduCATS.Pages.Settings.Base.Views;
using EduCATS.Pages.Settings.Fonts.Views;
using EduCATS.Pages.Settings.Language.Views;
Expand Down Expand Up @@ -229,6 +230,13 @@ public async Task ClosePage(bool modal, bool animated = true)
public async Task OpenSettingsAbout(string title) =>
await pushPage(new AboutPageView(), title);

/// <summary>
/// Change Application's main page without animation.
/// </summary>
/// <param name="newPage">Page to set.</param>
public async Task OpenProfileAbout(string title) =>
await pushPage(new ProfilePageView(), title);

/// <summary>
/// Change Application's main page without animation.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions source/EduCATS/Helpers/Forms/Pages/Interfaces/IPages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,12 @@ public interface IPages
/// <param name="title">Title.</param>
/// <returns>Task.</returns>
Task OpenSettingsAbout(string title);

/// <summary>
/// Open Settings About application page.
/// </summary>
/// <param name="title">Title.</param>
/// <returns>Task.</returns>
Task OpenProfileAbout(string title);
}
}
8 changes: 7 additions & 1 deletion source/EduCATS/Localization/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"main_statistics": "Статыстыка",
"main_settings": "Налады",

"today_subjects": "Прадметы",
"today_subjects": "Расклад",
"today_news": "Навіны",
"today_news_load_error": "Здарылася памылка падчас атрымання спісу навін. Калі ласка абнавіце старонку альбо звярніцеся ў службу падтрымкі.",
"today_subjects_error": "Здарылася памылка падчас атрымання спісу прадметаў. Калі ласка абнавіце старонку альбо звярніцеся ў службу падтрымкі.",
Expand Down Expand Up @@ -126,6 +126,7 @@
"settings_font": "Тэкст & Шрыфт",
"settings_delete": "Выдаліць акаўнт",
"settings_about": "Пра дадатак",
"settings_about_profile": "Аб акаўнце",
"settings_logout": "Выйсці",
"settings_logout_message": "Вы насамрэч жадаеце выйсці?",

Expand Down Expand Up @@ -173,6 +174,11 @@
"name": "Імя",
"surname": "Прозвішча",
"patronymic": "Імя па бацьку",
"login": "Лагін",
"email": "Пошта",
"phone": "Тэлефон",
"accountinfo": "Skype, Viber, Telegram і др.",
"about": "Пра сябе",
"confirm_password": "Пацверджанне пароля",
"select_secret_question": "Серкретный пытанне",
"choose_group": "Группа",
Expand Down
8 changes: 7 additions & 1 deletion source/EduCATS/Localization/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"main_statistics": "Statistik",
"main_settings": "Einstellungen",

"today_subjects": "Studienfächer",
"today_subjects": "Zeitplan",
"today_news": "Nachrichten",
"today_news_load_error": "Fehler beim abrufen der Nachrichtenliste. Bitte aktualisieren Sie die Seite oder Kontaktieren Sie den Support.",
"today_subjects_error": "Fehler beim abrufen der Artikelliste. Bitte aktualisieren Sie die Seite oder Kontaktieren Sie den Support.",
Expand Down Expand Up @@ -128,6 +128,7 @@
"settings_font": "Text & Schriftart",
"settings_delete": "Konto löschen",
"settings_about": "Über die App ",
"settings_about_profile": "Über das Konto",
"settings_logout": "Abmelden",
"settings_logout_message": "Möchten Sie wirklich abmelden?",

Expand Down Expand Up @@ -175,6 +176,11 @@
"name": "Name",
"surname": "Vorname",
"patronymic": "Patronym",
"login": "Anmeldung",
"email": "Post",
"phone": "Telefon",
"accountinfo": "Skype, Viber, Telegram und andere",
"about": "Über mich",
"confirm_password": "Confirm password",
"select_secret_question": "Spezifische Frage",
"select_group": "Group",
Expand Down
8 changes: 7 additions & 1 deletion source/EduCATS/Localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"main_statistics": "Statistics",
"main_settings": "Settings",

"today_subjects": "Subjects",
"today_subjects": "Schedule",
"today_news": "News",
"today_news_load_error": "Error occurred during retrieving news. Please try to refresh page or contact support.",
"today_subjects_error": "Error occurred during retrieving subjects. Please try to refresh page or contact support.",
Expand Down Expand Up @@ -128,6 +128,7 @@
"settings_font": "Text & Font",
"settings_delete": "Delete account",
"settings_about": "About application",
"settings_about_profile": "About the account",
"settings_logout": "Logout",
"settings_logout_message": "Are you sure you want to logout?",

Expand Down Expand Up @@ -175,6 +176,11 @@
"name": "Name",
"surname": "Last name",
"patronymic": "Patronymic",
"login": "Login",
"email": "Email",
"phone": "Telephone",
"accountinfo": "Skype, Viber, Telegram and other",
"about": "About",
"confirm_password": "Confirm password",
"select_secret_question": "Specific question",
"choose_group": "Group",
Expand Down
8 changes: 7 additions & 1 deletion source/EduCATS/Localization/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"main_statistics": "Statistika",
"main_settings": "Nustatymai",

"today_subjects": "Dalykai",
"today_subjects": "Tvarkaraštį",
"today_news": "Naujienos",
"today_news_load_error": "Gaunant naujienų sąrašą įvyko klaida. Atnaujinkite puslapį arba susisiekite su palaikymo tarnyba.",
"today_subjects_error": "Gaunant elementų sąrašą įvyko klaida. Atnaujinkite puslapį arba susisiekite su palaikymo tarnyba.",
Expand Down Expand Up @@ -129,6 +129,7 @@
"settings_font": "Tekstas ir šriftas",
"settings_delete": "Eliminare l'account",
"settings_about": "Apie programą",
"settings_about_profile": "Apie paskyrą",
"settings_logout": "Atsijungti",
"settings_logout_message": "Ar tikrai norite atsijungti ?",

Expand Down Expand Up @@ -176,6 +177,11 @@
"name": "Vardas",
"surname": "Pavardė",
"patronymic": "Tėvavardis",
"login": "Prisijungti",
"email": "Paštas",
"phone": "Telefonas",
"accountinfo": "Skype, Viber, Telegram ir kita",
"about": "Apie mane",
"confirm_password": "Patvirtinti slaptažodį",
"select_secret_question": "Konkretus klausimas",
"select_group": "Grupė",
Expand Down
8 changes: 7 additions & 1 deletion source/EduCATS/Localization/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"main_statistics": "Statystyk",
"main_settings": "Konfiguracja",

"today_subjects": "Dyscypliny",
"today_subjects": "harmonogram",
"today_news": "Wiadomości",
"today_news_load_error": "Wystąpił błąd podczas pobierania listy wiadomości. Proszę odświeżyć stronę lub skontaktować się z obsługą klienta.",
"today_subjects_error": "Wystąpił błąd podczas pobierania listy dyscyplin. Proszę odświeżyć stronę lub skontaktować się z obsługą klienta.",
Expand Down Expand Up @@ -127,6 +127,7 @@
"settings_font": "Tekst & Czcionka",
"settings_delete": "Usuń konto",
"settings_about": "Informacje o aplikacji",
"settings_about_profile": "O koncie",
"settings_logout": "Wyjść",
"settings_logout_message": "Czy na pewno chcesz wyjść?",

Expand Down Expand Up @@ -174,6 +175,11 @@
"name": "Nazwa",
"surname": "Nazwisko",
"patronymic": "Patronimiczny",
"login": "Zaloguj sie",
"email": "Poczta",
"phone": "Telefon",
"accountinfo": "Skype, Viber, Telegram i inne.",
"about": "O mnie",
"confirm_password": "Potwierdź hasło",
"select_secret_question": "Konkretne pytanie",
"choose_group": "Grupa",
Expand Down
8 changes: 7 additions & 1 deletion source/EduCATS/Localization/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"main_settings": "Настройки",


"today_subjects": "Предметы",
"today_subjects": "Расписание",
"today_news": "Новости",
"today_news_load_error": "Произошла ошибка во время получения списка новостей. Пожалуйста, обновите страницу или обратитесь в службу поддержки.",
"today_subjects_error": "Произошла ошибка во время получения списка предметов. Пожалуйста, обновите страницу или обратитесь в службу поддержки.",
Expand Down Expand Up @@ -131,6 +131,7 @@
"settings_font": "Текст & Шрифт",
"settings_delete": "Удалить аккаунт",
"settings_about": "О приложении",
"settings_about_profile": "Об аккаунте",
"settings_logout": "Выйти",
"settings_logout_message": "Вы действительно хотите выйти?",

Expand Down Expand Up @@ -178,6 +179,11 @@
"name": "Имя",
"surname": "Фамилия",
"patronymic": "Отчество",
"login": "Логин",
"email": "Почта",
"phone": "Телефон",
"accountinfo": "Skype, Viber, Telegram и др.",
"about": "О себе",
"confirm_password": "Подтверждение пароля",
"select_secret_question": "Секретный вопрос",
"choose_group": "Группа",
Expand Down
10 changes: 10 additions & 0 deletions source/EduCATS/Networking/AppServices/AppServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ public static async Task<object> GetSchedule(string date)
return await AppServicesController.Request(Links.GetSchedule + $"dateStart={date}&dateEnd={date}", AppDemoType.Schedule);
}

/// <summary>
/// Fetch calendar data request.
/// </summary>
/// <param name="username">Username.</param>
/// <returns>Calendar data.</returns>
public static async Task<object> GetEvent(string date)
{
return await AppServicesController.Request(Links.GetEvent + $"dateStart={date}&dateEnd={date}", AppDemoType.Schedule);
}

/// <summary>
/// Fetch statistics request.
/// </summary>
Expand Down
7 changes: 6 additions & 1 deletion source/EduCATS/Networking/Links.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ public static class Links
/// Get schedule calendar data URL.
/// </summary>
public static string GetSchedule => $"{Servers.Current}/Services/Schedule/ScheduleService.svc/GetSchedule?";


/// <summary>
/// Get schedule calendar data URL.
/// </summary>
public static string GetEvent => $"{Servers.Current}/Services/Notes/NotesService.svc/GetPersonalNotesBetweenDates?";

/// <summary>
/// Get laboratory works statistics URL.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class SavePracticeAndLabsPageView : ContentPage
{
static Thickness _padding = new Thickness(10, 1);
static Thickness _headerPadding = new Thickness(0, 10, 0, 10);
const double _controlHeight = 55;

private string _groupName;

Expand Down Expand Up @@ -137,7 +138,7 @@ Picker subGroupPicker()
var subGroupPicker = new Picker
{
BackgroundColor = Color.White,
HeightRequest = 70,
HeightRequest = _controlHeight,
};
subGroupPicker.SetBinding(Picker.ItemsSourceProperty, "SubGroup");
subGroupPicker.SetBinding(Picker.SelectedItemProperty, new Binding("SelectedSubGroup"));
Expand Down
3 changes: 2 additions & 1 deletion source/EduCATS/Pages/Settings/About/Views/AboutPageView.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using EduCATS.Constants;
using EduCATS.Data.Models;
using EduCATS.Helpers.Forms;
using EduCATS.Helpers.Forms.Styles;
using EduCATS.Pages.Settings.About.ViewModels;
using EduCATS.Themes;
using FFImageLoading.Forms;
using Nyxbull.Plugins.CrossLocalization;
using System.Collections.Generic;
using Xamarin.Forms;

namespace EduCATS.Pages.Settings.About.Views
Expand All @@ -13,7 +15,6 @@ public class AboutPageView : ContentPage
{
static Thickness _padding = new Thickness(20);
static Thickness _buttonsPadding = new Thickness(0, 0, 0, 10);

const double _spacing = 20;
const double _buttonHeight = 50;

Expand Down
Loading

0 comments on commit 9dbcbb8

Please sign in to comment.