public JsonResult AjaxInsertLanguage(string languagename,string languagecode)
 {
     Languages lng = new Languages();
     lng.LanguageName = languagename;
     lng.LanguageCode = languagecode;
     bool result = LanguageBml.Insert(lng);
     return Json(result, JsonRequestBehavior.AllowGet);
 }
Esempio n. 2
0
 public static bool Delete(Languages language)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.Entry(language).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Esempio n. 3
0
 public static bool Insert(Languages language)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             bool isExist = IsExist(language.LanguageCode);
             if (isExist)
                 return false;
             language.Status = false;
             db.Languages.Add(language);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }