Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        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);
                }

            }
        }
Exemplo n.º 4
0
        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);
            }
        }