Esempio n. 1
0
 /// <summary>
 /// 保存/编辑 指标至数据库
 /// </summary>
 private void saveIndicator()
 {
     if (indicator == null)
     {
         indicator = new Tb_indicator();
     }
     setIndicator();
     IndicatorCache.addCache(indicator);
 }
Esempio n. 2
0
 public static void addCache(Tb_indicator indicator)
 {
     try
     {
         var foundIndicator = list.FirstOrDefault(i => i.id == indicator.id);
         if (foundIndicator == null)
         {
             BaseAdapter.save(indicator);
             list.Add(indicator);
         }
         else
         {
             BaseAdapter.edit(indicator);
             //IndicatorAdapter.edit(indicator);
             foundIndicator = indicator;
         }
     }
     catch (Exception ex)
     {
         MessageBoxEx.Show(ex.Message);
     }
 }