Skip to content

Commit

Permalink
version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
trungngotdt committed Jan 10, 2019
1 parent 1b1b9de commit 788d1ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 28 deletions.
3 changes: 1 addition & 2 deletions AdminVoting/View/ShellWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Background="Red">
HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="5*"/>
Expand Down
11 changes: 1 addition & 10 deletions EthereumVoting.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdminVoting", "AdminVoting\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonLibrary", "CommonLibrary\CommonLibrary.csproj", "{0777523B-75D8-41AF-88C5-504A033B98D5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastConfig", "FastConfig\FastConfig.csproj", "{AE2E155D-2D84-4D65-89FF-212E60E0A363}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -29,10 +27,6 @@ Global
{0777523B-75D8-41AF-88C5-504A033B98D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0777523B-75D8-41AF-88C5-504A033B98D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0777523B-75D8-41AF-88C5-504A033B98D5}.Release|Any CPU.Build.0 = Release|Any CPU
{AE2E155D-2D84-4D65-89FF-212E60E0A363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE2E155D-2D84-4D65-89FF-212E60E0A363}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE2E155D-2D84-4D65-89FF-212E60E0A363}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE2E155D-2D84-4D65-89FF-212E60E0A363}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -41,7 +35,7 @@ Global
SolutionGuid = {742B18E6-0C5C-4EB1-B79F-81A5752200B2}
EndGlobalSection
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 5
SccNumberOfProjects = 4
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://ngotrung.visualstudio.com/
SccLocalPath0 = .
Expand All @@ -54,8 +48,5 @@ Global
SccProjectUniqueName3 = EthereumVoting\\EthereumVoting.csproj
SccProjectName3 = EthereumVoting
SccLocalPath3 = EthereumVoting
SccProjectUniqueName4 = FastConfig\\FastConfig.csproj
SccProjectName4 = FastConfig
SccLocalPath4 = FastConfig
EndGlobalSection
EndGlobal
20 changes: 4 additions & 16 deletions EthereumVoting/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ private async Task LoadedAsync()
RaisePropertyChanged("NOVoteWidth");
//InitCommand();
await taskGetCandidate;
/*
* if (role.Equals("admin"))
if (role.Equals("admin"))
{
Candidates.AsParallel().ForAll(x => {x.IsEnable = false;});
}
Expand All @@ -142,18 +141,6 @@ private async Task LoadedAsync()
x.IsEnable = false;
});
}
}
*/
var votefor = await IsExistVoteFor();
if (!String.IsNullOrEmpty(votefor))
{
var candidates = votefor.Split(' ');
IsEnabledBtnSubmited = false;
Candidates.AsParallel().ForAll(x =>
{
x.IsCheck = candidates.Contains(x.Name);// x.Name.Equals(votefor);
x.IsEnable = false;
});
}
OpenDialog(false);
RaisePropertyChanged("Candidates");
Expand All @@ -179,6 +166,7 @@ private void InitCommand()
{
try
{
OpenDialog(true);
await SubmitVotingAsync();
}
catch (Exception ex)
Expand All @@ -192,8 +180,8 @@ private void InitCommand()

private void ToogleChecked(string name)
{
var itemRm = candidatesIsCheck.AsParallel().Contains(name);
if (itemRm)
var itemIsAlReadyCheck = candidatesIsCheck.AsParallel().Contains(name);
if (itemIsAlReadyCheck)
{
Candidates.AsParallel().First(item => item.Name.Equals(name)).IsCheck = false;
candidatesIsCheck.Remove(name);
Expand Down

0 comments on commit 788d1ed

Please sign in to comment.