Commit 34deed22 authored by Louise.Treuil's avatar Louise.Treuil
Browse files

Merge branch 'Louise' into 'dev'

update UserData

See merge request !2
parents 5501f4da 50bb2980
......@@ -253,7 +253,7 @@ namespace Menus.Acquisition.Controller
private string GetUniqueFileName()
{
return app.model.GetCurrentUser().LastName + app.model.GetCurrentUser().FirstName +
return app.model.GetCurrentUser().NickNAme +
DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
}
......@@ -307,7 +307,7 @@ namespace Menus.Acquisition.Controller
protected void OnUser(UserData userSelected)
{
app.model.SetCurrentUser(userSelected);
app.view.currentConfigValue.text = userSelected.FirstName + " " + userSelected.LastName;
app.view.currentConfigValue.text = userSelected.NickNAme;
}
protected void OnDevice(DevicesInfos.Device device)
......@@ -341,8 +341,7 @@ namespace Menus.Acquisition.Controller
if (app.model.GetDataBase() != null)
{
app.view.CleanConfigPanel();
app.view.User.text = app.model.GetCurrentUser().FirstName + " " +
app.model.GetCurrentUser().LastName;
app.view.User.text = app.model.GetCurrentUser().NickNAme;
app.view.Device.text = app.model.GetDevice().ToString();
app.view.Database.text = app.model.GetDataBase().Name;
DBManager.GetInstance().SetCurrentDB(app.model.GetDataBase());
......
......@@ -142,8 +142,8 @@ namespace Menus.Acquisition.View
foreach (UserData user in listUsers)
{
UserButton newButton = Instantiate(userButton, ConfigContent.transform, false);
newButton.gameObject.name = user.FirstName + " " + user.LastName;
newButton.text.text = user.FirstName + " " + user.LastName;
newButton.gameObject.name = user.NickNAme;
newButton.text.text = user.NickNAme;
newButton.user = user;
newButton.button.onClick.AddListener(() =>
{
......
......@@ -215,7 +215,7 @@ namespace Menus.Demonstration.Controller
private string GetUniqueFileName()
{
return app.model.GetCurrentUser().LastName + app.model.GetCurrentUser().FirstName +
return app.model.GetCurrentUser().NickNAme +
DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
}
......@@ -250,7 +250,7 @@ namespace Menus.Demonstration.Controller
protected void OnUser(UserData userSelected)
{
app.model.SetCurrentUser(userSelected);
app.view.currentConfigValue.text = userSelected.FirstName + " " + userSelected.LastName;
app.view.currentConfigValue.text = userSelected.NickNAme;
}
protected void OnDevice(DevicesInfos.Device device)
......
......@@ -63,8 +63,8 @@ namespace Menus.Demonstration.View
foreach (UserData user in listUsers)
{
UserButton newButton = Instantiate(UserButton, ConfigContent.transform, false);
newButton.gameObject.name = user.FirstName + " " + user.LastName;
newButton.text.text = user.FirstName + " " + user.LastName;
newButton.gameObject.name = user.NickNAme;
newButton.text.text = user.NickNAme;
newButton.user = user;
newButton.button.onClick.AddListener(() =>
{
......
......@@ -169,7 +169,7 @@ public class UserAppController : MenuController<UserAppApplication>
protected void OnUser(UserData userSelected)
{
app.model.SetCurrentUser(userSelected);
app.view.currentConfigValue.text = userSelected.FirstName + " " + userSelected.LastName;
app.view.currentConfigValue.text = userSelected.NickNAme;
}
public void ClosePanels()
......
......@@ -62,8 +62,8 @@ namespace Menus.UserApp.View
foreach (UserData user in listUsers)
{
UserButton newButton = Instantiate(UserButton, ConfigContent.transform, false);
newButton.gameObject.name = user.FirstName + " " + user.LastName;
newButton.text.text = user.FirstName + " " + user.LastName;
newButton.gameObject.name = user.NickNAme;
newButton.text.text = user.NickNAme;
newButton.user = user;
newButton.button.onClick.AddListener(() =>
{
......
......@@ -69,7 +69,7 @@ namespace Menus.UsersManagement.Controller
protected void OnAddUserClicked()
{
UserManager.GetInstance().AddUser(new UserData("Jean", "Dupont", "30", "183", "72", "right", "true"));
UserManager.GetInstance().AddUser(new UserData("Jean", "jean@mail.fr", "30", "183", "72", "right", "ojkbj", "P54", "3", "[]"));
app.model.GetUsers().Clear();
app.model.SetUsers(UserManager.GetInstance().GetUsers());
app.view.RefreshUserList();
......
......@@ -75,8 +75,8 @@ namespace Menus.UsersManagement.View
foreach (UserData user in listUsers)
{
UserButton newButton = Instantiate(userButton, listUsersContent.transform, false);
newButton.gameObject.name = user.FirstName + " " + user.LastName;
newButton.text.text = user.FirstName + " " + user.LastName;
newButton.gameObject.name = user.NickNAme;
newButton.text.text = user.NickNAme;
newButton.user = user;
newButton.button.onClick.AddListener(() => this.SelectedUser(newButton));
}
......@@ -99,13 +99,16 @@ namespace Menus.UsersManagement.View
public void SaveClicked()
{
UserData saveUser = new UserData(app.model.GetCurrentUser().Id,
dicInputAttribute["FirstName"].input_text.text,
dicInputAttribute["LastName"].input_text.text,
dicInputAttribute["NickNAme"].input_text.text,
dicInputAttribute["Mail"].input_text.text,
dicInputAttribute["Age"].input_text.text,
dicInputAttribute["Weight"].input_text.text,
dicInputAttribute["Size"].input_text.text,
dicInputAttribute["Hand"].input_text.text,
dicInputAttribute["Beginner"].input_text.text
dicInputAttribute["EncryptedPwd"].input_text.text,
dicInputAttribute["Program"].input_text.text,
dicInputAttribute["ProgramAdv"].input_text.text,
dicInputAttribute["PastInfos"].input_text.text
);
UsersManagementNotification.SaveUserClicked(saveUser);
}
......
......@@ -44,13 +44,17 @@ namespace Recognizer
"</annotation>" +
"\n\t</annotationXML>" +
"\n\t<annotationXML type='user'>" +
"\n\t\t<annotation type='lastName'>" + _currentUser.LastName + "</annotation>" +
"\n\t\t<annotation type='firstName'>" + _currentUser.FirstName + "</annotation>" +
"\n\t\t<annotation type='nickName'>" + _currentUser.NickNAme + "</annotation>" +
"\n\t\t<annotation type='mail'>" + _currentUser.Mail + "</annotation>" +
"\n\t\t<annotation type='age'>" + _currentUser.Age + "</annotation>" +
"\n\t\t<annotation type='weight'>" + _currentUser.Weight + "</annotation>" +
"\n\t\t<annotation type='size'>" + _currentUser.Size + "</annotation>" +
"\n\t\t<annotation type='hand'>" + _currentUser.Hand + "</annotation>" +
"\n\t\t<annotation type='userId'>" + _currentUser.Id + "</annotation>" +
"\n\t\t<annotation type='pwd'>" + _currentUser.EncryptedPwd + "</annotation>" +
"\n\t\t<annotation type='pgm'>" + _currentUser.Program + "</annotation>" +
"\n\t\t<annotation type='pgmAdv'>" + _currentUser.ProgramAdv + "</annotation>" +
"\n\t\t<annotation type='pastinfos'>" + _currentUser.PastInfos + "</annotation>" +
"\n\t</annotationXML>" + directives;
string rawdata = "\n\t<traceGroup>";
......
......@@ -14,46 +14,58 @@ public class UserData
[DataMember]
public string Hand{get; set;} //left-handed, right-handed or both
[DataMember]
public string Beginner{get; set;} //tell if the user is a beginner or not
public string NickNAme{get; set;} //tell if the user is a beginner or not
[DataMember]
public string Id{get; set;}
[DataMember]
public string FirstName{get; set;}
public string Mail{get; set;}
[DataMember]
public string LastName{get; set;}
public string EncryptedPwd{get; set;}
[DataMember]
public string Age{get; set;}
[DataMember]
public string Weight{get; set;}
[DataMember]
public string Size{get; set;}
[DataMember]
public string Program{get; set;}
[DataMember]
public string ProgramAdv{get; set;}
[DataMember]
public string PastInfos{get; set;}
/**
Constructor for UserData
*/
public UserData(string firstName, string lastName, string age, string weight, string size, string hand, string beginner)
public UserData(string nickName, string mail, string age, string weight, string size, string hand, string pwd, string pgm, string pgmAdv, string pastinfos)
{
Id = Guid.NewGuid().ToString("N");
this.FirstName=firstName;
this.LastName=lastName;
this.NickNAme=nickName;
this.Mail=mail;
this.Age=age;
this.Weight=weight;
this.Size=size;
this.Hand=hand;
this.Beginner=beginner;
this.Program=pgm;
this.ProgramAdv=pgmAdv;
this.PastInfos=pastinfos;
this.EncryptedPwd=pwd;
}
public UserData(string id ,string firstName, string lastName, string age, string weight, string size, string hand, string beginner)
public UserData(string id, string nickName, string mail, string age, string weight, string size, string hand, string pwd, string pgm, string pgmAdv, string pastinfos)
{
this.Id = id;
this.FirstName = firstName;
this.LastName = lastName;
this.Age = age;
this.Weight = weight;
this.Size = size;
this.Hand = hand;
this.Beginner = beginner;
this.NickNAme=nickName;
this.Mail=mail;
this.Age=age;
this.Weight=weight;
this.Size=size;
this.Hand=hand;
this.Program=pgm;
this.ProgramAdv=pgmAdv;
this.PastInfos=pastinfos;
this.EncryptedPwd=pwd;
}
/**
Serialize a user into Xml
......
<?xml version="1.0" encoding="utf-8"?>
<UserData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">
<Age>57​</Age>
<Beginner>false</Beginner>
<FirstName>Juste​</FirstName>
<Age>17​</Age>
<NickName>Cerise</NickName>
<Mail>cerise@mail.fr</Mail>
<Hand>left​</Hand>
<Id>130c50f17b1242bb86fa0ca7aae9499d</Id>
<LastName>Leblanc​</LastName>
<EncryptedPwd>ooihujv</EncryptedPwd>
<Size>174​</Size>
<Weight>68​</Weight>
<Program>P1</Program>
<ProgramAdv>0</ProgramAdv>
<PastInfos>[]</PastInfos>
</UserData>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<UserData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">
<Age>21​</Age>
<Beginner>false​</Beginner>
<FirstName>Mael​</FirstName>
<Hand>right​</Hand>
<Age>17</Age>
<NickName>Michel</NickName>
<Mail>michel@mail.fr</Mail>
<Hand>left​</Hand>
<Id>33237bb9f04e4d938042927ff22a57fb</Id>
<LastName>Laurent​</LastName>
<Size>175​</Size>
<Weight>60​</Weight>
<EncryptedPwd>ooihujv</EncryptedPwd>
<Size>174​</Size>
<Weight>68​</Weight>
<Program>P2</Program>
<ProgramAdv>0</ProgramAdv>
<PastInfos>[]</PastInfos>
</UserData>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<UserData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/">
<Age>21​</Age>
<Beginner>false​</Beginner>
<FirstName>Baptiste​</FirstName>
<Hand>right</Hand>
<Age>17</Age>
<NickName>Tom</NickName>
<Mail>tom@mail.fr</Mail>
<Hand>left​</Hand>
<Id>e089926559e24b2d8045e4d67b4a38cc</Id>
<LastName>Broyer​</LastName>
<Size>183​</Size>
<Weight>72​</Weight>
<EncryptedPwd>ooihujv</EncryptedPwd>
<Size>174​</Size>
<Weight>68​</Weight>
<Program>P2</Program>
<ProgramAdv>0</ProgramAdv>
<PastInfos>[]</PastInfos>
</UserData>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment