Exemplo n.º 1
0
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripMenuItem_DataGridViewRowAdd_Click(object sender, EventArgs e)
        {
            if (this.myEventArgs_KindofEmployerIssue == null || this.myEventArgs_KindofEmployerIssue.int_KindofEmployerIssueID <= 0)
            {
                return;
            }
            Form_KindofEmployerStudent_Update myForm = new Form_KindofEmployerStudent_Update();

            myForm.myClass_KindofEmployerStudent = new Class_KindofEmployerStudent();
            myForm.myClass_KindofEmployerStudent.KindofEmployerIssueID = this.myEventArgs_KindofEmployerIssue.int_KindofEmployerIssueID;
            myForm.bool_Add = true;
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                this.RefreshData(true);
                Class_DataControlBind.SetDataGridViewSelectedPosition("KindofEmployerStudentID", myForm.myClass_KindofEmployerStudent.KindofEmployerStudentID.ToString(), this.dataGridView_Data);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripMenuItem_DataGridViewRowModify_Click(object sender, EventArgs e)
        {
            Form_KindofEmployerStudent_Update myForm = new Form_KindofEmployerStudent_Update();

            myForm.myClass_KindofEmployerStudent = new Class_KindofEmployerStudent();
            myForm.myClass_KindofEmployerStudent.KindofEmployerStudentID = (int)this.dataGridView_Data.CurrentRow.Cells["KindofEmployerStudentID"].Value;
            if (myForm.myClass_KindofEmployerStudent.FillData())
            {
                myForm.bool_Add = false;
                if (myForm.ShowDialog() == DialogResult.OK)
                {
                    this.RefreshData(true);
                }
            }
            else
            {
                MessageBox.Show("该行数据已被删除!");
            }
        }