Пример #1
0
        public void UpdatePerson(person objPerson)
        {
            using (var dataContext = new FinalAppWebEntities())
            {
                //Get object from database
                var trs = from t in dataContext.people
                          where t.ID == objPerson.ID
                          select t;
                person transaction = new person();
                transaction = trs.FirstOrDefault();

                try
                {
                    //Update field by field
                    transaction.name        = objPerson.name;
                    transaction.lastName    = objPerson.lastName;
                    transaction.gender      = objPerson.gender;
                    transaction.age         = objPerson.age;
                    transaction.phone       = objPerson.phone;
                    transaction.email       = objPerson.email;
                    transaction.dateOfBith  = objPerson.dateOfBith;
                    transaction.address     = objPerson.address;
                    transaction.nationality = objPerson.nationality;
                    dataContext.SaveChanges();
                }
                catch (Exception) {
                    Console.WriteLine("enviado   == " + objPerson.name + " id   " + objPerson.ID);
                }
            }
        }
Пример #2
0
 public void createService(service objService)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         dataContext.services.Add(objService);
         dataContext.SaveChanges();
     }
 }
Пример #3
0
 public void CreateClinicDate(clinicDate obj)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         dataContext.clinicDates.Add(obj);
         dataContext.SaveChanges();
     }
 }
 public void CreateClinicHistory(clinicHistory objClinicHistory)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         dataContext.clinicHistories.Add(objClinicHistory);
         dataContext.SaveChanges();
     }
 }
Пример #5
0
 public void CreateSpeciality(speciality objSpeciality)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         dataContext.specialities.Add(objSpeciality);
         dataContext.SaveChanges();
     }
 }
Пример #6
0
 public void CreateClinicHistory_Allergy(clinicHistory_Alergie objDoctor_Speciality)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         dataContext.clinicHistory_Alergie.Add(objDoctor_Speciality);
         dataContext.SaveChanges();
     }
 }
Пример #7
0
 public void CreateUser(user objUser)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         dataContext.users.Add(objUser);
         dataContext.SaveChanges();
     }
 }
Пример #8
0
 public void CreateNurse(nurse objNurse)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         //LINQ
         //return dataContext.Customers.ToList();
         dataContext.nurses.Add(objNurse);
         dataContext.SaveChanges();
     }
 }
Пример #9
0
 public void CreatePerson(person objPerson)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         //LINQ
         //return dataContext.Customers.ToList();
         dataContext.people.Add(objPerson);
         dataContext.SaveChanges();
     }
 }
Пример #10
0
 public void CreateDoctor(doctor objDoctor)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         //LINQ
         //return dataContext.Customers.ToList();
         dataContext.doctors.Add(objDoctor);
         dataContext.SaveChanges();
     }
 }
Пример #11
0
 public void CreateDoctorSpeciality(doctor_speciality objDoctor_Speciality)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         //LINQ
         //return dataContext.Customers.ToList();
         dataContext.doctor_speciality.Add(objDoctor_Speciality);
         dataContext.SaveChanges();
     }
 }
Пример #12
0
 public void CreateAdmin(admin objAdmin)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         //LINQ
         //return dataContext.Customers.ToList();
         dataContext.admins.Add(objAdmin);
         dataContext.SaveChanges();
     }
 }
Пример #13
0
 public void CreatePatient(patient objPatient)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         //LINQ
         //return dataContext.Customers.ToList();
         dataContext.patients.Add(objPatient);
         dataContext.SaveChanges();
     }
 }
Пример #14
0
 public void deleteService(service objService)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         var cust = from c in dataContext.services
                    where c.ID == objService.ID
                    select c;
         service objCustomer = cust.FirstOrDefault();
         dataContext.services.Remove(objCustomer);
         dataContext.SaveChanges();
     }
 }
Пример #15
0
 public void updateService(service objService)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         var trs = from t in dataContext.services
                   where t.ID == objService.ID
                   select t;
         service transaction = trs.FirstOrDefault();
         //Update field by field
         objService.status = true;
         dataContext.SaveChanges();
     }
 }
