コード例 #1
0
ファイル: PbMain.cs プロジェクト: toyslife/PiaoBaoWork3.0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         UpdateClassPriceProc.StopServer();
         StopServer();
         Environment.Exit(0);
     }
     catch (Exception)
     {
     }
 }
コード例 #2
0
ファイル: PbMain.cs プロジェクト: toyslife/PiaoBaoWork3.0
 //停止更新票价处理
 private void button2_Click(object sender, EventArgs e)
 {
     //停止服务
     try
     {
         UpdateClassPriceProc.StopServer();
     }
     catch (Exception ex)
     {
         //记录错误日志
         Log.Record("UpdateClassPriceError.log", ex, "停止服务按钮");
     }
     button1.Enabled = true;
     button2.Enabled = false;
 }
コード例 #3
0
ファイル: PbMain.cs プロジェクト: toyslife/PiaoBaoWork3.0
        //开始更新票价处理
        private void button1_Click(object sender, EventArgs e)
        {
            if (DebugFlag)
            {
                if (!chkFromCity.Checked || !chkToCity.Checked)
                {
                    MessageBox.Show("请输入出发城市或到达城市三字码!");
                    return;
                }
            }

            button1.Enabled = false;
            button2.Enabled = true;
            try
            {
                #region 赋值相关参数设置信息
                UpdateClassPriceProc.tmpFrm = this;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.serverip       = txtServerIp.Text;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.serverport     = int.Parse(txtPort.Text);
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.officenum      = txtOfficeNum.Text;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.autoupdateflag = chkAutoUpdate.Checked;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.autoupdatedays = int.Parse(numPerDays.Value.ToString());
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.fromcityflag   = chkFromCity.Checked;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.fromcity       = txtFromCity.Text;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.tocityflag     = chkToCity.Checked;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.tocity         = txtToCity.Text;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.timeflag       = chkBeginEndTime.Checked;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.beginendtime   = dtpBeginTime.Text + "|" + dtpEndTime.Text;

                UpdateClassPriceProc.m_UpdatePriceWorkInfo.EndFlag           = false;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.EndTime           = DateTime.Now;
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.startfromtocityid = "";
                UpdateClassPriceProc.m_UpdatePriceWorkInfo.PreEndTime        = DateTime.Now.ToString("yyyy-MM-dd HH:mm:SS");
                #endregion 赋值相关参数设置信息

                UpdateClassPriceProc.StartServer();
            }
            catch (Exception ex)
            {
                //记录错误日志
                Log.Record("UpdateClassPriceError.log", ex, "开始服务按钮");
            }
        }