public List <hospitaldata> hospitals()
        {
            database_class      database  = new database_class();
            var                 hospitals = from i in database.Hospitals select i;
            List <hospitaldata> hosp      = new List <hospitaldata>();

            foreach (var j in hospitals)
            {
                hospitaldata hd = new hospitaldata();
                hd.hospitalId   = j.HospitalId;
                hd.hospitalName = j.HospitalName;
                hd.MobileNumber = j.MobileNumber;
                hd.Address      = j.Address;
                hosp.Add(hd);
            }
            return(hosp);
        }
        public List <hospitaldata> chooshosp(int spid)
        {
            database_class      database = new database_class();
            var                 sps      = (from i in database.Doctors where i.SpecialistId == spid select i.HospitalId).Distinct();
            List <hospitaldata> hosp     = new List <hospitaldata>();

            foreach (var i in sps)
            {
                var hospital = from k in database.Hospitals where k.HospitalId == i select k;
                foreach (var j in hospital)
                {
                    hospitaldata hd = new hospitaldata();
                    hd.hospitalId   = j.HospitalId;
                    hd.hospitalName = j.HospitalName;
                    hd.MobileNumber = j.MobileNumber;
                    hd.Address      = j.Address;
                    hosp.Add(hd);
                }
            }
            return(hosp);
        }