public HttpResponseMessage Post([FromBody] int[] mark) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } CpManagementService.SetStudentDiplomMark(WebSecurity.CurrentUserId, mark[0], mark[1]); return(new HttpResponseMessage(HttpStatusCode.OK)); }
public HttpResponseMessage Post([FromBody] TaskSheetData taskSheet) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } CpManagementService.SaveTaskSheet(WebSecurity.CurrentUserId, taskSheet); return(new HttpResponseMessage(HttpStatusCode.OK)); }
public object Get([System.Web.Http.ModelBinding.ModelBinder] GetPagedListParams parms) { var subjectId = 0; if (parms.Filters.ContainsKey("subjectId")) { subjectId = int.Parse(parms.Filters["subjectId"]); } return(new { Students = CpManagementService.GetGraduateStudentsForUser(WebSecurity.CurrentUserId, subjectId, parms), PercentageGraphs = PercentageService.GetPercentageGraphsForLecturerAll(WebSecurity.CurrentUserId, parms) }); }
public object Get([System.Web.Http.ModelBinding.ModelBinder] GetPagedListParams parms) { var lecturerId = WebSecurity.CurrentUserId; if (parms.Filters.ContainsKey("lecturerId")) { lecturerId = int.Parse(parms.Filters["lecturerId"]); } var subjectId = 0; if (parms.Filters.ContainsKey("subjectId")) { subjectId = int.Parse(parms.Filters["subjectId"]); } return(new { Students = CpManagementService.GetGraduateStudentsForUser(lecturerId, subjectId, parms, false), CourseProjectConsultationDates = PercentageService.GetConsultationDatesForUser(lecturerId, subjectId) }); }
public void Post([FromBody] CourseProjectTaskSheetTemplate template) { template.LecturerId = WebSecurity.CurrentUserId; CpManagementService.SaveTaskSheetTemplate(template); }
public CourseProjectTaskSheetTemplate Get(int templateId) { return(CpManagementService.GetTaskSheetTemplate(templateId)); }
public object Get(int courseProjectId) { return(CpManagementService.GetTaskSheet(courseProjectId)); }