public void PreencheCalendarioDeAlocacoes(Calendario cal, Recurso rec, bool datasOrdenadas) { if (!datasOrdenadas) { cal.Datas.Sort(); } DateTime data = cal.InicioG1; Alocacao alocacao; string[] listaHorarios = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "P" }; while (data != cal.FimG2) { if (data.DayOfWeek == DayOfWeek.Sunday) { foreach (string aux in listaHorarios) { alocacao = Alocacao.newAlocacao(rec, data, aux, null, null); //try //{ alocBO.InsereAlocacao(alocacao); //} //catch (Exception e) //{ // throw e; //} } data = data.AddDays(1); } data = data.AddDays(1); } }
public void Aloca(DateTime data, string horario, TurmaDistribuicao t) { Aula aula = t.GetAula(data, horario); Alocacao aloc = Alocacao.newAlocacao(rec, data, horario, aula, null); alocacoes.Add(aloc); }
public void PreencheCalendarioDeAlocacoes(Entities.Calendario cal, Recurso rec, bool datasOrdenadas) { if (!datasOrdenadas) { cal.Datas.Sort(); } DateTime data = cal.InicioG1; Alocacao alocacao; string[] listaHorarios = { "A", "B", "C", "D", "E", "X", "F", "G", "H", "I", "J", "K", "L", "M", "N", "P" }; while (data != cal.FimG2) { foreach (string aux in listaHorarios) { alocacao = Alocacao.newAlocacao(rec, data, aux, null, null); this.InsereAlocacao(alocacao); } data = data.AddDays(1); } }