public JsonResult AjaxInsertCity(int countryid,string cityname,int citycode) { City city = new City(); city.CountryId = countryid; city.CityName = cityname; city.Code = citycode; bool result = CityBml.Insert(city); return Json(result, JsonRequestBehavior.AllowGet); }
public static bool Delete(City city) { using (FotografPaketiEntities db = new FotografPaketiEntities()) { try { db.Entry(city).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); return true; } catch (Exception ex) { return false; throw; } } }
public static bool SoftDelete(City city) { using (FotografPaketiEntities db = new FotografPaketiEntities()) { city.DeleteStatus = true; bool result = Update(city); return result; } }
public static bool Insert(City city) { using (FotografPaketiEntities db = new FotografPaketiEntities()) { try { city.DeleteStatus = false; db.City.Add(city); db.SaveChanges(); return true; } catch (Exception ex) { return false; throw; } } }