/// <summary> /// 根据学生编号获取学生信息 /// get /api/student/id /// </summary> /// <param name="id">学生编号</param> /// <returns>学生信息</returns> public Student GetStudentById(int id) { try { IStudentBLL studentBll = BLLFactory.CreateStudentBLL(); return(studentBll.GetStudentById(id)); } catch (Exception ex) { ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); log.Error("获取学生信息错误:" + ex); return(null); } }
public bool UpdateStudent(Student student) { try { IStudentBLL studentBll = BLLFactory.CreateStudentBLL(); return(studentBll.UpdateStudent(student)); } catch (Exception ex) { ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); log.Error("更新学生信息错误:" + ex); return(false); } }
public IEnumerable <Student> Seach(string firstName, string lastName) { try { IStudentBLL studentBll = BLLFactory.CreateStudentBLL(); return(studentBll.Seach(firstName, lastName)); } catch (Exception ex) { ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); log.Error("获取学生列表错误:" + ex); return(null); } }
/// <summary> /// 添加学生信息 /// post /api/student /// </summary> /// <param name="student">学生信息 </param> /// <returns></returns> public HttpResponseMessage Add(Student student) { try { IStudentBLL studentBll = BLLFactory.CreateStudentBLL(); studentBll.AddStudent(student); var response = Request.CreateResponse <Student>(HttpStatusCode.Created, student); string uri = Url.Link("DefaultApi", new { id = student.Id }); response.Headers.Location = new Uri(uri); return(response); } catch (Exception ex) { ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); log.Error("添加学生错误:" + ex); return(null); } }
public AdminController(IClassBLL classBll, ISurveyRepository surveyRepository, IStudentBLL studentBLL) { _classBll = classBll; _surveyRepo = surveyRepository; _studentBLL = studentBLL; }
public StudentController(IStudentBLL studentBll) { _studentBll = studentBll; }
public HomeController(ILogger <HomeController> logger, IStudentBLL istudentBLL, IConfiguration iconfiguration) { _logger = logger; this.istudentBLL = istudentBLL; this.iconfiguration = iconfiguration; }
public StudentUoW(IStudentBLL studentBLL) { this.studentBLL = studentBLL; }
public StudentController(ILogger <StudentController> logger, IStudentBLL istudentBLL) { _logger = logger; this.istudentBLL = istudentBLL; }
public StudentController(IConfiguration configuration, ILogger <StudentController> logger, IStudentBLL istudentBLL) { this.configuration = configuration; _logger = logger; this.istudentBLL = istudentBLL; }
public HomeController(ILogger <HomeController> logger, IMessageDAL imessageService, IStudentBLL studentBLL) { _logger = logger; _imessageService = imessageService; this.studentBLL = studentBLL; }
public HomeController(IStudentBLL bLL, IMenuBLL menuBLL) { StuBLL = bLL; MenuBLL = menuBLL; }
public AccountController(IStudentBLL bLL) { StuBLL = bLL; }