public ShiftElement(Shift shift, double wage) { InitializeComponent(); ShiftFromToTextBlock.Text = $"{shift.StartTime.Day}.{shift.StartTime.Month}.{shift.StartTime.Year}: " + $"{shift.StartTime.Hour}:{shift.StartTime.Minute} - " + $"{shift.EndTime.Hour}:{shift.EndTime.Minute}"; ShiftTimeSpanTextBlock.Text = $"{shift.WorkSpan.Hours}:{shift.WorkSpan.Minutes}:{shift.WorkSpan.Seconds}"; BreakTimeSpan.Text = $"{shift.BreakSpan.Hours}:{shift.BreakSpan.Minutes}:{shift.BreakSpan.Seconds}"; WageTextBlock.Text = $"{shift.WorkSpan.Hours*wage + shift.WorkSpan.Minutes*(wage/60)}€"; }
public void AddShift(string username, Shift shift) { UserDictionary[username].AddShift(shift); }
private AddShiftPackage(SerializationInfo info, StreamingContext context) { shift = info.GetValue("Shift", typeof(Shift)) as Shift; }