/// <summary> /// 添加药品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { InfoMgmtForm infoForm = new InfoMgmtForm(); infoForm.ShowDialog(); //BindAll_K(); tabControl_main.SelectedIndex = 0; tabControl_main.SelectedIndex = 1; }
/// <summary> /// 修改药品信息按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button4_Click(object sender, EventArgs e) { if (KEY == 0) { MessageBox.Show("请先选中一行数据!", "温馨提示"); return; } //创建drug,获取当前信息 Drug drug = new Drug(KEY); InfoMgmtForm infoForm = new InfoMgmtForm(KEY); //为组件赋值:当前值 infoForm.setValue(drug.Name, drug.Unit, drug.Spec, drug.Origin, drug.Lot_num, drug.Reserve, drug.W_price, drug.R_price); infoForm.asChange();//更改按钮 infoForm.ShowDialog(); BindAll_K(); }