private void Button5_Click(System.Object sender, System.EventArgs e) { try { if (!(TreeView1.SelectedNode.GetNodeCount(true) > 0)) { string materialname; materialname = TreeView1.SelectedNode.Text; frmAddFoodCost frmaddmtrl = new frmAddFoodCost(); frmaddmtrl.Label1.Text = "名称:" + materialname + " 单位:" + rms_var.GetMaterialUnit(materialname); frmaddmtrl.ShowDialog(); if (frmaddmtrl.DialogResult == DialogResult.OK) { //向成本表中添加记录 if (AddMtrl(foodcode, rms_var.GetMaterialCode(materialname), frmaddmtrl.ComboBox1.Text, rms_var.GetMaterialUnit(materialname), (double)frmaddmtrl.NumericUpDown1.Value, (double)frmaddmtrl.NumericUpDown2.Value)) { GetFoodCostMtrlInfo(foodcode); } } } } catch (Exception err) { MessageBox.Show(err.Message); } }
private void DataGrid1_DragDrop(System.Object sender, System.Windows.Forms.DragEventArgs e) { string materialname; materialname = e.Data.GetData(DataFormats.Text).ToString(); frmAddFoodCost frmaddmtrl = new frmAddFoodCost(); frmaddmtrl.Label1.Text = "名称:" + materialname + " 单位:" + rms_var.GetMaterialUnit(materialname); frmaddmtrl.ShowDialog(); if (frmaddmtrl.DialogResult == DialogResult.OK) { //向成本表中添加记录 if (AddMtrl(foodcode, rms_var.GetMaterialCode(materialname), frmaddmtrl.ComboBox1.Text, rms_var.GetMaterialUnit(materialname), (double)frmaddmtrl.NumericUpDown1.Value, (double)frmaddmtrl.NumericUpDown2.Value)) { GetFoodCostMtrlInfo(foodcode); } } }
private void DataGrid1_DragDrop(System.Object sender, System.Windows.Forms.DragEventArgs e) { string materialname; materialname = e.Data.GetData(DataFormats.Text).ToString(); frmAddFoodCost frmaddmtrl = new frmAddFoodCost(); frmaddmtrl.Label1.Text = "名称:" + materialname + " 单位:" + rms_var.GetMaterialUnit(materialname); frmaddmtrl.ShowDialog(); if (frmaddmtrl.DialogResult == DialogResult.OK) { //向成本表中添加记录 if (AddMtrl(foodcode, rms_var.GetMaterialCode(materialname), frmaddmtrl.ComboBox1.Text, rms_var.GetMaterialUnit(materialname), (double) frmaddmtrl.NumericUpDown1.Value, (double) frmaddmtrl.NumericUpDown2.Value)) { GetFoodCostMtrlInfo(foodcode); } } }
private void Button5_Click(System.Object sender, System.EventArgs e) { try { if (!(TreeView1.SelectedNode.GetNodeCount(true)>0)) { string materialname; materialname = TreeView1.SelectedNode.Text; frmAddFoodCost frmaddmtrl = new frmAddFoodCost(); frmaddmtrl.Label1.Text = "名称:" + materialname + " 单位:" + rms_var.GetMaterialUnit(materialname); frmaddmtrl.ShowDialog(); if (frmaddmtrl.DialogResult == DialogResult.OK) { //向成本表中添加记录 if (AddMtrl(foodcode, rms_var.GetMaterialCode(materialname), frmaddmtrl.ComboBox1.Text, rms_var.GetMaterialUnit(materialname), (double)frmaddmtrl.NumericUpDown1.Value, (double)frmaddmtrl.NumericUpDown2.Value)) { GetFoodCostMtrlInfo(foodcode); } } } } catch (Exception err) { MessageBox.Show(err.Message); } }