Example #1
0
 public void AddProfile(DoctorsProfile profile)
 {
     using (var context = new NETSTAREntities())
     {
         context.DoctorsProfiles.Add(profile);
         context.SaveChanges();
     }
 }
 public void Register(User user)
 {
     using (var context = new NETSTAREntities())
     {
         context.Users.Add(user);
         context.SaveChanges();
     }
 }
Example #3
0
        public DoctorsProfile GetByDiscipline(string discipline)
        {
            DoctorsProfile profile = new DoctorsProfile();

            using (var context = new NETSTAREntities())
            {
                profile = context.DoctorsProfiles.Where(x => x.Discipline.Equals(discipline)).FirstOrDefault();
            }
            return(profile);
        }
Example #4
0
        public DoctorsProfile GetByLastName(string lastName)
        {
            DoctorsProfile profile = new DoctorsProfile();

            using (var context = new NETSTAREntities())
            {
                profile = context.DoctorsProfiles.Where(x => x.Lastname == lastName).FirstOrDefault();
            }
            return(profile);
        }
Example #5
0
        public DoctorsProfile GetByHPCSANoo(int hpcsan0)
        {
            DoctorsProfile profile = new DoctorsProfile();

            using (var context = new NETSTAREntities())
            {
                profile = context.DoctorsProfiles.Where(x => x.HPCSANo == hpcsan0).FirstOrDefault();
            }
            return(profile);
        }
Example #6
0
        public DoctorsProfile GetByIDNo(int idNumber)
        {
            DoctorsProfile profile = new DoctorsProfile();

            using (var context = new NETSTAREntities())
            {
                profile = context.DoctorsProfiles.Where(x => x.IDNo == idNumber).FirstOrDefault();
            }
            return(profile);
        }
Example #7
0
        public DoctorsProfile GetByRegion(string region)
        {
            DoctorsProfile profile = new DoctorsProfile();

            using (var context = new NETSTAREntities())
            {
                profile = context.DoctorsProfiles.Where(x => x.Region == region).FirstOrDefault();
            }
            return(profile);
        }
Example #8
0
        public DoctorsProfile GetByProvince(string province)
        {
            DoctorsProfile profile = new DoctorsProfile();

            using (var context = new NETSTAREntities())
            {
                profile = context.DoctorsProfiles.Where(x => x.Province.Equals(province)).FirstOrDefault();
            }
            return(profile);
        }
Example #9
0
        public List <Profile> GetAllProfiles()
        {
            List <Profiler.Models.Profile> profiles = new List <Profile>();

            using (var context = new NETSTAREntities())
            {
                profiles = context.DoctorsProfiles.Select(x => new Profile()
                {
                    Discipline = x.Discipline, DoctorID = x.DoctorID, Firstname = x.Firstname, HPCSANo = x.HPCSANo, IDNo = x.IDNo, Lastname = x.Lastname, Province = x.Province, Region = x.Region, Title = x.Title
                }).ToList();
            }

            return(profiles);
        }