当前位置: 首页>>代码示例>>C#>>正文


C# FotografPaketiEntities.SaveChanges方法代码示例

本文整理汇总了C#中DataAccessLayer.FotografPaketiEntities.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# FotografPaketiEntities.SaveChanges方法的具体用法?C# FotografPaketiEntities.SaveChanges怎么用?C# FotografPaketiEntities.SaveChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataAccessLayer.FotografPaketiEntities的用法示例。


在下文中一共展示了FotografPaketiEntities.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Delete

 public static bool Delete(int pcid)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         PhotographerCities pc = Find(pcid);
         db.Entry(pc).State = System.Data.Entity.EntityState.Deleted;
         db.SaveChanges();
         return true;
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:10,代码来源:PhotographerCitiesBml.cs

示例2: Delete

 public static bool Delete(int wordid)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         Words word = Find(wordid);
         db.Entry(word).State = System.Data.Entity.EntityState.Deleted;
         db.SaveChanges();
         return true;
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:10,代码来源:WordsBml.cs

示例3: Update

 public static bool Update(Credits credit)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.Entry(credit).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:17,代码来源:CreditsBml.cs

示例4: Delete

 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;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:17,代码来源:CityBml.cs

示例5: Delete

 public static bool Delete(int rmid)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             RoleModules rm = Find(rmid);
             db.Entry(rm).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:18,代码来源:RoleModulesBml.cs

示例6: Delete

 public static bool Delete(int adminId)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             Administrator admin = db.Administrator.Find(adminId);
             db.Entry(admin).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:18,代码来源:AdministratorBml.cs

示例7: Delete

 public static bool Delete(int id)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             District dist = Find(id);
             db.Entry(dist).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:18,代码来源:DistrictBml.cs

示例8: Delete

 public static bool Delete(int memberId)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             Members member = Find(memberId);
             db.Entry(member).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:18,代码来源:MemberBml.cs

示例9: Insert

 public static bool Insert(Credits credit)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             credit.Status = false;
             db.Credits.Add(credit);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:18,代码来源:CreditsBml.cs

示例10: Delete

 public static bool Delete(int pcid)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             PhotographerCredits pc = Find(pcid);
             db.Entry(pc).State = EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:18,代码来源:PhotographerCreditsBml.cs

示例11: Delete

 public static bool Delete(int pgid)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             PhotographerGenres pg = Find(pgid);
             db.Entry(pg).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:18,代码来源:PhotographerGenresBml.cs

示例12: Insert

 public static bool Insert(Gallery gallery)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             gallery.DeleteStatus = false;
             gallery.CreateTime = DateTime.Now.ToString();
             db.Gallery.Add(gallery);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:19,代码来源:GalleryBml.cs

示例13: Insert

 public static bool Insert(MemberFavorites mf)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             if (IsFavoriteExist((int)mf.MemberId, (int)mf.PhotographerId))
                 return false;
             mf.DeleteStatus = false;
             db.MemberFavorites.Add(mf);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:20,代码来源:MemberFavoritesBml.cs

示例14: Insert

 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;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:20,代码来源:WordsBml.cs

示例15: Insert

 public static bool Insert(RoleModules rm)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.RoleModules.Add(rm);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
开发者ID:fatihmert93,项目名称:FotografPaketi,代码行数:17,代码来源:RoleModulesBml.cs


注:本文中的DataAccessLayer.FotografPaketiEntities.SaveChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。