/// <summary>
 /// 方法:加载产量配置
 /// </summary>
 /// <returns></returns>
 public static ConfigProduction Load()
 {
     try
     {
         ConfigProduction rt = (ConfigProduction)CommonRs.Serialization.LoadFromFile(typeof(ConfigProduction), _configName);
         if (rt == null)
         {
             rt = new ConfigProduction();
         }
         return(rt);
     }
     catch (Exception ex)
     {
         //CommonRs.LogWriter.WriteException(ex);
         //CommonRs.LogWriter.WriteLog(string.Format("错误:加载配置文件[{0}]失败!\n异常描述:{1}\n时间:{2}", _name, ex.Message, System.DateTime.Now.ToString("yyyyMMddhhmmss")));
         //throw new CommonRs.LoadException(_name, ex.Message);
         return(null);
     }
 }
Пример #2
0
 public YieldInformation()
 {
     this.Production = ConfigProduction.Load();
     productions     = Production.Production;
     if (productions.Count == 0)
     {
         for (int i = 0; i < 12; i++)
         {
             productions.Add(new ConfigProduction.Productions());
         }
     }
     if (productions[month - 1].Year != year)
     {
         for (int i = 0; i < productions[month - 1].GoodProduct.Count; i++)
         {
             productions[month - 1].GoodProduct[i] = 0;
         }
         for (int i = 0; i < productions[month - 1].BadProduct.Count; i++)
         {
             productions[month - 1].BadProduct[i] = 0;
         }
         productions[month - 1].Year = year;
     }
     for (int i = 0; i < productions.Count; i++)
     {
         if (productions[i].Year == 0)
         {
             productions[i].Year = year;
         }
     }
     GoodProduct = productions[month - 1].GoodProduct;
     BadProduct  = productions[month - 1].BadProduct;
     InitializeComponent();
     shouChart();
     AddCombox1();
     comboBox1.SelectedIndex = month - 1;
 }