Пример #1
0
        /// <summary>
        /// 生成(国环)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtnGenGH_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (!this.CheckAllDataReady(Utils.GH))
            {
                return;
            }
            try
            {
                DataSet dsCtny = this.GetReadyGHDataFromLocalCoc(Utils.CTNY);
                DataSet dsFcds = this.GetReadyGHDataFromLocalCoc(Utils.FCDS);

                JaguarUtils jaguarUtils = new JaguarUtils();
                string      msg         = jaguarUtils.SaveGHParam(dsCtny);
                msg += jaguarUtils.SaveGHParam(dsFcds);
                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, "生成失败");
            }
        }