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


C# FotografPaketiEntities.Entry方法代码示例

本文整理汇总了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;
     }
 }
开发者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 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

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

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

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

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

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

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

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

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

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

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


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