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);
 }
示例#2
0
 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;
         }
     }
 }
示例#3
0
 public static bool SoftDelete(City city)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         city.DeleteStatus = true;
         bool result = Update(city);
         return result;
     }
 }
示例#4
0
 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;
         }
     }
 }