Пример #16
0
 public void DeletePatient(int id)
 {
     using (var dataContext =
                new FinalAppWebEntities())
     {
         var cust = from c in dataContext.patients
                    where c.id == id
                    select c;
         patient objPatient = cust.FirstOrDefault();
         dataContext.patients.Remove(objPatient);
         dataContext.SaveChanges();
     }
 }
Пример #17
0
 public void updateClinicDate(clinicDate obj)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         var trs = from t in dataContext.clinicDates
                   where t.id == obj.id
                   select t;
         clinicDate transaction = trs.FirstOrDefault();
         //Update field by field
         transaction.status = obj.status;
         dataContext.SaveChanges();
     }
 }
Пример #18
0
 public void DeleteNurse(int id)
 {
     using (var dataContext =
                new FinalAppWebEntities())
     {
         var cust = from c in dataContext.nurses
                    where c.id == id
                    select c;
         nurse objNurse = cust.FirstOrDefault();
         dataContext.nurses.Remove(objNurse);
         dataContext.SaveChanges();
     }
 }
Пример #19
0
 public void DeleteDoctor(int id)
 {
     using (var dataContext =
                new FinalAppWebEntities())
     {
         var cust = from c in dataContext.doctors
                    where c.id == id
                    select c;
         doctor objDoctor = cust.FirstOrDefault();
         dataContext.doctors.Remove(objDoctor);
         dataContext.SaveChanges();
     }
 }
Пример #20
0
 public void deleteCLnicDate(clinicDate obj)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         //Load customer object
         var cust = from c in dataContext.clinicDates
                    where c.id == obj.id
                    select c;
         clinicDate objCustomer = cust.FirstOrDefault();
         //Remove
         dataContext.clinicDates.Remove(objCustomer);
         //Save
         dataContext.SaveChanges();
     }
 }
Пример #21
0
        public void UpadteUser(user objUser)
        {
            using (var dataContext = new FinalAppWebEntities())
            {
                var trs = from t in dataContext.users
                          where t.id == objUser.id
                          select t;
                user transaction = trs.FirstOrDefault();
                //Update field by field
                transaction.username = objUser.username;
                transaction.password = objUser.password;
                transaction.email    = objUser.email;

                dataContext.SaveChanges();
            }
        }
Пример #22
0
 public void deleteClinicHistoryAllergy(int id)
 {
     using (var dataContext =
                new FinalAppWebEntities())
     {
         //Load customer object
         var cust = from c in dataContext.clinicHistory_Alergie
                    where c.id == id
                    select c;
         clinicHistory_Alergie objCustomer = cust.FirstOrDefault();
         //Remove
         dataContext.clinicHistory_Alergie.Remove(objCustomer);
         //Save
         dataContext.SaveChanges();
     }
 }
Пример #23
0
 public void DeleteSpeciality(int specialityId)
 {
     using (var dataContext =
                new FinalAppWebEntities())
     {
         //Load customer object
         var cust = from c in dataContext.specialities
                    where c.ID == specialityId
                    select c;
         speciality objCustomer = cust.FirstOrDefault();
         //Remove
         dataContext.specialities.Remove(objCustomer);
         //Save
         dataContext.SaveChanges();
     }
 }
Пример #24
0
 public void UpdateClinicHistory(clinicHistory objClinicHistory)
 {
     using (var dataContext = new FinalAppWebEntities())
     {
         var trs = from t in dataContext.clinicHistories
                   where t.id == objClinicHistory.id
                   select t;
         clinicHistory transaction = trs.FirstOrDefault();
         //Update field by field
         transaction.date        = objClinicHistory.date;
         transaction.weight      = objClinicHistory.weight;
         transaction.height      = objClinicHistory.height;
         transaction.description = objClinicHistory.description;
         dataContext.SaveChanges();
     }
 }