コード例 #1
0
        public UserAccessRequest CheckUserAccessRequest(UserAccessRequest UserAccessRequest)
        {
            var param = new SqlParameter[]
            {
                new SqlParameter("@GlobalID", UserAccessRequest.GlobalID),
                new SqlParameter("@DepartmentID", UserAccessRequest.DepartmentID)
            };

            return(SqlHelper.ExecuteProcedureReturnSingleObject <UserAccessRequest>(ConnectionString, SPConstants.uspCheckUserAccessRequest, param));
        }
コード例 #2
0
        /// <summary>
        /// 加载用户菜单接口
        /// </summary>
        /// <param name="userAccountID"></param>
        /// <returns></returns>
        public WebApiAsyncResponse LoadUserMenuTree(string userAccountID)
        {
            UserAccessRequest userAccessRequest = new UserAccessRequest
            {
                UserID       = userAccountID,
                SoftPlatform = "PCS"
            };

            _webApiAsyncParameter.Operation = string.Format("/api/Users/GetUserMenuTree");
            _webApiAsyncParameter.Parameter = userAccessRequest;
            _webApiAsyncResponse            = _mtsWebAPIConsole.PostAsJsonAsync(_webApiAsyncParameter);
            return(_webApiAsyncResponse);
        }
コード例 #3
0
ファイル: Communication.cs プロジェクト: heater404/SIF
        public bool SwitchUserAccess(UserAccessType accessType)
        {
            if (null == client)
            {
                return(false);
            }

            UserAccessRequest msg = new UserAccessRequest()
            {
                AccessType = accessType,
                PassWord   = 0xcafe2610,
            };

            return(client.Send(msg) > 0);
        }
コード例 #4
0
        public UserAccessRequest SaveUserAccessRequest(UserAccessRequest UserAccessRequest)
        {
            var param = new SqlParameter[]
            {
                new SqlParameter("@ID", UserAccessRequest.ID),
                new SqlParameter("@GlobalID", UserAccessRequest.GlobalID),
                new SqlParameter("@UserName", UserAccessRequest.UserName),
                new SqlParameter("@Email", UserAccessRequest.Email),
                new SqlParameter("@ContactNo", UserAccessRequest.ContactNo),
                new SqlParameter("@CreditAmountID", null),
                new SqlParameter("@DepartmentID", UserAccessRequest.DepartmentID),
                new SqlParameter("@ApprovalStatus", null),
                new SqlParameter("@Comments", UserAccessRequest.Comments),
                new SqlParameter("@RequesterEmail", UserAccessRequest.RequesterEmail),
                new SqlParameter("@IsRequesterNotified", false),
                new SqlParameter("@IsAdminNotified", false),
                new SqlParameter("@RecordStatusId", RecordStatusEnum.Active),
                new SqlParameter("@RoleID", UserAccessRequest.RoleID),
                new SqlParameter("@PlantID", UserAccessRequest.PlantID),
            };

            return(SqlHelper.ExecuteProcedureReturnSingleObject <UserAccessRequest>(ConnectionString, SPConstants.uspSaveUserAccessRequest, param));
        }
コード例 #5
0
        public IActionResult SaveAccessRequest(UserAccessRequest userAccessRequest)
        {
            var saveAccessRequest = Newtonsoft.Json.JsonConvert.SerializeObject(userAccessRequest);

            if (userAccessRequest != null && !string.IsNullOrEmpty(userAccessRequest.GlobalID))
            {
                //var Check = _UserAccessRequestService.CheckUserAccessRequest(userAccessRequest);
                //var Check = _UserAccessRequestService.CheckUserAccessRequest_JSON(saveAccessRequest);
                //if (Check != null)
                //{
                //    //return Ok(new ResponseMessage().GetMessage(Check, "Already in Queue", null, false));
                //    RouteData.Values.Add(MessageConstants.ReturnMessage, MessageConstants.UserInQueue);
                //    return Ok(Check);
                //}
                //else
                //{

                var UserDataFromAD = _ActiveDirectoryService.GetUserByGlobalId(userAccessRequest.GlobalID);
                userAccessRequest.Email          = UserDataFromAD.Email;
                userAccessRequest.RequesterEmail = UserDataFromAD.Email;
                userAccessRequest.UserName       = UserDataFromAD.FullName;
                userAccessRequest.ContactNo      = UserDataFromAD.Mobile;

                //var data = _UserAccessRequestService.SaveUserAccessRequest(userAccessRequest);
                var data = _UserAccessRequestService.SaveUserAccessRequest_JSON(saveAccessRequest);

                RouteData.Values.Add(MessageConstants.ReturnMessage, MessageConstants.DataSaved);
                return(Ok(data));
                //}
            }
            else
            {
                RouteData.Values.Add(MessageConstants.ReturnMessage, MessageConstants.InvalidData);
                return(Ok(userAccessRequest));
            }
        }
コード例 #6
0
        public UserAccessRequest CheckUserAccessRequest(UserAccessRequest UserAccessRequest)
        {
            var data = _UserAccessRequestDBClient.CheckUserAccessRequest(UserAccessRequest);

            return(data);
        }
コード例 #7
0
        public UserAccessRequest SaveUserAccessRequest(UserAccessRequest UserAccessRequest)
        {
            var data = _UserAccessRequestDBClient.SaveUserAccessRequest(UserAccessRequest);

            return(data);
        }