public JsonResult AjaxInsertCountry(string countryname,string countrycode) { Country c = new Country(); c.CountryName = countryname; c.CountryCode = countrycode; bool result = CountryBml.Insert(c); return Json(result, JsonRequestBehavior.AllowGet); }
public static bool Delete(Country country) { using (FotografPaketiEntities db = new FotografPaketiEntities()) { try { db.Entry(country).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); return true; } catch (Exception ex) { return false; throw; } } }
public static bool Insert(Country country) { using (FotografPaketiEntities db = new FotografPaketiEntities()) { try { country.Status = false; db.Country.Add(country); db.SaveChanges(); return true; } catch (Exception ex) { return false; throw; } } }