Beispiel #1
0
        /// <summary>
        /// 初始化窗体,取得专业名称到列表
        /// </summary>
        private void init_major()
        {
            Student.BLL.MAJOR_INFO majorBll = new MAJOR_INFO();
            DataSet ds = majorBll.GetAllList();

            cbb_majorname.Properties.Items.Clear();
            cbb_majorname.EditValue           = null;
            cbb_majorname.Properties.NullText = "--请选择--";
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string majorName = ds.Tables[0].Rows[i]["MAJORNAME"].ToString();
                this.cbb_majorname.Properties.Items.Add(majorName);
            }
            this.cbb_majorname.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
        }
Beispiel #2
0
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 private bool deleteData(int id)
 {
     try
     {
         BLL.MAJOR_INFO majorinfobll = new MAJOR_INFO();
         int            recordCount  = majorinfobll.GetRecordCount("departmentno = " + id.ToString());
         if (recordCount > 0)
         {
             MessageBox.Show("该学院信息已经被使用,不能被删除!", "提示信息");
             return(false);
         }
         else
         {
             BLL.DEPARTMENT_INFO departmentbll = new DEPARTMENT_INFO();
             departmentbll.Delete(id);
             return(true);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("删除失败!", exception.Message);
         return(false);
     }
 }
Beispiel #3
0
 /// <summary>
 /// 删除数据方法
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 private bool deleteData(int id)
 {
     try
     {
         BLL.MAJORDIRCT_INFO majordirctinfobll = new MAJORDIRCT_INFO();
         int recordCount = majordirctinfobll.GetRecordCount("majorno = " + id.ToString());
         if (recordCount > 0)
         {
             MessageBox.Show("该专业信息已经被使用,不能被删除!", "提示信息");
             return(false);
         }
         else
         {
             BLL.MAJOR_INFO majorbll = new MAJOR_INFO();
             majorbll.Delete(id);
             return(true);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("删除失败!", exception.Message);
         return(false);
     }
 }