public OYSDateTime(IYear YYYY, IMonth MM, IDay DD, IHour hh, IMinute mm, ISecond ss) { this.Year = YYYY; this.Month = MM; this.Day = DD; this.Hour = hh; this.Minute = mm; this.Second = ss; }
public OYSTimeSpan(IYear Y, IMonth M, IWeek W, IDay D, IHour h, IMinute m, ISecond s) { this.Years = Y; this.Months = M; this.Days = D; this.Hours = h; this.Minutes = m; this.Seconds = s; }
public string GetTime(int iType) { if (iType == 1) { return(IHour.ToString() + ":" + IMinute.ToString() + ":" + ISecond.ToString()); } else { return(IHour.ToString() + ":" + IMinute.ToString()); } }
public void UpdateHour(IHour hourDTO) { Hour oldH = _store.Hours.Single(e => e.Id == hourDTO.Id); _store.Entry(oldH).CurrentValues.SetValues(hourDTO); oldH.VolunteerId = hourDTO.Volunteer.Id; oldH.CharityId = hourDTO.Charity.Id; _store.SaveChanges(); }
public IHttpActionResult Post([FromBody] IHour hour) { try { // TO-DO: replace with Created 201 response return(Ok(this.Service.CreateHour(hour))); } catch (Exception e) { return(InternalServerError()); } }
public static Hour CreateHour(IHour hourDTO) { if (hourDTO == null) return null; return new Hour { Id = hourDTO.Id, StartTime = hourDTO.StartTime, EndTime = hourDTO.EndTime, CharityRating = hourDTO.CharityRating, VolunteerRating = hourDTO.VolunteerRating }; }
public IHttpActionResult Put(int id, [FromBody] IHour hour) { try { this.Service.UpdateHour(hour); return(StatusCode(HttpStatusCode.NoContent)); } catch (InvalidOperationException e) { return(BadRequest()); } catch (Exception e) { return(InternalServerError()); } }
public static Hour CreateHour(IHour hourDTO) { if (hourDTO == null) { return(null); } return(new Hour { Id = hourDTO.Id, StartTime = hourDTO.StartTime, EndTime = hourDTO.EndTime, CharityRating = hourDTO.CharityRating, VolunteerRating = hourDTO.VolunteerRating }); }
public int CreateHour(IHour hourDTO) { Hour h = HourFactory.CreateHour(hourDTO); Charity c = _store.Charities.SingleOrDefault(e => e.Id == hourDTO.Charity.Id); if (c == null && hourDTO.Charity != null) { _store.Charities.Add(CharityFactory.CreateCharity(hourDTO.Charity)); } h.VolunteerId = hourDTO.Volunteer.Id; h.CharityId = hourDTO.Charity.Id; _store.Hours.Add(h); _store.SaveChanges(); return(h.Id); }
public void UpdateHour(IHour hourDTO) { throw new NotImplementedException(); }
public int CreateHour(IHour hourDTO) { throw new NotImplementedException(); }
public HourSummaryPresenter(IHourSummaryView view, IHour hour, IProject project) { this._View = view; this._Hour = hour; this._Project = project; }
public static IDateTime ToDateTime(this IHour input) => ObjectFactory.CreateDateTime(new System.DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, (int)input.RawValue, 0, 0));
public TimeSheetPresenter(ITimeSheetView view, IHour hour, IProject project) { this._View = view; this._Hour = hour; this._Project = project; }
public static ITimeSpan ToTimeSpan(this IHour input) => ObjectFactory.CreateTimeSpan(new System.TimeSpan(0, (int)input.RawValue, 0, 0));
public OYSTime(IHour hh, IMinute mm, ISecond ss) { this.Hour = hh; this.Minute = mm; this.Second = ss; }
private void ListHours(IHour mockHours) { mock.Expect.Once.On(mockHours).Method("List").Will(mock.Return.Value(helper.GetMockHoursData())); }
public int CreateHour(IHour hourDTO) { Hour h = HourFactory.CreateHour(hourDTO); Charity c = _store.Charities.SingleOrDefault(e => e.Id == hourDTO.Charity.Id); if (c == null && hourDTO.Charity != null) _store.Charities.Add(CharityFactory.CreateCharity(hourDTO.Charity)); h.VolunteerId = hourDTO.Volunteer.Id; h.CharityId = hourDTO.Charity.Id; _store.Hours.Add(h); _store.SaveChanges(); return h.Id; }