예제 #1
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();
 }
예제 #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 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;
        }
예제 #4
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;
        }
예제 #5
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();
     }
 }
예제 #6
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;
        }
예제 #7
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("录入成功!");
     }
 }
예제 #8
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")),
             "详细信息");
     }
 }
예제 #9
0
 private void button_RefreshServer_Click(object sender, EventArgs e)
 {
     WaitingLabel.Show();
     ManageHelper.RefreshServer();
     WaitingLabel.Hide();
 }