Exemplo n.º 1
0
 /// <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);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 删除数据方法
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 private bool deleteData(int id)
 {
     try
     {
         BLL.DORMITORY_INFO dormitoryBll = new DORMITORY_INFO();
         int recordCount = dormitoryBll.GetRecordCount("BUILDINGID = " + id.ToString());
         if (recordCount > 0)
         {
             MessageBox.Show("该宿舍楼信息已经被使用,不能被删除!", "提示信息");
             return(false);
         }
         else
         {
             BLL.BUILDING_INFO buildingBll = new BUILDING_INFO();
             buildingBll.Delete(id);
             return(true);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("删除失败!", exception.Message);
         return(false);
     }
 }