Example #1
0
 /// <summary>
 /// 物料删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void matDelBTN_Click(object sender, EventArgs e)
 {
     if (Mat_DataGridView.SelectedRows.Count <= 0)
     {
         MessageBox.Show("至少选中一行数据");
         return;
     }
     if (MessageBox.Show("确认删除" + Mat_DataGridView.SelectedRows.Count + "条物料记录?", "此删除不可恢复", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         List <string> list = new List <string>();
         foreach (DataGridViewRow item in Mat_DataGridView.SelectedRows)
         {
             tblMaterial matModel = (tblMaterial)item.DataBoundItem;
             list.Add(matModel.MAT_ID);
         }
         var rv = materialbll.DelMatInfo(list.ToArray());
         MessageBox.Show(rv.Msg);
     }
     Search(sender);
 }