Skip to content

Commit

Permalink
add target in schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
elfaka committed Jun 6, 2021
1 parent c07696d commit a4c0104
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions OSTLibrary/Classes/Schedule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ 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;
this.start = start;
this.end = end;
this.scope = scope;
this.contents = contents;
this.target = target;
}
}
}
8 changes: 5 additions & 3 deletions Server/Classes/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -175,7 +176,8 @@ public static List<Schedule> GetSchedule(Employee emp)
rdr.GetDateTime("start"),
rdr.GetDateTime("end"),
rdr.GetString("scope"),
rdr.GetString("contents")));
rdr.GetString("contents"),
rdr.GetString("target")));
}
}
return schedules;
Expand Down

0 comments on commit a4c0104

Please sign in to comment.