private void BtnTicQuery_Click(object sender, EventArgs e) { if (CmoBoxFromSta.SelectedItem == null || CmoBoxFromSta.SelectedItem.ToString() == string.Empty) { MessageBoxEx.Show("出发站不能为空!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (CmoBoxToSta.SelectedItem == null || CmoBoxToSta.SelectedItem.ToString() == string.Empty) { MessageBoxEx.Show("到达站不能为空!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DateTime SelectDate = DateTime.ParseExact(DateTimeTic.Text, "yyyy-M-d", System.Globalization.CultureInfo.InstalledUICulture); if ((DateTime.Compare(SelectDate, DateTime.Now) < 0) && (SelectDate.ToString("d") != DateTime.Now.ToString("d"))) { MessageBoxEx.Show("出发日期不能小于当前系统日期!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } LoadingTicket.Show(); string SelectRadText = RadBtnAdult.Checked == true ? RadBtnAdult.Text : RadBtnStuTic.Text; if (ticket.Exists(CmoBoxFromSta.Text, CmoBoxToSta.Text, SelectDate, SelectRadText) == false)//尚未查询过 { ticket.Update(CmoBoxFromSta.Text, CmoBoxToSta.Text, SelectDate, SelectRadText); } DataGridViewTicket.DataSource = ticket.GetList(CmoBoxFromSta.Text, CmoBoxToSta.Text, SelectDate, SelectRadText).Tables["Ticket"].DefaultView; LabelQueTime2.Text = ticket.QueryDate(CmoBoxFromSta.Text, CmoBoxToSta.Text, SelectDate, SelectRadText); LoadingTicket.Hide(); MessageBoxEx.Show("查询完成!", "成功", MessageBoxButtons.OK, MessageBoxIcon.None); }
private void MainForm_Load(object sender, EventArgs e) { this.BackColor = Color.FromArgb(63, 176, 215); LoadingIndex.Show(); TimerLoad.Enabled = true; TimerLoad.Interval = 4000; TimerClock.Enabled = true; TimerClock.Interval = 1000; LblVersion.Text = LblVersion.Text + Assembly.GetExecutingAssembly().GetName().Version.ToString(); CmoBoxPrior.SelectedIndex = 1; FindPwd.Left = (this.Width - FindPwd.Width) / 2;//还原位置 FindPwd.Visible = false; Tool.StationNameXml(); LblShowEmail.Text = "邮箱:" + u.Email; LblShowTel.Text = "电话:" + u.Tel; LblUserNameShow.Text = "用户名:" + u.UserName; LblShowDep.Text = "所在单位:" + u.School; LoadingEmail.Hide(); LoadingNews.Hide(); LoadingTicket.Hide(); }