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


C# Context.DeneysanContext类代码示例

本文整理汇总了C#中deneysan_DAL.Context.DeneysanContext的典型用法代码示例。如果您正苦于以下问题:C# DeneysanContext类的具体用法?C# DeneysanContext怎么用?C# DeneysanContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: EditUser

 public static bool EditUser(User model)
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         try
         {
             User record = db.User.Where(d => d.UserId == model.UserId).SingleOrDefault();
             if (record != null)
             {
                 record.FullName = model.FullName;
                 record.Email = model.Email;
                 if(model.Password != "") record.Password = model.Password;
                 record.Institution = model.Institution;
                 record.Contact = model.Contact;
                 db.SaveChanges();
                 return true;
             }
             else return false;
         }
         catch (Exception)
         {
             return false;
         }
     }
 }
开发者ID:cemelma,项目名称:argem,代码行数:25,代码来源:UserManager.cs

示例2: DeleteGroup

        public static bool DeleteGroup(int id)
        {
            using (DeneysanContext db = new DeneysanContext())
            {
                try
                {
                    var record = db.ProjectGroup.FirstOrDefault(d => d.ProjectGroupId == id);
                    db.ProjectGroup.Remove(record);

                    db.SaveChanges();

                    //LogtrackManager logkeeper = new LogtrackManager();
                    //logkeeper.LogDate = DateTime.Now;
                    //logkeeper.LogProcess = EnumLogType.DokumanGrup.ToString();
                    //logkeeper.Message = LogMessages.ProjectGroupDeleted;
                    //logkeeper.User = HttpContext.Current.User.Identity.Name;
                    //logkeeper.Data = record.GroupName;
                    //logkeeper.AddInfoLog(logger);

                    return true;
                }
                catch (Exception)
                {
                    return false;
                }
            }
        }
开发者ID:cemelma,项目名称:argem,代码行数:27,代码来源:ProductManager.cs

示例3: EditInstituional

        public static bool EditInstituional(Institutional record)
        {
            using (DeneysanContext db = new DeneysanContext())
            {
                try
                {
                    Institutional editrecord = db.Institutional.SingleOrDefault(d => d.TypeId == record.TypeId && d.Language == record.Language);

                    if (editrecord == null)
                    {
                        editrecord = new Institutional();
                        editrecord.TimeUpdated = DateTime.Now;
                        editrecord.TypeId = record.TypeId;
                        editrecord.Language = record.Language;
                        editrecord.Content = record.Content;
                        db.Institutional.Add(editrecord);
                    }
                    else
                    {
                        editrecord.TimeUpdated = DateTime.Now;
                        editrecord.Content = record.Content;
                    }

                    db.SaveChanges();

                    return true;
                }
                catch (Exception)
                {
                    return false;
                }
                
            }
        }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:34,代码来源:InstituionalManager.cs

示例4: GetAdminFirst

 public static AdminUser GetAdminFirst()
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         return db.AdminUser.FirstOrDefault();
     }
 }
开发者ID:cemelma,项目名称:argem,代码行数:7,代码来源:AccountManager.cs

