Пример #1
0
 public List<Commod> GetAll()
 {
     using (RxjhEntities en = new RxjhEntities())
     {
         return en.Commod.OrderBy(i => i.Price).ToList();
     }
 }
Пример #2
0
 public List<CommodConfig> GetAll()
 {
     using (RxjhEntities en = new RxjhEntities())
     {
         return en.CommodConfig.ToList();
     }
 }
Пример #3
0
 public void Add(CommodConfig config) {
     using (RxjhEntities en = new RxjhEntities()) {
         config.ID = Guid.NewGuid();
         en.CommodConfig.Add(config);
         en.SaveChanges();
     }
 }
Пример #4
0
 public DataAccesss.SystemConfig Get()
 {
     using (RxjhEntities en = new RxjhEntities())
     {
         return en.SystemConfig.FirstOrDefault();
     }
 }
Пример #5
0
 public SystemConfig GetAll()
 {
    
     using (RxjhEntities en = new RxjhEntities())
     {
         return en.SystemConfig.FirstOrDefault();
     }
 }
Пример #6
0
 /// <summary>
 /// 添加一个最低价格装备
 /// 如果存在同一天的就修改价格
 /// </summary>
 /// <param name="commod">要添加的装备</param>
 public void Add(Commod commod) {
     using (RxjhEntities en = new RxjhEntities()) {
         //先找到当天是否已经存在该装备
         var thisDateCommod = en.Commod.Where(i => i.Name == commod.Name).FirstOrDefault();
         //存在就更新
         if (thisDateCommod != null)
         {
             en.Commod.Remove(thisDateCommod);
             commod.ID = Guid.NewGuid();
             en.Commod.Add(commod);
             en.SaveChanges();
         }
         else {
             commod.ID = Guid.NewGuid();
             en.Commod.Add(commod);
             en.SaveChanges();
         }
     }
 }