示例#1
0
 public void EnterWaiting()
 {
     WaitingLabel.Invoke((MethodInvoker) delegate
     {
         WaitingLabel.Text = "Connected. Waiting for game...";
     });
 }
示例#2
0
 private void button_CarManagement_Click(object sender, EventArgs e)
 {
     WaitingLabel.Show();
     carManagement = new CarManagement();
     this.Hide();
     carManagement.Disposed += Form_Disposed;
     Application.DoEvents();
     WaitingLabel.Hide();
 }
示例#3
0
 private void button_AddActivity_Click(object sender, EventArgs e)
 {
     WaitingLabel.Show();
     activityForm = new ActivityForm();
     this.Hide();
     activityForm.Disposed += Form_Disposed;
     Application.DoEvents();
     WaitingLabel.Hide();
 }
示例#4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (tIndex == -1)
            {
                return;
            }
            WaitingLabel.Show();

            SQLHelper.DeleteData("Activities", "ID", tID);

            WaitingLabel.Hide();
            SQLHelper.ReadActivities(dataGridView1);
            MessageBox.Show("删除成功!");
            tIndex = -1;
        }
示例#5
0
        private void button_OrderManagement_Click(object sender, EventArgs e)
        {
            WaitingLabel.Show();
            switch (tabControl1.SelectedIndex)
            {
            case 0:
                orderForm = new OrderForm(int.Parse(GetID("ID")), int.Parse(GetID("Condition")), "select");
                break;

            case 1:
                orderForm = new OrderForm(int.Parse(GetID("ID_Plane")), int.Parse(GetID("Condition_Plane")), "plane");
                break;
            }
            orderForm.Shown           += OtherForm_Load;
            orderForm.Disposed        += Form_Disposed;
            orderForm.ParentShowEvent += ParentShow;
        }
示例#6
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (tIndex != -1)
     {
         WaitingLabel.Show();
         if ((bool)dataGridView1["Enabled_CarManagement", tIndex].Value)
         {
             SQLHelper.UpdateData("Cars", "Enabled", "0", "ID", dataGridView1["ID_CarManagement", tIndex].Value.ToString());
         }
         else
         {
             SQLHelper.UpdateData("Cars", "Enabled", "1", "ID", dataGridView1["ID_CarManagement", tIndex].Value.ToString());
         }
         SQLHelper.ReadCars(dataGridView1);
         dataGridView1.Refresh();
         MessageBox.Show("更改状态成功!");
         WaitingLabel.Hide();
     }
 }
示例#7
0
        private void RefreshForm()
        {
            timer.Enabled = false;
            WaitingLabel.Show();
            Refresh();
            switch (tabControl1.SelectedIndex)
            {
            case 0:
                SQLHelper.ReadOrders(dataGridView_CarHire);
                break;

            case 1:
                SQLHelper.ReadPlaneOrders(dataGridView_Flight);
                break;
            }
            WaitingLabel.Hide();
            Refresh();
            timer.Enabled = true;
        }
示例#8
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (!CheckFull())
     {
         MessageBox.Show("请确保所有基本信息均已录入!");
         return;
     }
     else
     {
         WaitingLabel.Show();
         SQLHelper.InsertData("Activities",
                              textBox_Name.Text,
                              "/Images/" + textBox_ImgPath.Text,
                              textBox_BasicInfo.Text);
         FTPHelper.AddFile(textBox_ImgPath.Text, File.OpenRead(_imageFile));
         ManageHelper.RefreshServer();
         WaitingLabel.Hide();
         MessageBox.Show("录入成功!");
     }
 }
示例#9
0
 private void button_Detail_Click(object sender, EventArgs e)
 {
     if (tabControl1.SelectedIndex == 0)
     {
         WaitingLabel.Show();
         Refresh();
         detailForm = new DetailInfoForm(
             GetID("User_ID"), GetID("Car_ID"), GetID("ID"), GetID("Comment_ID"));
         detailForm.Shown    += OtherForm_Load;
         detailForm.Disposed += Form_Disposed;
         detailForm.Show();
     }
     else
     {
         MessageBox.Show(
             SQLHelper.ReadAirport(GetID("Airport_ID")) + "\r\n"
             + SQLHelper.ReadFlightOrder(GetID("ID_Plane")) + "\r\n"
             + SQLHelper.ReadUser(GetID("User_ID_Plane")),
             "详细信息");
     }
 }
示例#10
0
 /// <summary>
 /// 分支窗口载入完毕后,主窗口消失
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void OtherForm_Load(object sender, EventArgs e)
 {
     WaitingLabel.Hide();
     this.Hide();
 }
示例#11
0
 private void button_RefreshServer_Click(object sender, EventArgs e)
 {
     WaitingLabel.Show();
     ManageHelper.RefreshServer();
     WaitingLabel.Hide();
 }