예제 #1
0
        public void btnFind_Click(object sender, System.EventArgs e)
        {
            try
            {
                Nav1.Feedback.Text = String.Empty;
                UserM user = null;
                if (txtUserName.Text != null && !txtUserName.Text.Trim().Equals(String.Empty))
                {
                    user = UserM.LoadByUserName(txtUserName.Text.Trim());
                }
                else if (txtUniversityIdentifier.Text != null && !txtUniversityIdentifier.Text.Trim().Equals(String.Empty))
                {
                    user = UserM.LoadByUniversityID(txtUniversityIdentifier.Text.Trim());
                }
                else if (txtEMailAddress != null && !txtEMailAddress.Text.Trim().Equals(String.Empty))
                {
                    user = UserM.LoadByEmail(txtEMailAddress.Text.Trim());
                }

                if (user != null && user.IsValid)
                {
                    //Populate result
                    Response.Redirect("AddEditUser.aspx?CourseID=" + courseId + "&UserID=" + user.UserID, false);
                }
                else
                {
                    Nav1.Feedback.Text = SharedSupport.GetLocalizedString("AddEditUser_NoUserRecord") + Server.HtmlEncode(txtUserName.Text.ToString());
                    clearFields();
                }
            }
            catch (Exception ex)
            {
                Nav1.Feedback.Text = ex.Message.ToString();
                btnUpdate.Visible  = false;
            }
        }