示例#1
0
        public void CriaMarcacao(AgenceModel agenceModel)
        {
            TimeSpan tsEntrada       = agenceModel._escala.Entrada;
            TimeSpan tsSaidaAlmoco   = agenceModel._escala.SaidaAlmoco;
            TimeSpan tsRetornoAlmoco = agenceModel._escala.RetornoAlmoco;
            TimeSpan tsSaida         = agenceModel._escala.Saida;

            TimeSpan tsDefault  = getTimeSpanDefault("08:30", "12:30", "14:00", "18:00");
            TimeSpan tsMarcacao = getTimeSpan(tsEntrada, tsSaidaAlmoco, tsRetornoAlmoco, tsSaida);

            Escala escala = new Escala();

            escala.Entrada       = tsEntrada;
            escala.SaidaAlmoco   = tsSaidaAlmoco;
            escala.RetornoAlmoco = tsRetornoAlmoco;
            escala.Saida         = tsSaida;

            var tipoDeOcorrencia = EnumTiposDeOcorrencias.Normal;

            if (tsDefault != tsMarcacao)
            {
                tipoDeOcorrencia = getTipoDeOcorrencia("08:30", tsEntrada);
                tipoDeOcorrencia = (tipoDeOcorrencia == EnumTiposDeOcorrencias.Normal) ? getTipoDeOcorrencia("18:00", tsSaida) : tipoDeOcorrencia;
                tipoDeOcorrencia = (tipoDeOcorrencia == EnumTiposDeOcorrencias.Normal) ? getTipoDeOcorrenciaAlmoco(tsSaidaAlmoco, tsRetornoAlmoco) : tipoDeOcorrencia;
            }

            AgenceModel getAgenceModel = new AgenceModel();

            getAgenceModel._escala       = escala;
            getAgenceModel._horasGeradas = tsMarcacao;
            if (tipoDeOcorrencia != EnumTiposDeOcorrencias.Normal)
            {
                getAgenceModel._tipo = tipoDeOcorrencia;
            }
            listaAgence.Add(getAgenceModel);

            IList <DateTime> marcacoes = new List <DateTime>();

            marcacoes.Add(Convert.ToDateTime(TimeSpan.Parse("08:30")));
            marcacoes.Add(Convert.ToDateTime(TimeSpan.Parse("12:30")));
            marcacoes.Add(Convert.ToDateTime(TimeSpan.Parse("14:00")));
            marcacoes.Add(Convert.ToDateTime(TimeSpan.Parse("18:00")));

            //getAgenceModel.Interpretar(marcacoes, escala);
        }
示例#2
0
 IList <IOcorrencia> IInterpretarMarcacoes.Interpretar(IList <DateTime> marcacoes, Escala escala)
 {
     throw new NotImplementedException();
 }