1
0
mirror of https://github.com/XFox111/GUTSchedule.git synced 2026-04-22 06:58:01 +03:00

[1.0.7] Added schedule export for profs

Now export preferences are kept
This commit is contained in:
Michael Gordeev
2020-01-23 21:14:27 +03:00
parent 206f2786ef
commit 217d095174
11 changed files with 509 additions and 146 deletions
+4 -1
View File
@@ -1,4 +1,6 @@
namespace GUT.Schedule.Models
using System.Net.Http;
namespace GUT.Schedule.Models
{
public class DataSet
{
@@ -8,5 +10,6 @@
public string Group { get; set; }
public int Reminder { get; set; }
public bool AddGroupToTitle { get; set; }
public HttpClient HttpClient { get; set; }
}
}
@@ -0,0 +1,44 @@
using System;
namespace GUT.Schedule.Models
{
public class ProfessorSubject
{
public string Name { get; set; }
public string Type { get; set; }
public string Cabinet { get; set; }
public string Order { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string Groups { get; set; }
public ProfessorSubject(string name, string type, string cabinet, string groups, int year, int month, int day, string schedule)
{
Name = name;
Type = type;
Cabinet = cabinet;
Groups = groups;
string[] time = schedule.Split('-');
StartTime = new DateTime(year, month, day, int.Parse(time[0].Split('.')[0]), int.Parse(time[0].Split('.')[1]), 0);
EndTime = new DateTime(year, month, day, int.Parse(time[1].Split('.')[0]), int.Parse(time[1].Split('.')[1]), 0);
Order = time[0] switch
{
"09.00" => "1",
"10.45" => "2",
"13.00" => "3",
"14.45" => "4",
"16.30" => "5",
"18.15" => "6",
"20.00" => "7",
"10.30" => "2", //Расписание для пар по физ-ре
"12.00" => "3",
"13.30" => "4",
"15.00" => "5",
"18.00" => "7",
_ => ""
};
}
}
}