コード例 #1
0
 private void 打印ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.dataGridView1.CurrentCell != null)
     {
         WarehouseQRCode popup = new WarehouseQRCode("ck", dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["num"].Value.ToString(), "", dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["name"].Value.ToString(), "");
         popup.Show();
     }
     else
     {
         MessageBox.Show("请选择一行。");
     }
 }
コード例 #2
0
 private void 打印ToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (dataGridView2.SelectedRows.Count == 0)
     {
         MessageBox.Show("请选中一行");
     }
     else
     {
         string          positionNum = dataGridView2.SelectedRows[0].Cells["num"].Value.ToString();
         string          warNum      = dataGridView1.SelectedRows[0].Cells["num"].Value.ToString();
         string          warName     = dataGridView1.SelectedRows[0].Cells["name"].Value.ToString();
         string          posName     = dataGridView2.SelectedRows[0].Cells["name"].Value.ToString();
         WarehouseQRCode popup       = new WarehouseQRCode("cw", warNum, positionNum, warName, posName);
         popup.Show();
     }
 }