Пример #1
0
 public void selectm()
 {
     try
     {
         产品原料关系 newform = (产品原料关系)this.ParentForm;
         if (textBox1.Text != "0")
         {
             ProductMaterial pmr = new ProductMaterial();
             pmr.MaterialCount = Convert.ToInt16(textBox1.Text);
             pmr.ProductId     = PID;
             pmr.MaterialId    = dataGridView1.Rows[index].Cells["原料编号"].Value.ToString();
             if (pm.AddMaterialProductRelation(pmr))
             {
                 MessageBox.Show("新原料产品关系建立成功!");
                 this.Close();
             }
         }
         else
         {
             MessageBox.Show("请输入产品-原材料比例的数量!");
         }
     }
     catch (Exception ex) { MessageBox.Show("此原料添加失败!"); }
 }