private void buttonAdd_Click(object sender, EventArgs e) { if (!CheckData()) { return; } if (tabData != null) { DataRow[] matchs = tabData.Select("Level='" + level + "'"); if (matchs.Length > 0) { MessageBox.Show("效益层级已经存在", "信息提示", MessageBoxButtons.OK); return; } } PerformanceBean b = new PerformanceBean(); b.Level = level; b.BaseSalary = salary; PerformanceDAO d = new PerformanceDAO(); d.AddPerformance(b); LoadData(); }
public StaffBean() { post = new PostBean(); performance = new PerformanceBean(); benefit = new BenefitBean(); department = new DepartmentBean(); }
private void buttonDelete_Click(object sender, EventArgs e) { if (id == -1) { return; } PerformanceBean b = new PerformanceBean(); b.Id = id; PerformanceDAO d = new PerformanceDAO(); d.DeletePerformance(b); LoadData(); }
public int DeletePerformance(PerformanceBean b) { int count = 0; try { SqlParameter[] sp = { para = new SqlParameter("@Id", b.Id), }; count = sh.RunSql("PR_Performance_Delete", sp); } catch (Exception ex) { throw ex; } return(count); }
private SqlParameter para; //参数 public int AddPerformance(PerformanceBean b) { int count = 0; try { SqlParameter[] sp = { para = new SqlParameter("@Level", b.Level), para = new SqlParameter("@BaseSalary", b.BaseSalary), }; count = sh.RunSql("PR_Performance_Add", sp); } catch (Exception ex) { throw ex; } return(count); }