예제 #1
0
 /// <summary>
 /// Convert City Entity  into City Object
 /// </summary>
 ///<param name="model">CityViewModel</param>
 ///<param name="CityEntity">DataAccess.City</param>
 ///<returns>CityViewModel</returns>
 public static CityViewModel ToViewModel(
     this DataAccess.City entity,
     CityViewModel model)
 {
     model.Id        = entity.Id;
     model.CountryId = entity.ProvinceId;
     model.Name      = entity.Name;
     model.Country   = entity.Province.Name;
     model.IsActive  = entity.IsActive;
     return(model);
 }
 public JsonResult AddCity(City city)
 {
     string data = null;
     try
     {
         CityService.AddCity(city);
     }
     catch (Exception e)
     {
         data = e.Message;
     }
     return new JsonResult { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
 }
예제 #3
0
 public void AddCity(City city)
 {
     CityRepository.Add(city);
 }
예제 #4
0
		private void attach_City(City entity)
		{
			this.SendPropertyChanging();
			entity.SmallArea = this;
		}
예제 #5
0
		private void detach_City(City entity)
		{
			this.SendPropertyChanging();
			entity.SmallArea = null;
		}
예제 #6
0
		private void detach_City(City entity)
		{
			this.SendPropertyChanging();
			entity.Province = null;
		}
예제 #7
0
		private void attach_City(City entity)
		{
			this.SendPropertyChanging();
			entity.Province = this;
		}
예제 #8
0
 partial void DeleteCity(City instance);
예제 #9
0
 partial void UpdateCity(City instance);
예제 #10
0
 partial void InsertCity(City instance);