Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guru
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
guru
Commits
2d7e3b56
Commit
2d7e3b56
authored
Dec 23, 2018
by
Clint.Network
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Participation
parent
00d842fe
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
0 deletions
+65
-0
DatabaseContext.cs
Stratis.Guru/DatabaseContext.cs
+1
-0
IParticipations.cs
Stratis.Guru/Models/IParticipations.cs
+7
-0
Participation.cs
Stratis.Guru/Models/Participation.cs
+15
-0
Participations.cs
Stratis.Guru/Models/Participations.cs
+26
-0
Startup.cs
Stratis.Guru/Startup.cs
+1
-0
NewParticipation.cshtml
Stratis.Guru/Views/Home/NewParticipation.cshtml
+15
-0
No files found.
Stratis.Guru/DatabaseContext.cs
View file @
2d7e3b56
...
@@ -23,5 +23,6 @@ namespace Stratis.Guru
...
@@ -23,5 +23,6 @@ namespace Stratis.Guru
public
IMongoCollection
<
Draw
>
Draws
=>
_database
.
GetCollection
<
Draw
>(
"draws"
);
public
IMongoCollection
<
Draw
>
Draws
=>
_database
.
GetCollection
<
Draw
>(
"draws"
);
public
IMongoCollection
<
Setting
>
Settings
=>
_database
.
GetCollection
<
Setting
>(
"lottery"
);
public
IMongoCollection
<
Setting
>
Settings
=>
_database
.
GetCollection
<
Setting
>(
"lottery"
);
public
IMongoCollection
<
Participation
>
Participations
=>
_database
.
GetCollection
<
Participation
>(
"participations"
);
}
}
}
}
\ No newline at end of file
Stratis.Guru/Models/IParticipations.cs
0 → 100644
View file @
2d7e3b56
namespace
Stratis.Guru.Models
{
public
interface
IParticipation
{
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
);
}
}
\ No newline at end of file
Stratis.Guru/Models/Participation.cs
0 → 100644
View file @
2d7e3b56
using
MongoDB.Bson
;
using
MongoDB.Bson.Serialization.Attributes
;
namespace
Stratis.Guru.Models
{
public
class
Participation
{
[
BsonId
]
public
ObjectId
Id
{
get
;
set
;
}
public
string
Ticket
{
get
;
set
;
}
public
string
WithdrawAddress
{
get
;
set
;
}
public
BsonDateTime
CreationDate
{
get
;
set
;
}
public
string
Nickname
{
get
;
internal
set
;
}
}
}
\ No newline at end of file
Stratis.Guru/Models/Participations.cs
0 → 100644
View file @
2d7e3b56
using
System
;
namespace
Stratis.Guru.Models
{
public
class
Participations
:
IParticipation
{
private
DatabaseContext
_databaseContext
;
public
Participations
(
DatabaseContext
databaseContext
)
{
_databaseContext
=
databaseContext
;
}
public
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
)
{
//TODO: store lottery id
_databaseContext
.
Participations
.
InsertOne
(
new
Participation
{
CreationDate
=
DateTime
.
Now
,
Ticket
=
ticket
,
Nickname
=
nickname
,
WithdrawAddress
=
address
});
}
}
}
\ No newline at end of file
Stratis.Guru/Startup.cs
View file @
2d7e3b56
...
@@ -59,6 +59,7 @@ namespace Stratis.Guru
...
@@ -59,6 +59,7 @@ namespace Stratis.Guru
services
.
AddTransient
<
DatabaseContext
>();
services
.
AddTransient
<
DatabaseContext
>();
services
.
AddSingleton
<
ISettings
,
Models
.
Settings
>();
services
.
AddSingleton
<
ISettings
,
Models
.
Settings
>();
services
.
AddSingleton
<
IDraws
,
Draws
>();
services
.
AddSingleton
<
IDraws
,
Draws
>();
services
.
AddSingleton
<
IParticipation
,
Participations
>();
services
.
AddHostedService
<
UpdateInfosService
>();
services
.
AddHostedService
<
UpdateInfosService
>();
services
.
AddHostedService
<
FixerService
>();
services
.
AddHostedService
<
FixerService
>();
...
...
Stratis.Guru/Views/Home/NewParticipation.cshtml
0 → 100644
View file @
2d7e3b56
<h2 class="text-dark mb-1">Thank You</h2>
<p>We have received your $STRAT.</p>
<div class="form-group mt-3 required text-left">
<label for="withdrawAddress">Withdraw Address <span class="text-danger">*</span></label>
<input type="text" name="address" class="form-control text-dark form-control-lg" required id="withdrawAddress" placeholder="Enter a Stratis Address">
</div>
<div class="form-group required text-left">
<label for="nickname">Your Nickname <span class="text-danger">*</span></label>
<input type="text" name="nickname" class="form-control text-dark form-control-lg" required id="nickname" placeholder="Enter a Nickname">
</div>
<div class="form-group mb-0 required text-left">
<label for="ticket" class="required">Your Ticket Number</label>
<input type="text" class="form-control text-dark form-control-lg" id="ticket" value="@ViewBag.Ticket">
<small class="form-text text-muted">Please keep this ticket private.</small>
</div>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment