本文整理汇总了C#中DataAccessLayer.FotografPaketiEntities.Entry方法的典型用法代码示例。如果您正苦于以下问题:C# FotografPaketiEntities.Entry方法的具体用法?C# FotografPaketiEntities.Entry怎么用?C# FotografPaketiEntities.Entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccessLayer.FotografPaketiEntities
的用法示例。
在下文中一共展示了FotografPaketiEntities.Entry方法的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 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;
}
}
}
示例6: 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;
}
}
}
示例7: 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;
}
}
}
示例8: 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;
}
}
}
示例9: 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;
}
}
}
示例10: 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;
}
}
}
示例11: Login
public static bool Login(string email, string password,bool rememberme)
{
using (FotografPaketiEntities db = new FotografPaketiEntities())
{
bool loginResult = LoginControl(email, password);
if (loginResult)
{
Members member = db.Members.Where(v => v.Email == email).FirstOrDefault();
string sessionId = member.MemberId.ToString() + DateTime.Now.Minute + DateTime.Now.Second + DateTime.Now.Millisecond;
member.SessionId = sessionId;
db.Entry(member).State = System.Data.Entity.EntityState.Modified;
int updateResult = db.SaveChanges();
if (updateResult > 0)
{
HttpContext.Current.Session.Add("memberSession", sessionId);
if (rememberme)
{
CookieUtil.CreateCookie("memberCookie", sessionId, 30);
}
return true;
}
else
return false;
}
else
return false;
}
}
示例12: Update
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;
}
}
}
示例13: Insert
public static bool Insert(Photo photo)
{
using (FotografPaketiEntities db = new FotografPaketiEntities())
{
try
{
photo.GalleryId = -1;
photo.CreateTime = DateTime.Now;
photo.LikeCount = 0;
photo.Hit = 0;
photo.Status = false;
db.Entry(photo).State = System.Data.Entity.EntityState.Added;
db.SaveChanges();
return true;
}
catch (Exception ex)
{
return false;
throw;
}
}
}
示例14: SoftDelete
public static bool SoftDelete(int cid)
{
using (FotografPaketiEntities db = new FotografPaketiEntities())
{
Country c = Find(cid);
c.Status = true;
db.Entry(c).State = System.Data.Entity.EntityState.Modified;
db.SaveChanges();
return true;
}
}
示例15: InsertOrUpdatePayment
public static bool InsertOrUpdatePayment(Payments payment)
{
using (FotografPaketiEntities db = new FotografPaketiEntities())
{
try
{
if (db.Payments.Any(v => v.PaymentId == payment.PaymentId))
{
db.Entry(payment).State = System.Data.Entity.EntityState.Modified;
db.SaveChanges();
return true;
}
else
{
payment.CreateTime = DateTime.Now;
db.Payments.Add(payment);
db.SaveChanges();
return true;
}
}
catch (Exception ex)
{
return false;
throw;
}
}
}