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)); }
/// <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); }
public bool SwitchUserAccess(UserAccessType accessType) { if (null == client) { return(false); } UserAccessRequest msg = new UserAccessRequest() { AccessType = accessType, PassWord = 0xcafe2610, }; return(client.Send(msg) > 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)); }
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)); } }
public UserAccessRequest CheckUserAccessRequest(UserAccessRequest UserAccessRequest) { var data = _UserAccessRequestDBClient.CheckUserAccessRequest(UserAccessRequest); return(data); }
public UserAccessRequest SaveUserAccessRequest(UserAccessRequest UserAccessRequest) { var data = _UserAccessRequestDBClient.SaveUserAccessRequest(UserAccessRequest); return(data); }