/// <summary> /// Gets the local's alternate opening hours on a weekday /// </summary> /// <param name="local"></param> /// <param name="weekDay"></param> /// <returns>OpeningHours object</returns> public Task <OpeningHours> FetchOpHours(int local, int weekDay) { if (base.DQLCommand(Procedure.buscarHorarioAlternativoLocal, ref this.Data, new string[, ] { { "pLocal", local.ToString() }, { "pDia", weekDay.ToString() } })) { if (this.Data.HasRows) { OpeningHours opHours = null; while (this.Data.Read()) { opHours = new OpeningHours( weekDay, this.Data["hr_abertura"].ToString(), this.Data["hr_fechamento"].ToString() ); } this.Data.Close(); base.Disconnect(); return(Task.FromResult(opHours)); } base.Disconnect(); return(null); } return(null); }
/// <summary> /// Define alternate time constructor /// </summary> /// <param name="id"></param> /// <param name="openingHours"></param> public Local(int id, OpeningHours openingHours = null) : base() { this.IdLocal = id; this.OpeningHours = openingHours; }
/// <summary> /// Define/Update opening hours constructor /// </summary> /// <param name="shoppingId"></param> /// <param name="openingHours"></param> public Shopping(int id, OpeningHours openingHours = null) : base() { this.Id = id; this.OpeningHours = openingHours; }