public HoursRecord(DateTime date, TimeSpan from, TimeSpan to, double price, double bonus, string description, int overTimeHours, int overTimeMinutes, WorkTime breakTime) { Id = Guid.NewGuid(); Date = date; WorkTimeFrom = from; WorkTimeTo = to; (int hours, int minutes) = CalculateHoursAndMinutes(); BreakTime = breakTime; Time = new WorkTime(hours, minutes); Time -= BreakTime; Price = price; Bonus = bonus; Description = description ?? ""; OverTime = new WorkTime(overTimeHours, overTimeMinutes); Type = ERecordType.Hours; GetRecordType = AppResource.HoursType; Value = (Time + OverTime).ToString(); }
protected bool Equals(WorkTime other) { return(Hours == other.Hours && Minutes == other.Minutes); }
public HoursRecord(DateTime date, TimeSpan from, TimeSpan to, double price, double bonus, string description, WorkTime overTime, WorkTime breakTime) : this(date, from, to, price, bonus, description, overTime.Hours, overTime.Minutes, breakTime) { }