private void AtualizarStatusAgendamento() { if (cbAgendamento.Text != "") { try { long id = Convert.ToInt64(cbAgendamento.Text.Split(' ')[0]); _agendamentoServico = new AgendamentoServico(); Agendamento agendamento = _agendamentoServico.Buscar(x => x.AgendamentoID == id).FirstOrDefault(); agendamento.Status = "Concluído"; _agendamentoServico.Editar(agendamento); } catch (Exception) { } } }
private void EditarAgendamento() { try { _agendamento.Tipo = cbTipo.Text; _agendamento.DataAtendimento = ArrumarDataHora(); _agendamento.AnimalID = Convert.ToInt64(cbPaciente.Text.Split(' ')[0]); _agendamento.Status = cbStatus.Text; _agendamento.Resumo = txtResumo.Text; _agendamentoServico.Editar(_agendamento); MessageBox.Show("TODAS AS ALTERAÇÕES FORAM SALVAS!", "INFO", MessageBoxButtons.OK, MessageBoxIcon.None); Close(); } catch (Exception) { MessageBox.Show("O PACIENTE INSERIDO É INVÁLIDO!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }