Example #1
0
 public DataLayer.Model.UserSetting GetFirstModel()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return((from tb in context.UserSetting select tb).FirstOrDefault());
     }
 }
 public DataLayer.Model.FileReplace_RuleConfig GetModel(int ruleConfigId)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return (from tb in context.FileReplace_RuleConfig where tb.RuleConfigID == ruleConfigId select tb).FirstOrDefault();
     }
 }
 public List<DataLayer.Model.FileReplace_RuleConfig> GetAllList()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return (from tb in context.FileReplace_RuleConfig orderby tb.CreateTime descending select tb).ToList();
     }
 }
Example #4
0
 public DataLayer.Model.UserSetting GetFirstModel()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return (from tb in context.UserSetting select tb).FirstOrDefault();
     }
 }
Example #5
0
 public List<DataLayer.Model.FileReplace_File> GetAllList()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return (from tb in context.FileReplace_File select tb).ToList();
     }
 }
Example #6
0
 public DataLayer.Model.FileReplace_RuleConfig GetModel(int ruleConfigId)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return((from tb in context.FileReplace_RuleConfig where tb.RuleConfigID == ruleConfigId select tb).FirstOrDefault());
     }
 }
Example #7
0
 public List <DataLayer.Model.FileReplace_RuleConfig> GetAllList()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return((from tb in context.FileReplace_RuleConfig orderby tb.CreateTime descending select tb).ToList());
     }
 }
 public List <DataLayer.Model.v_FileReplace_RuleConfig> GetAllList()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         return((from tb in context.v_FileReplace_RuleConfig select tb).ToList());
     }
 }
Example #9
0
 public void Add(List <DataLayer.Model.FileReplace_RuleConfig> lst)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.FileReplace_RuleConfig.AddRange(lst);
         context.SaveChanges();
     }
 }
 public void Add(DataLayer.Model.FileReplace_RuleConfig model)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.FileReplace_RuleConfig.Add(model);
         context.SaveChanges();
     }
 }
Example #11
0
 public void Add(DataLayer.Model.FileReplace_RuleConfig model)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.FileReplace_RuleConfig.Add(model);
         context.SaveChanges();
     }
 }
Example #12
0
 public void Add(DataLayer.Model.UserSetting model)
 {
     this.Clear();
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.UserSetting.Add(model);
         context.SaveChanges();
     }
 }
Example #13
0
 public void Add(DataLayer.Model.UserSetting model)
 {
     this.Clear();
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.UserSetting.Add(model);
         context.SaveChanges();
     }
 }
Example #14
0
 public void Update(DataLayer.Model.FileReplace_File model)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         model.UpdateTime = DateTime.Now;
         context.FileReplace_File.Attach(model);
         context.Entry(model).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #15
0
 public void Update(DataLayer.Model.FileReplace_File model)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         model.UpdateTime = DateTime.Now;
         context.FileReplace_File.Attach(model);
         context.Entry(model).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #16
0
 public void Clear()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         foreach (var m in context.UserSetting)
         {
             context.UserSetting.Remove(m);
         }
         context.SaveChanges();
     }
 }
Example #17
0
 public void Clear()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         foreach (var m in context.FileReplace_File)
         {
             context.FileReplace_File.Remove(m);
         }
         context.SaveChanges();
     }
 }
Example #18
0
 public void Clear()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         foreach (var m in context.UserSetting)
         {
             context.UserSetting.Remove(m);
         }
         context.SaveChanges();
     }
 }
Example #19
0
 public void Clear()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         foreach (var m in context.FileReplace_File)
         {
             context.FileReplace_File.Remove(m);
         }
         context.SaveChanges();
     }
 }
Example #20
0
 public void Add(List<DataLayer.Model.FileReplace_File> lst)
 {
     this.Clear();
     if (null != lst && lst.Count > 0)
     {
         using (var context = new DataLayer.DAL.MyDBContext())
         {
             context.FileReplace_File.AddRange(lst);
             context.SaveChanges();
         }
     }
 }
Example #21
0
 public void Add(List <DataLayer.Model.FileReplace_File> lst)
 {
     this.Clear();
     if (null != lst && lst.Count > 0)
     {
         using (var context = new DataLayer.DAL.MyDBContext())
         {
             context.FileReplace_File.AddRange(lst);
             context.SaveChanges();
         }
     }
 }
 public void Delete(int ruleId)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         var info = context.FileReplace_RuleConfig.FirstOrDefault(k => k.RuleConfigID == ruleId);
         if (null == info)
         {
             return;
         }
         context.FileReplace_RuleConfig.Attach(info);
         context.FileReplace_RuleConfig.Remove(info);
         context.SaveChanges();
     }
 }
Example #23
0
 public void Delete(int ruleId)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         var info = context.FileReplace_RuleConfig.FirstOrDefault(k => k.RuleConfigID == ruleId);
         if (null == info)
         {
             return;
         }
         context.FileReplace_RuleConfig.Attach(info);
         context.FileReplace_RuleConfig.Remove(info);
         context.SaveChanges();
     }
 }
Example #24
0
 public void Update(DataLayer.Model.FileReplace_RuleConfig model)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         var info = context.FileReplace_RuleConfig.FirstOrDefault(k => k.RuleConfigID == model.RuleConfigID);
         if (null == info)
         {
             return;
         }
         info.IsFileContent = model.IsFileContent;
         info.IsFileName    = model.IsFileName;
         info.IsIgnoreCase  = model.IsIgnoreCase;
         info.IsRegex       = model.IsRegex;
         info.IsWholeMatch  = model.IsWholeMatch;
         info.Name          = model.Name;
         info.NewContent    = model.NewContent;
         info.OldContent    = model.OldContent;
         info.UpdateTime    = DateTime.Now;
         context.FileReplace_RuleConfig.Attach(info);
         context.Entry(info).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
 public void Update(DataLayer.Model.FileReplace_RuleConfig model)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         var info = context.FileReplace_RuleConfig.FirstOrDefault(k => k.RuleConfigID == model.RuleConfigID);
         if (null == info)
         {
             return;
         }
         info.IsFileContent = model.IsFileContent;
         info.IsFileName = model.IsFileName;
         info.IsIgnoreCase = model.IsIgnoreCase;
         info.IsRegex = model.IsRegex;
         info.IsWholeMatch = model.IsWholeMatch;
         info.Name = model.Name;
         info.NewContent = model.NewContent;
         info.OldContent = model.OldContent;
         info.UpdateTime = DateTime.Now;
         context.FileReplace_RuleConfig.Attach(info);
         context.Entry(info).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }