private void toolDel_Click(object sender, EventArgs e) { SupperSet ss = new SupperSet(constr); int Supper_id = Convert.ToInt16(dgList.CurrentRow.Cells[0].Value.ToString()); if (ss.Del(Supper_id) == true) { int iRow = dgList.CurrentRow.Index; dgList.Rows.RemoveAt(iRow); MessageBox.Show("删除成功!"); } else { MessageBox.Show("删除失败!"); } }
private void toolRefresh_Click(object sender, EventArgs e) { SupperSet ss = new SupperSet(constr); List <Supper> lss = ss.GetSupperSetList(); if (lss.Count > 0) { this.dgList.Rows.Clear(); foreach (Supper so in lss) { int index = this.dgList.Rows.Add(); this.dgList.Rows[index].Cells[0].Value = so.Supper_id; this.dgList.Rows[index].Cells[1].Value = so.Supper_name; this.dgList.Rows[index].Cells[2].Value = so.SUPPLIER_id; this.dgList.Rows[index].Cells[3].Value = so.SUPPLIER_Number; this.dgList.Rows[index].Cells[4].Value = so.SUPPLIER_Name; this.dgList.Rows[index].Cells[5].Value = so.UserOrg_id; this.dgList.Rows[index].Cells[6].Value = so.UserOrg_Number; this.dgList.Rows[index].Cells[7].Value = so.UserOrg_Name; } } }