private void toolStripMenuItem_DataGridViewRowDelete_Click(object sender, EventArgs e) { if (Class_WPSWeldingLayer.ExistAndCanDeleteAndDelete((int)this.dataGridView_WPSWeldingLayer.CurrentRow.Cells["WPSLayerID"].Value, Enum_zwjKindofUpdate.CanDelete)) { if (MessageBox.Show("确认删除吗?", "确认窗口", MessageBoxButtons.OKCancel) == DialogResult.OK) { Class_WPSWeldingLayer.ExistAndCanDeleteAndDelete((int)this.dataGridView_WPSWeldingLayer.CurrentRow.Cells["WPSLayerID"].Value, Enum_zwjKindofUpdate.Delete); this.RefreshData(false); } } }
private void toolStripMenuItem_DataGridViewRowAdd_Click(object sender, EventArgs e) { Form_WPSLayerUpdate myForm = new Form_WPSLayerUpdate(); myForm.myClass_WPSWeldingLayer = new Class_WPSWeldingLayer(); myForm.myClass_WPSWeldingLayer.WPSID = this.myEventArgs_WPS.str_WPSID; myForm.myClass_WPSWeldingLayer.WPSLayerNo = Class_WPSWeldingLayer.GetWPSLayerCount(myForm.myClass_WPSWeldingLayer.WPSID); myForm.bool_Add = true; if (myForm.ShowDialog() == DialogResult.OK) { this.RefreshData(true); } }
/// <summary> /// 更新数据到对象中 /// </summary> public void FillClass() { myClass_WPSWeldingLayer.WPSLayerRemark = this.textBox_pWPSLayerRemark.Text; myClass_WPSWeldingLayer.WPSLayerPass = (int)this.numericUpDown_pWPSLayerPass.Value; myClass_WPSWeldingLayer.WPSSideNo = (int)this.numericUpDown_pWPSSideNo.Value; if (myClass_WPSWeldingLayerDefault == null) { myClass_WPSWeldingLayerDefault = new Class_WPSWeldingLayer(); } myClass_WPSWeldingLayerDefault.WPSLayerPass = (int)this.numericUpDown_pWPSLayerPass.Value; myClass_WPSWeldingLayerDefault.WPSSideNo = (int)this.numericUpDown_pWPSSideNo.Value; myClass_WPSWeldingLayerDefault.WPSLayerID = myClass_WPSWeldingLayer.WPSLayerID; }
/// <summary> /// 初始化数据 /// </summary> /// <param name="myClass_WPSWeldingLayer"></param> /// <param name="bool_Add"></param> public void InitControl(Class_WPSWeldingLayer myClass_WPSWeldingLayer, bool bool_Add) { this.myClass_WPSWeldingLayer = myClass_WPSWeldingLayer; this.textBox_pWPSID.Text = myClass_WPSWeldingLayer.WPSID; this.textBox_pWPSLayerNo.Text = myClass_WPSWeldingLayer.WPSLayerNo.ToString(); if (bool_Add) { if (myClass_WPSWeldingLayerDefault != null && myClass_WPSWeldingLayerDefault.WPSLayerID == this.myClass_WPSWeldingLayer.WPSLayerID) { this.numericUpDown_pWPSLayerPass.Value = myClass_WPSWeldingLayerDefault.WPSLayerPass; this.numericUpDown_pWPSSideNo.Value = myClass_WPSWeldingLayerDefault.WPSSideNo; } } else { this.numericUpDown_pWPSSideNo.Value = myClass_WPSWeldingLayer.WPSSideNo; this.textBox_pWPSLayerID.Text = myClass_WPSWeldingLayer.WPSLayerID.ToString(); this.numericUpDown_pWPSLayerPass.Value = myClass_WPSWeldingLayer.WPSLayerPass; this.textBox_pWPSPassSequence.Text = myClass_WPSWeldingLayer.WPSPassSequence; this.textBox_pWPSLayerRemark.Text = myClass_WPSWeldingLayer.WPSLayerRemark; } }