LabExercises.cs
1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Driver;
using AIAHTML5.API.Properties;
using MongoDB.Driver.Builders;
namespace AIAHTML5.API.Models
{
public class LabExercises
{
public int Attemptnumber { get; set; }
public string labExerciseCode { get; set; }
public string Answer { get; set; }
public int Question { get; set; }
public int Score { get; set; }
public void UpdateUserLabExercise(Users objUser)
{
var client = new MongoClient();
var db = client.GetDatabase(Settings.Default.database);
var collection = db.GetCollection<BsonDocument>("Users");
collection.UpdateOne(
Builders<BsonDocument>.Filter.Eq("loginId", objUser.loginId),
Builders<BsonDocument>.Update.Set("LabExerciseAttempt", objUser.labExerciseAttempt));
}
}
}