void 新增货品ToolStripMenuItemClick(object sender, EventArgs e) { //新货品 FormGood tF = new FormGood(); tF.Text = "货品-新增"; //将当前选择的项作为父对象填充到对话框中 TreeNode rd = treeView1.SelectedNode; if (rd != null) { tF.GoodsTypePID = Int32.Parse(rd.Tag.ToString()); tF.GoodsTypePName = rd.Text; } tF.ShowDialog(); //FillDataGridView(); RefreshDateSet(); }
// void Button6Click(object sender, EventArgs e) // { // //切换本按钮显示文本 // if(button6.Text == "隐藏零库存") // { // button6.Text = "显示全部"; // b_HideZeroStock = true; // ShowGoods(); // } // else // { // button6.Text ="隐藏零库存"; // b_HideZeroStock = false; // ShowGoods(); // } // } // //隐藏0库存行 // void HideZeroRow(bool flag) // { // if(flag) // { // //隐藏 // int row = dataGridView1.Rows.Count;//得到总行数 // for (int i = 0; i < row; i++) // { // //MessageBox.Show(dataGridView1.Rows[i].Cells[3].Value.ToString()); // string ts = dataGridView1.Rows[i].Cells["LastQty"].Value.ToString(); // if(ts == "0") // { // CurrencyManager cm = (CurrencyManager)BindingContext[dataGridView1.DataSource]; // cm.SuspendBinding(); //挂起数据绑定 // dataGridView1.Rows[i].Visible = false; // cm.ResumeBinding(); //恢复数据绑定 // } // // } // } // else // { // //显示 // int row = dataGridView1.Rows.Count;//得到总行数 // for (int i = 0; i < row; i++) // { // dataGridView1.Rows[i].Visible = true; // } // } // } void DataGridView1DoubleClick(object sender, EventArgs e) { //进入货品编辑状态 if (dataGridView1.CurrentRow == null) { return; } s_GoodsID = dataGridView1.CurrentRow.Cells["GoodsID"].Value.ToString(); int i_GoodsID = Convert.ToInt32(s_GoodsID); //修改货品 FormGood tF = new FormGood(); tF.Text = "货品-修改"; tF.iGoodsID = i_GoodsID; tF.ShowDialog(); //FillDataGridView(); RefreshDateSet(); }