00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004 using System.Security.Cryptography;
00005 using Shared;
00006
00007 namespace Server
00008 {
00012 public class Person
00013 {
00014 private string department;
00015 private string name;
00016 private string username;
00017 private string password;
00018 private bool moderator = false;
00019 private string email;
00020
00029 public Person(string username, string password, string name, string department, string email)
00030 {
00031 this.department = department;
00032 this.name = name;
00033 this.password = password;
00034 this.username = username;
00035 this.email = email;
00036 }
00037
00041 public bool Moderator
00042 {
00043 get { return moderator; }
00044 set { moderator = value; }
00045 }
00046
00050 public string Name
00051 {
00052 get { return name; }
00053 set { name = value; }
00054 }
00055
00059 public string Department
00060 {
00061 get { return department; }
00062 set { department = value; }
00063 }
00064
00068 public string UserName
00069 {
00070 get { return username; }
00071 set { username = value; }
00072 }
00073
00077 public string Password
00078 {
00079 get { return password; }
00080 set { password = value; }
00081 }
00082
00086 public string Email
00087 {
00088 get { return email; }
00089 set { email = value; }
00090 }
00091
00095 public PersonInfo Info
00096 {
00097 get
00098 {
00099 return new PersonInfo(username, "", name, department, email, moderator);
00100 }
00101 }
00102
00108 public static Person FromInfo(PersonInfo pi)
00109 {
00110 Person p = new Person(pi.username, pi.password, pi.name, pi.department, pi.email);
00111 p.moderator = pi.moderator;
00112 return p;
00113 }
00114 }
00115 }