Ejemplo n.º 1
0
        public City getCityById(int id)
        {
            CarpoolingDAL.City ci = new CarpoolingDAL.City();
            try {
                var query = db.Cities.Where(o => o.idCity == id).First();
                ci = query as CarpoolingDAL.City;
            } catch (Exception) {
                ci = null;
            }

            return(RepositoryUtility.createCityFromDALCity(ci));
        }
Ejemplo n.º 2
0
        public City getCityById(int id)
        {
            CarpoolingDAL.City ci = new CarpoolingDAL.City();
            try {
                var query = db.Cities.Where(o => o.idCity == id).First();
                ci = query as CarpoolingDAL.City;
            } catch (Exception) {
                ci = null;
            }

            return RepositoryUtility.createCityFromDALCity(ci);
        }
Ejemplo n.º 3
0
        public Country getCountryByCity(City city)
        {
            CarpoolingDAL.City   ci = new CarpoolingDAL.City();
            CarpoolingDAL.Coutry co = new CarpoolingDAL.Coutry();
            try {
                var query = db.Cities.Where(o => o.idCity == city.Id).First();
                ci = query as CarpoolingDAL.City;
                var query2 = db.Coutries.Where(o => o.idCoutry == ci.idCoutry).First();
                co = query2 as CarpoolingDAL.Coutry;
            } catch (Exception) {
                co = null;
            }

            return(RepositoryUtility.createCoutryFromDALCoutry(co));
        }
Ejemplo n.º 4
0
        public Country getCountryByCity(City city)
        {
            CarpoolingDAL.City ci = new CarpoolingDAL.City();
            CarpoolingDAL.Coutry co = new CarpoolingDAL.Coutry();
            try {
                var query = db.Cities.Where(o => o.idCity == city.Id).First();
                ci = query as CarpoolingDAL.City;
                var query2 = db.Coutries.Where(o => o.idCoutry == ci.idCoutry).First();
                co = query2 as CarpoolingDAL.Coutry;
            } catch (Exception) {
                co = null;
            }

            return RepositoryUtility.createCoutryFromDALCoutry(co);
        }
		private void detach_Cities(City entity)
		{
			this.SendPropertyChanging();
			entity.Coutry = null;
		}
		private void attach_Cities(City entity)
		{
			this.SendPropertyChanging();
			entity.Coutry = this;
		}
 partial void DeleteCity(City instance);
 partial void UpdateCity(City instance);
 partial void InsertCity(City instance);