Exemplo n.º 1
0
        public void Insert(Appointment app)
        {
            var context = new VetDbContext();

            context.Appointments.Add(app);
            context.SaveChanges();
        }
Exemplo n.º 2
0
        public void Delete(int id)
        {
            var context = new VetDbContext();

            context.Appointments.Remove(context.Appointments.Find(id));
            context.SaveChanges();
        }
Exemplo n.º 3
0
        public void Insert(Client cli)
        {
            var context = new VetDbContext();

            context.Clients.Add(cli);
            context.SaveChanges();
        }
Exemplo n.º 4
0
        public void Insert(Doctor doc)
        {
            var db = new VetDbContext();

            db.Doctors.Add(doc);
            db.SaveChanges();
        }
Exemplo n.º 5
0
        public void Insert(Patient patient)
        {
            var context = new VetDbContext();

            context.Patients.Add(patient);
            context.SaveChanges();
        }
Exemplo n.º 6
0
        public void Insert(Room room)
        {
            var db = new VetDbContext();

            db.Rooms.Add(room);
            db.SaveChanges();
        }
Exemplo n.º 7
0
        public void Delete(int id)
        {
            var db  = new VetDbContext();
            var doc = db.Doctors.Find(id);

            db.Doctors.Remove(doc);
            db.SaveChanges();
        }
Exemplo n.º 8
0
        public void Delete(int id)
        {
            var context = new VetDbContext();
            var patient = context.Patients.Find(id);

            context.Patients.Remove(patient);
            context.SaveChanges();
        }
Exemplo n.º 9
0
        public void Delete(int id)
        {
            var  db   = new VetDbContext();
            Room room = db.Rooms.Find(id);

            db.Rooms.Remove(room);
            db.SaveChanges();
        }
Exemplo n.º 10
0
        public void Update(Room entity)
        {
            var  context  = new VetDbContext();
            Room editRoom = context.Rooms.Find(entity.Id);

            if (entity != null)
            {
                editRoom.Location = entity.Location;
                editRoom.Name     = entity.Name;
            }
            context.SaveChanges();
        }
Exemplo n.º 11
0
        public void Update(Client updated)
        {
            var context = new VetDbContext();
            var client  = context.Clients.Find(updated.Id);

            if (client != null)
            {
                client.FullName    = updated.FullName;
                client.Email       = updated.Email;
                client.PhoneNumber = updated.PhoneNumber;
            }
            context.SaveChanges();
        }
Exemplo n.º 12
0
        public void Update(Doctor update)
        {
            var    db  = new VetDbContext();
            Doctor doc = db.Doctors.Find(update.Id);

            if (doc != null)
            {
                doc.Name        = update.Name;
                doc.LastName    = update.LastName;
                doc.Email       = update.Email;
                doc.Address     = update.Address;
                doc.PhoneNumber = update.PhoneNumber;
            }
            db.SaveChanges();
        }
Exemplo n.º 13
0
        public void Update(Patient updated)
        {
            var context = new VetDbContext();
            var patient = context.Patients.Find(updated.Id);

            if (!(patient is null))
            {
                patient.Name     = updated.Name;
                patient.Gender   = updated.Gender;
                patient.Owner    = updated.Owner;
                patient.ClientId = updated.ClientId;
                patient.ImgPath  = updated.ImgPath;
            }
            context.SaveChanges();
        }
Exemplo n.º 14
0
        public void Update(Appointment updated)
        {
            var context = new VetDbContext();
            var app     = context.Appointments.Find(updated.Id);

            if (app != null)
            {
                app.PatientId   = updated.PatientId;
                app.RoomId      = updated.RoomId;
                app.DoctorId    = updated.DoctorId;
                app.StartDate   = updated.StartDate;
                app.EndDate     = updated.EndDate;
                app.Description = updated.Description;
            }
            context.SaveChanges();
        }