Exemplo n.º 1
0
 public UserDetailCreateHandler(GlobalSolusindoDb db, tblM_User user, UserDetailValidator userDetailValidator, UserDetailFactory userDetailFactory, UserDetailQuery userDetailQuery, AccessControl accessControl) : base(db, user)
 {
     this.userDetailValidator         = userDetailValidator;
     this.userDetailFactory           = userDetailFactory;
     this.userDetailQuery             = userDetailQuery;
     this.userDetailEntryDataProvider = new UserDetailEntryDataProvider(db, user, accessControl, userDetailQuery);
 }
Exemplo n.º 2
0
        public async Task <IActionResult> UserDetail(string userId, string userFilter)
        {
            try
            {
                var command = new UserDetailQuery {
                    UserId = userId, UserFilter = userFilter
                };
                var response = await mediator.Send(command);

                return(View("~/Views/UserAdministration/UserDetails.cshtml", response));
            }
            catch (EntityNotFoundException exception)
            {
                logger.LogInformation(exception, "User Not Found");
                return(RedirectToAction(nameof(Index)));
            }
        }
Exemplo n.º 3
0
        public async Task <ActionResult <UserDetailDto> > GetUserByDetail(int id)
        {
            var query = new UserDetailQuery(id);

            _logger.LogInformation(
                "----- Sending query: UserDetailQuery - {id}",
                id);

            var queryResult = await _mediator.Send(query);

            if (queryResult == null)
            {
                return(BadRequest("Query not created"));
            }

            return(Ok(queryResult));
        }
Exemplo n.º 4
0
        public ActionResult GetUserDetailList()
        {
            try
            {
                var queryParams = new NameValueCollection();
                if (!ParamHelper.CheckParaQ(ref queryParams))
                {
                    return(Json(new ResponseEntity <int>(RegularFunction.RegularSqlRegexText), JsonRequestBehavior.AllowGet));
                }

                var query = new UserDetailQuery(queryParams);

                var sqlCondition = new StringBuilder();
                sqlCondition.Append("ISNULL(IsDelete,0)!=1");


                PageRequest preq = new PageRequest
                {
                    TableName      = " [UserDetail] ",
                    Where          = sqlCondition.ToString(),
                    Order          = " Id DESC ",
                    IsSelect       = true,
                    IsReturnRecord = true,
                    PageSize       = query.PageSize,
                    PageIndex      = query.PageIndex,
                    FieldStr       = "*"
                };

                var result = new UserDetailBLL().GetDataByPage(preq);

                var response = new ResponseEntity <object>(true, string.Empty,
                                                           new DataGridResultEntity <UserDetail>
                {
                    TotalRecords   = preq.Out_AllRecordCount,
                    DisplayRecords = preq.Out_PageCount,
                    ResultData     = result
                });

                return(Json(response, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new ResponseEntity <object>(-999, string.Empty, ""), JsonRequestBehavior.AllowGet));
            }
        }
 public UserDetailEntryDataProvider(GlobalSolusindoDb db, tblM_User user, AccessControl accessControl, UserDetailQuery userDetailQuery) : base(db, user)
 {
     this.accessControl   = accessControl;
     this.userDetailQuery = userDetailQuery;
 }
Exemplo n.º 6
0
        public async Task <IActionResult> Get([FromRoute] UserDetailQuery query)
        {
            var result = await _mediator.Send(query);

            return(Ok(result));
        }