//查询数据 private void ReadData() { string condition = ""; if (this.te_termname.Text.Length > 0) { condition += " termname like '%" + this.te_termname.Text + "%'"; } Student.BLL.TERM_INFO tremBll = new Student.BLL.TERM_INFO(); this.gridControl1.DataSource = tremBll.GetList(condition).Tables[0]; this.gridviews.BestFitColumns(); DBUtility.ToolHelper.DrawRowIndicator(gridviews, 40); DBUtility.ToolHelper.SetLineColorofGridView(this.gridviews); }
private bool deleteData(int id) { try { Student.BLL.TERM_INFO majordirctinfobll = new Student.BLL.TERM_INFO(); int recordCount = majordirctinfobll.GetRecordCount("termno = " + id.ToString()); if (recordCount > 1) { MessageBox.Show("该学期信息已经被使用,不能被删除!", "提示信息"); return(false); } else { BLL.TERM_INFO termbll = new Student.BLL.TERM_INFO(); termbll.Delete(id); return(true); } } catch (Exception exception) { MessageBox.Show("删除失败!", exception.Message); return(false); } }