Esempio n. 1
0
        public void Atualiza(PacienteTO paciente)
        {
            Paciente entity = this.Contexto.Pacientes.Where(p => p.id == paciente.Id).FirstOrDefault();

            entity.Apply(paciente);
            entity.DataEdicao = DateTime.Now;
            this.Contexto.Entry(entity).State = EntityState.Modified;
            this.Contexto.SaveChanges();
        }
Esempio n. 2
0
        public void Atualiza(PacienteTO paciente)
        {
            Paciente entity = this.GetPaciente(paciente.Id);

            entity.Apply(paciente);
            entity.DataModificacao            = DateTime.Now;
            this.Contexto.Entry(entity).State = EntityState.Modified;
            this.Contexto.SaveChanges();
        }
Esempio n. 3
0
        public void Novo(PacienteTO paciente)
        {
            Paciente entity = new Paciente();

            entity.DataCriacao = DateTime.Now;
            entity.DataEdicao  = DateTime.Now;
            entity.Apply(paciente);
            this.Contexto.Pacientes.Add(entity);
            this.Contexto.SaveChanges();
        }