Exemplo n.º 1
0
        private void Button_WelderModify_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.MaskedTextBox_IdentificationCard.Text))
            {
                MessageBox.Show("没有焊工信息修改!");
                return;
            }
            Form_KindofEmployerWelder_Update myForm = new Form_KindofEmployerWelder_Update();

            myForm.bool_Add = false;
            myForm.myClass_KindofEmployerWelder = new Class_KindofEmployerWelder(int.Parse(this.TextBox_KindofEmployerWelderID.Text));
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                this.myClass_KindofEmployerStudent.KindofEmployerWelderID = myForm.myClass_KindofEmployerWelder.KindofEmployerWelderID;
                this.InitControlWelder(myForm.myClass_KindofEmployerWelder);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripMenuItem_DataGridViewRowAdd_Click(object sender, EventArgs e)
        {
            if (this.myEventArgs_KindofEmployer == null)
            {
                return;
            }
            Form_KindofEmployerWelder_Update myForm = new Form_KindofEmployerWelder_Update();

            myForm.myClass_KindofEmployerWelder = new Class_KindofEmployerWelder();
            myForm.myClass_KindofEmployerWelder.KindofEmployer = this.myEventArgs_KindofEmployer.str_KindofEmployer;
            myForm.bool_Add = true;
            if (myForm.ShowDialog() == DialogResult.OK)
            {
                this.RefreshData(false);
                Class_DataControlBind.SetDataGridViewSelectedPosition("KindofEmployerWelderID", myForm.myClass_KindofEmployerWelder.KindofEmployerWelderID.ToString(), this.dataGridView_Data);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripMenuItem_DataGridViewRowModify_Click(object sender, EventArgs e)
        {
            Form_KindofEmployerWelder_Update myForm = new Form_KindofEmployerWelder_Update();

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