示例5: EditNews

        public static dynamic EditNews(News newsmodel)
        {
            using (DeneysanContext db = new DeneysanContext())
            {
                try
                {
                    News record = db.News.Where(d => d.NewsId == newsmodel.NewsId && d.Deleted == false).SingleOrDefault();
                    if (record != null)
                    {
                        record.Header = newsmodel.Header;
                        record.Language = newsmodel.Language;
                        record.Content = newsmodel.Content;
                        if (!string.IsNullOrEmpty(newsmodel.NewsImage))
                        {
                            record.NewsImage = newsmodel.NewsImage;
                        }
                        record.PageSlug = newsmodel.PageSlug;
                        record.TimeUpdated = DateTime.Now;
                        record.Spot = newsmodel.Spot;

                        db.SaveChanges();
                        return true;
                    }
                    else
                        return false;

                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }
开发者ID:cemelma,项目名称:argem,代码行数:33,代码来源:NewsManager.cs

示例6: AddReference

        public static bool AddReference(References record)
        {
            using (DeneysanContext db = new DeneysanContext())
            {
                try
                {
                    if (!record.TimeCreated.HasValue)
                        record.TimeCreated = DateTime.Now;
                    record.Deleted = false;
                    record.Online = true;
                    db.References.Add(record);
                    db.SaveChanges();

                    LogtrackManager logkeeper = new LogtrackManager();
                    logkeeper.LogDate = DateTime.Now;
                    logkeeper.LogProcess = EnumLogType.Referans.ToString();
                    logkeeper.Message = LogMessages.ReferenceAdded;
                    logkeeper.User = HttpContext.Current.User.Identity.Name;
                    logkeeper.Data = record.ReferenceName;
                    logkeeper.AddInfoLog(logger);


                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }
            }

        }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:31,代码来源:ReferenceManager.cs

示例7: Delete

        public static bool Delete(int id)
        {
            using (DeneysanContext db = new DeneysanContext())
            {
                try
                {
                    var record = db.News.FirstOrDefault(d => d.NewsId == id);
                    record.Deleted = true;

                    db.SaveChanges();

                    LogtrackManager logkeeper = new LogtrackManager();
                    logkeeper.LogDate = DateTime.Now;
                    logkeeper.LogProcess = EnumLogType.Haber.ToString();
                    logkeeper.Message = LogMessages.NewsDeleted;
                    logkeeper.User = HttpContext.Current.User.Identity.Name;
                    logkeeper.Data = record.Header;
                    logkeeper.AddInfoLog(logger);

                    return true;
                }
                catch (Exception)
                {
                    return false;
                }
            }
        }
开发者ID:cemelma,项目名称:argem,代码行数:27,代码来源:NewsManager.cs

示例8: AddProduct

        public static bool AddProduct(Product record)
        {
            using (DeneysanContext db = new DeneysanContext())
            {
                try
                {

                    record.TimeCreated = DateTime.Now;
                    record.Deleted = false;

                    record.Online = true;
                    record.SortNumber = 9999;
                    db.Product.Add(record);
                    db.SaveChanges();

                    //LogtrackManager logkeeper = new LogtrackManager();
                    //logkeeper.LogDate = DateTime.Now;
                    //logkeeper.LogProcess = EnumLogType.Dokuman.ToString();
                    //logkeeper.Message = LogMessages.ProductAdded;
                    //logkeeper.User = HttpContext.Current.User.Identity.Name;
                    //logkeeper.Data = record.Name;
                    //logkeeper.AddInfoLog(logger);

                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }
开发者ID:cemelma,项目名称:argem,代码行数:31,代码来源:ProductManager.cs

示例9: AddBankInfo

        public static bool AddBankInfo(BankInfo record)
        {
            using (DeneysanContext db = new DeneysanContext())
            {
                try
                {
                    
                    record.Online = true;
                    db.BankInfo.Add(record);
                    db.SaveChanges();

                    LogtrackManager logkeeper = new LogtrackManager();
                    logkeeper.LogDate = DateTime.Now;
                    logkeeper.LogProcess = EnumLogType.BankaBilgisi.ToString();
                    logkeeper.Message = LogMessages.BankAdded;
                    logkeeper.User = HttpContext.Current.User.Identity.Name;
                    logkeeper.Data = record.BankName;
                    logkeeper.AddInfoLog(logger);


                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }
            }

        }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:29,代码来源:BankManager.cs

示例10: GetProjectListForFront

 public static List<Projects> GetProjectListForFront(string language)
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         var list = db.Projects.Where(d => d.Language == language && d.Online==true).OrderBy(d => d.SortOrder).ToList();
         return list;
     }
 }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:8,代码来源:ProjectManager.cs

示例11: GetMailUsersList

 public static List<MailUsers> GetMailUsersList(int type)
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         var list = db.MailUsers.Where(d => d.MailType == type).ToList();
         return list;
     }
 }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:8,代码来源:MailManager.cs

示例12: GetBankInfoListForFront

 public static List<BankInfo> GetBankInfoListForFront(string language)
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         var list = db.BankInfo.Where(d => d.Language == language && d.Online==true).ToList();
         return list;
     }
 }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:8,代码来源:BankManager.cs

示例13: GetHRByLanguage

 public static HumanResource GetHRByLanguage(string language)
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         HumanResource instional_info = db.HumanResource.SingleOrDefault(d => d.Language == language);
         return instional_info;
     }
 }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:8,代码来源:InstituionalManager.cs

示例14: GetDocumentGroupList

 public static List<DocumentGroup> GetDocumentGroupList(string language)
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         var list = db.DocumentGroup.Where(d => d.Deleted == false && d.Language == language).OrderBy(d=>d.SortNumber).ToList();
         return list;
     }
 }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:8,代码来源:DocumentManager.cs

示例15: GetProductGroupListForFront

 public static List<ProductGroup> GetProductGroupListForFront(string language)
 {
     using (DeneysanContext db = new DeneysanContext())
     {
         var list = db.ProductGroup.Where(d => d.Deleted == false && d.Language == language && d.Online==true).OrderBy(d => d.SortNumber).ToList();
         return list;
     }
 }
开发者ID:miyamotomusashi,项目名称:argemsan,代码行数:8,代码来源:ProductManager.cs


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