예제 #1
0
 private void Popup_AddMateriel(object sender, MaterielEventArgs e)
 {
     if (e.ids.Count > 0)
     {
         var dtData = mctrl.getByids4BOM(e.ids);
         materal            = e.ids[0];
         this.textBox1.Text = dtData.Rows[0]["num"].ToString();
         this.textBox2.Text = dtData.Rows[0]["name"].ToString();
         this.textBox3.Text = dtData.Rows[0]["metering"].ToString();
     }
 }
예제 #2
0
        private void Popup2_AddMateriel(object sender, MaterielEventArgs e)
        {
            if (e.ids.Count > 0)
            {
                var dtData = mctrl.getByids4BOM(e.ids);

                allids.AddRange(e.ids);
                this.dataGridView1.Rows.Add(dtData.Rows.Count);
                int j = 0;
                for (int i = this.dataGridView1.RowCount - dtData.Rows.Count; i < this.dataGridView1.RowCount; i++)
                {
                    this.dataGridView1.Rows[i].Cells["id"].Value             = dtData.Rows[j]["id"];
                    this.dataGridView1.Rows[i].Cells["num"].Value            = dtData.Rows[j]["num"];
                    this.dataGridView1.Rows[i].Cells["name"].Value           = dtData.Rows[j]["name"];
                    this.dataGridView1.Rows[i].Cells["specifications"].Value = dtData.Rows[j]["specifications"];
                    this.dataGridView1.Rows[i].Cells["metering"].Value       = dtData.Rows[j]["metering"];
                    j++;
                }
            }
        }