Exemplo n.º 1
0
 public static bool Delete(WordMeans mean)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.Entry(mean).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception)
         {
             return false;
             throw;
         }
     }
 }
Exemplo n.º 2
0
        public JsonResult AjaxInsertMean(int wordid,int langid,string mean)
        {
            WordMeans wm = new WordMeans();
            wm.LanguageId = langid;
            wm.WordId = wordid;
            wm.Mean = mean;
            if (AdminAccountBml.IsAuthenticated())
            {
                Administrator admin = AdminAccountBml.GetCurrentAdmin();
                wm.AdminId = admin.AdministratorId;
                wm.AdminName = admin.Username;
            }
            else
            {
                wm.AdminId = 1;
                wm.AdminName = "root";
            }

            bool result = WordsMeanBml.Insert(wm);
            return Json(result, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 3
0
 public static bool SoftDelete(WordMeans mean)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             mean.Status = true;
             bool result = Update(mean);
             return result;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Exemplo n.º 4
0
 public static bool Update(WordMeans mean)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             if (db.WordMeans.Any(v => v.Mean == mean.Mean))
                 return false;
             db.Entry(mean).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Exemplo n.º 5
0
 public static bool Insert(WordMeans mean)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             if (db.WordMeans.Any(v => v.Mean == mean.Mean))
                 return false;
             mean.Status = false;
             db.WordMeans.Add(mean);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }