本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}