public Boolean AddStudent(StudentVO instudent) { Boolean status = false; try { status = studentDao.AddStudent(instudent); } catch (CustomException e) { throw e; } return(status); }
/// <summary> /// 添加学生信息 /// </summary> /// <param name="student"></param> /// <returns></returns> public ApiResponse <bool> AddStudent(Student student) { ApiResponse <bool> apiResponse = ApiResponse <bool> .GetInstance(); if (null == student) { EnumOperate.EnumItem enumItem = StudentErrorCode.REQUEST_PARAM_ENTITY_IS_NULL.GetBaseDescription(); return(apiResponse.Error(enumItem.Code, enumItem.Message)); } try { _studentDao.AddStudent(student); apiResponse.Success(true); } catch (System.Exception) { // 异常全部抛出,在全局异常处理类中捕获并处理 throw; } return(apiResponse); }
public void AddStudent(Student student) { _studentDao.AddStudent(student); }