/// <summary> /// 初始化入学年份列表 /// </summary> private void init_inyear() { BLL.STUDENT_INFO studentBll = new STUDENT_INFO(); DataSet ds = studentBll.GetInYearList(); this.cbb_inyear.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; cbb_inyear.Properties.Items.Clear(); cbb_inyear.EditValue = null; cbb_inyear.Properties.NullText = "--请选择--"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string inYear = ds.Tables[0].Rows[i]["InYear"].ToString(); this.cbb_inyear.Properties.Items.Add(inYear); } }
/// <summary> /// 删除数据方法 /// </summary> /// <param name="id"></param> /// <returns></returns> private bool deleteData(int id) { try { BLL.STUDENT_INFO studentBll = new STUDENT_INFO(); int recordCount = studentBll.GetRecordCount("DORMITORY_ID = " + id.ToString()); if (recordCount > 0) { MessageBox.Show("该宿舍信息已经被使用,不能被删除!", "提示信息"); return(false); } else { BLL.DORMITORY_INFO dormitoryBll = new DORMITORY_INFO(); dormitoryBll.Delete(id); return(true); } } catch (Exception exception) { MessageBox.Show("删除失败!", exception.Message); return(false); } }
/// <summary> /// 删除方法 /// </summary> /// <param name="id"></param> /// <returns></returns> private bool deleteData(string id) { try { BLL.TEA_STU teastuBll = new TEA_STU(); int recordCount = teastuBll.GetRecordCount("stuno = " + id); if (recordCount > 0) { MessageBox.Show("该学生信息已经被使用,不能被删除!", "提示信息"); return(false); } else { BLL.STUDENT_INFO studentBll = new STUDENT_INFO(); studentBll.Delete(id); return(true); } } catch (Exception exception) { MessageBox.Show("删除失败!", exception.Message); return(false); } }
/// <summary> /// 删除数据方法 /// </summary> /// <param name="id"></param> /// <returns></returns> private bool deleteData(int id) { try { BLL.STUDENT_INFO studentBll = new STUDENT_INFO(); int recordCount = studentBll.GetRecordCount("CLASSNO = " + id.ToString()); if (recordCount > 0) { MessageBox.Show("该班级信息已经被使用,不能被删除!", "提示信息"); return(false); } else { BLL.CLASS_INFO classBll = new CLASS_INFO(); classBll.Delete(id); return(true); } } catch (Exception exception) { MessageBox.Show("删除失败!", exception.Message); return(false); } }