Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Rockiez committed Jan 16, 2019
1 parent cd3379d commit efe1168
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
8 changes: 2 additions & 6 deletions UploadGui/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<!--<connectionStrings>
<add name="LocalDB"
connectionString = "Data Source=(localdb)\\MSSQLLocalDB;Database=User_info"
providerName = "SqlServer" />
</connectionStrings>-->

<connectionStrings>
<add name="LocalDB" providerName="SqlServer"
connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=UsersDB;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" />
connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=User_info;Integrated Security=True" />
</connectionStrings>
</configuration>
2 changes: 0 additions & 2 deletions UploadGui/Services/DBApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ namespace UploadGui.Services
{
class UsersDBApiService : LinqToDB.Data.DataConnection
{


public UsersDBApiService() : base("LocalDB") { }
public ITable<User> Users => GetTable<User>();

Expand Down
19 changes: 4 additions & 15 deletions UploadGui/Services/UserAuthenticateApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace UploadGui.Services
{

public class UserAuthenticateApiService
public static class UserAuthenticateApiService
{
public static async Task Login(LoginRequest request, Action<LoginResult> resultCallback)
{
Expand All @@ -26,29 +26,19 @@ public static async Task GetStudios(GetStudiosRequest request, Action<GetStudios

internal static async Task MakeApiCall<TRequestType, TResultType>(string api, string apiEndpoint, TRequestType request, Action<TResultType> resultCallback) where TResultType : class
{
var req = JsonWrapper.SerializeObject(request, UserAuthenticateJsonSerializerStrategyService.ApiSerializerStrategy);

//Set headers
var headers = new Dictionary<string, string>
{
{"Content-Type", "application/json"},
{"X-ReportErrorAsSuccess", "true"},
{"X-PlayFabSDK", "PlayFab_EditorExtensions" + "_" + "2.53.181001"}
};


var requestJson = JsonWrapper.SerializeObject(request, UserAuthenticateJsonSerializerStrategyService.ApiSerializerStrategy);

using (var client = new HttpClient())
{
client.BaseAddress = new Uri(apiEndpoint);
var result = await client.PostAsync(api, new StringContent(
req.Trim(), Encoding.UTF8, "application/json"));
requestJson, Encoding.UTF8, "application/json"));
string resultContent = await result.Content.ReadAsStringAsync();
DeserializeResult(api, resultCallback, resultContent);
}
}



private static void DeserializeResult<TResultType>(string api, Action<TResultType> resultCallback, string response) where TResultType : class
{
var httpResult = JsonWrapper.DeserializeObject<HttpResponseObject>(response, UserAuthenticateJsonSerializerStrategyService.ApiSerializerStrategy);
Expand All @@ -67,6 +57,5 @@ private static void DeserializeResult<TResultType>(string api, Action<TResultTyp

resultCallback(result);
}

}
}
2 changes: 1 addition & 1 deletion UploadGui/Utils/DropdownTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static DropdownTextBox()
DefaultStyleKeyProperty.OverrideMetadata(typeof(DropdownTextBox), new FrameworkPropertyMetadata(typeof(DropdownTextBox)));
}

#region 属性
#region Property

/*----------------------------------------------------------------*/
public static readonly DependencyProperty IsDropdownOpenedProperty = DependencyProperty.Register("IsDropdownOpened", typeof(bool), typeof(DropdownTextBox), new FrameworkPropertyMetadata(new PropertyChangedCallback(IsDropdownOpenedPropertyChanged)));
Expand Down
1 change: 1 addition & 0 deletions UploadGui/ViewModels/UserAuthenticateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public UserAuthenticateViewModel()
CurrentPage = new LoginPage(this);
LoginButtonEnable = true;
NextButtonEnable = false;

UserList = UsersDBApiService.All();

//command binding
Expand Down

0 comments on commit efe1168

Please sign in to comment.