diff --git a/OSTLibrary/Classes/Schedule.cs b/OSTLibrary/Classes/Schedule.cs index 2ea4b0f..acd8eba 100644 --- a/OSTLibrary/Classes/Schedule.cs +++ b/OSTLibrary/Classes/Schedule.cs @@ -10,10 +10,9 @@ public class Schedule public DateTime end; public string scope; public string contents; + public string target; - - - public Schedule(int author, string title, DateTime start, DateTime end,string scope, string contents) + public Schedule(int author, string title, DateTime start, DateTime end,string scope, string contents, string target) { this.author = author; this.title = title; @@ -21,6 +20,7 @@ public Schedule(int author, string title, DateTime start, DateTime end,string sc this.end = end; this.scope = scope; this.contents = contents; + this.target = target; } } } diff --git a/Server/Classes/Database.cs b/Server/Classes/Database.cs index e22e4d4..c9c938a 100644 --- a/Server/Classes/Database.cs +++ b/Server/Classes/Database.cs @@ -136,7 +136,7 @@ public static bool AddSchedule(Schedule schedule) DateTime Start = schedule.start; DateTime End = schedule.end; MySqlCommand cmd = new MySqlCommand( - "INSERT INTO schedule VALUES (@author, @title, @start, @end, @scope, @contents);", + "INSERT INTO schedule VALUES (@author, @title, @start, @end, @scope, @contents, @target);", con); cmd.Parameters.AddWithValue("@author", schedule.author); @@ -145,7 +145,8 @@ public static bool AddSchedule(Schedule schedule) cmd.Parameters.Add("@end", MySqlDbType.DateTime, 50).Value = End; cmd.Parameters.AddWithValue("@scope", schedule.scope); cmd.Parameters.AddWithValue("@contents", schedule.contents); - + cmd.Parameters.AddWithValue("@target", schedule.target); + try { cmd.ExecuteNonQuery(); @@ -175,7 +176,8 @@ public static List GetSchedule(Employee emp) rdr.GetDateTime("start"), rdr.GetDateTime("end"), rdr.GetString("scope"), - rdr.GetString("contents"))); + rdr.GetString("contents"), + rdr.GetString("target"))); } } return schedules;