Example #1
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 #3
0
 public void Add(DataLayer.Model.FileReplace_RuleConfig model)
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.FileReplace_RuleConfig.Add(model);
         context.SaveChanges();
     }
 }
Example #4
0
 public void Add(DataLayer.Model.UserSetting model)
 {
     this.Clear();
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.UserSetting.Add(model);
         context.SaveChanges();
     }
 }
Example #5
0
 public void Add(DataLayer.Model.UserSetting model)
 {
     this.Clear();
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         context.UserSetting.Add(model);
         context.SaveChanges();
     }
 }
Example #6
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 #7
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 #8
0
 public void Clear()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         foreach (var m in context.UserSetting)
         {
             context.UserSetting.Remove(m);
         }
         context.SaveChanges();
     }
 }
Example #9
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 #10
0
 public void Clear()
 {
     using (var context = new DataLayer.DAL.MyDBContext())
     {
         foreach (var m in context.UserSetting)
         {
             context.UserSetting.Remove(m);
         }
         context.SaveChanges();
     }
 }
Example #11
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 #12
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 #13
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 #15
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();
     }
 }
 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();
     }
 }
Example #17
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();
     }
 }