Exemplo n.º 1
0
        public IActionResult probaPost([FromBody] DivisionsController.CreateInitialDivisionParameterBinding obj)
        {
            var claimsIdentity = User.Identity as ClaimsIdentity;
            var c = obj;

            return(Ok(new
            {
                id = HttpContext.User.GetId(),
                role = User.GetRole(),
                user = claimsIdentity
            }));
        }
Exemplo n.º 2
0
        public IActionResult CreateInitialDivision([FromBody] DivisionsController.CreateInitialDivisionParameterBinding obj)
        {
            //if (!HttpContext.Session.IsAssistant()) return Unauthorized();

            try
            {
                divisionService.CreateInitialDivision(HttpContext.User.GetId(), obj.name, obj.departmentID, obj.courseID, obj.divisionTypeID, obj.beginning, obj.ending, obj.groups.ToList());
                return(Ok(new { status = "success" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { status = "error", message = ex.Message }));
            }
        }