예제 #1
0
        protected void btnProfessorRegister_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                lblMessage.Visible = true;
                lblMessage.Text    = "Password Does Not Match";
            }
            else
            {
                int    profID     = int.Parse(txtProfID.Text);
                string password   = txtPasswordProf.Text;
                string firstName  = txtEnterFNameProf.Text;
                string lastName   = txtEnterLNameProf.Text;
                string email      = txtEnterEmailProf.Text;
                string department = ddlDepartment.SelectedValue;
                string type       = "Professor";

                newUser               = new BlackboardSvc.User();
                newUser.userID        = profID;
                newUser.UserFirstName = firstName;
                newUser.userLastName  = lastName;
                newUser.Userpassword  = password;
                newUser.userEmail     = email;
                newUser.userType      = type;

                newProf = new BlackboardSvc.Professor();
                newProf.ProfDepartment = department;
                newProf.ProfId         = profID;

                if (pxy.AddNewUser(newUser) && pxy.AddNewProfessor(newProf))
                {
                    Session["check"] = 3;
                    lblMessage.Text  = "Professor Account Created";
                    Response.Redirect("ProfessorPage.aspx");
                }
                else
                {
                    lblMessage.Text = "Professor Account Not Created";
                }
            }
        }
예제 #2
0
 /// <remarks/>
 public void AddNewProfessorAsync(Professor newProf)
 {
     this.AddNewProfessorAsync(newProf, null);
 }