Esempio n. 1
0
        public AgendaCommand Cadastrar(AgendaCommand agendaCommand)
        {
            if (agendaCommand.TipoDeServicoId == null)
            {
                return(null);
            }

            var tipoDeServico = _tipoDeServicoService.ObterPorId(agendaCommand.TipoDeServicoId.Value);
            var agenda        = AgendaAdapter.ToDomainModel(agendaCommand);

            agenda.CalcularDataFimAgendamentoPeloTipoDeServico(tipoDeServico.TempoGastoEmMinutos);

            var agendaRetorno = _agendaService.Adicionar(agenda);

            if (Commit())
            {
                return(AgendaAdapter.ToModelDomain(_agendaService.ObterPorId(agendaRetorno.IdAgenda)));
            }

            return(null);
        }
Esempio n. 2
0
        public override void OnCreateView(LayoutInflater inflater, ViewGroup container)
        {
            base.OnCreateView(inflater, container);

            #region Desinger Stuff

            SetContentView(Resource.Layout.FragmentAgenda, inflater, container);

            this.HasOptionsMenu = true;

            #endregion

            this.Title = "Agenda";

            this.ActionBar.Show();

            _adapter = new AgendaAdapter(this, new TodoItem[0]);
            this.TaskList.SetAdapter(_adapter);
            this.TaskList.ItemSelected  += TaskList_ItemSelected;
            this.TaskList.ItemLongPress += TaskList_ItemLongPress;
            this.TaskList.ItemCommand   += TaskList_ItemCommand;

            RefreshTodoItems();
        }
Esempio n. 3
0
        public IEnumerable <AgendaCommand> ObterTodosPor(Guid idEstabelecimento, Guid idFuncionario)
        {
            var lista = new List <AgendaCommand>();

            _agendaService.ObterTodosPor(idEstabelecimento, idFuncionario).ToList().ForEach(m => lista.Add(AgendaAdapter.ToModelDomain(m)));

            return(lista);
        }