示例#1
0
 /// <summary>
 /// 生成(燃料)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void barBtnGenerate_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (!this.CheckAllDataReady(Utils.FUEL))
     {
         return;
     }
     try
     {
         //DONE-lyc L43-47
         DataSet     dsCtny      = this.GetReadyDataFromLocalCoc(Utils.CTNY);
         DataSet     dsFcds      = this.GetReadyDataFromLocalCoc(Utils.FCDS);
         JaguarUtils jaguarUtils = new JaguarUtils();
         string      msg         = jaguarUtils.SaveParam(dsCtny, Utils.CTNY);
         msg += jaguarUtils.SaveParam(dsFcds, Utils.FCDS);
         if (string.IsNullOrEmpty(msg))
         {
             MessageBox.Show("生成成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageForm mf = new MessageForm("以下数据已经存在\r\n" + msg);
             Utils.SetFormMid(mf);
             mf.Text = "生成结果";
             mf.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("燃料消耗量数据生成失败:" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#2
0
        private void btnGenFuelData_Click(object sender, EventArgs e)
        {
            try
            {
                JaguarUtils jaguarUtils = new JaguarUtils();
                string      msg         = string.Empty;

                if (this.dataType == Utils.FUEL)
                {
                    msg += jaguarUtils.SaveParam(dsGenCtny, Utils.CTNY);
                    msg += jaguarUtils.SaveParam(dsGenFcds, Utils.FCDS);
                }
                else if (this.dataType == Utils.GH)
                {
                    msg += jaguarUtils.SaveGHParam(dsGenCtny);
                    msg += jaguarUtils.SaveGHParam(dsGenFcds);
                }

                if (string.IsNullOrEmpty(msg))
                {
                    this.DialogResult = DialogResult.OK;
                    MessageBox.Show("生成成功", "生成成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageForm mf = new MessageForm("以下数据已经存在\r\n" + msg);
                    Utils.SetFormMid(mf);
                    mf.Text = "生成结果";
                    mf.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("生成失败:" + ex.Message, "生成失败");
            }
        }