Пример #1
0
 protected void LoginButton_Click(object sender, EventArgs e)
 {
     ELearn.User usr = ELearn.User.loginUser(userName_login.Text, passwordLogin.Text);
     if (usr != null)
     {
         Session["user"] = usr;
         if (usr is Student)
         {
             Session["userType"] = "student";
         }
         else if (usr is Staff)
         {
             Session["userType"] = "staff";
         }
         else if (usr is Teacher)
         {
             Session["userType"] = "teacher";
         }
         Response.Redirect("home.aspx");
     }
     else
     {
         ErrorLogin.Visible = true;
     }
 }
Пример #2
0
 public Message(int messageID, string subject, string body, DateTime time, ELearn.User sender, ELearn.User reciever)
 {
     this.messageID = messageID;
     this.subject   = subject;
     this.body      = body;
     this.time      = time;
     this.senderID  = sender.userID;
     this.recieverIDs.Add(reciever.userID);
 }