public JsonResult AjaxInsertWord(string wordname)
 {
     Words word = new Words();
     word.Word = wordname;
     bool result = WordsBml.Insert(word);
     return Json(result, JsonRequestBehavior.AllowGet);
 }
Beispiel #2
0
 public static bool Delete(Words word)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.Entry(word).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Beispiel #3
0
 public static bool Insert(Words word)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             if (db.Words.Any(v => v.Word == word.Word))
                 return false;
             word.Status = false;
             db.Words.Add(word);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Beispiel #4
0
 public static bool Update(Words word)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             if (db.Words.Any(v => v.Word == word.Word))
                 return false;
             db.Entry(word).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }