Example #1
0
        private void btnAlter_Click(object sender, EventArgs e)
        {
            string       Confirm = "修改课程需要重新生成课表,确认继续修改?";
            DialogResult dr      = MessageBox.Show(Confirm, "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

            if (dr == DialogResult.OK)
            {
                truncateTable();
                if (grdView.DataSource == null)
                {
                    MessageBox.Show("请选中要修改的行!");
                    query();
                }
                else
                {
                    string[] arr = new string[2];
                    for (int i = 0; i < 2; i++)
                    {
                        arr[i] = grdView[i, grdView.SelectedCells[i].RowIndex].Value.ToString();
                    }
                    SubCourse alter = new SubCourse();
                    alter.getState(2);
                    alter.getarr(arr);
                    alter.ShowDialog();
                }
            }
            query();
        }
Example #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string       Confirm = "添加课程需要重新生成课表,确认继续添加?";
            DialogResult dr      = MessageBox.Show(Confirm, "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

            if (dr == DialogResult.OK)
            {
                truncateTable();
                SubCourse addform = new SubCourse();
                addform.getState(1);
                addform.ShowDialog();
            }
            query();
        }
Example #3
0
        private void grdView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string       Confirm = "修改课程需要重新生成课表,确认继续修改?";
            DialogResult dr      = MessageBox.Show(Confirm, "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

            if (dr == DialogResult.OK)
            {
                truncateTable();
                string[] arr = new string[2];
                for (int i = 0; i < 2; i++)
                {
                    arr[i] = grdView[i, grdView.SelectedCells[i].RowIndex].Value.ToString();
                }
                SubCourse alter = new SubCourse();
                alter.getState(2);
                alter.getarr(arr);
                alter.ShowDialog();
            }
            query();
        }