示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {            // Only work when the page is initialized
            if (!IsPostBack)
            {
                if (Session["username"] == null)
                {
                    Response.Redirect("Default.aspx");
                }

                lblLoggedInUser.Text = "Welcome, " + Session["username"];

                lblEditReportError.Visible  = false;
                lblEditReportError.CssClass = "alert alert-danger small font-weight-bold text-center";
                string reportId = Request.QueryString["id"];


                PlayerReport player  = ConnectionClass.DisplayPlayerReport(reportId);
                RecruitClass recruit = ConnectionClass.DisplayRecruit(player.RecruitId);

                //pollute control with recruit information
                lblRecruitIDData.Text         = player.RecruitId.ToString();
                lblFirstNameData.Text         = recruit.FirstName;
                lblLastNameData.Text          = recruit.LastName;
                dropdownSkating.SelectedValue = player.Skating.ToString();
                dropdownIndividualOffesiveSkills.SelectedValue  = player.IndividualOffensiveSkills.ToString();
                dropdownIndividualDefensiveSkills.SelectedValue = player.IndividualDefensiveSkills.ToString();
                dropdownOffensiveTeamPlay.SelectedValue         = player.OffensiveTeamPlay.ToString();
                dropdownDefensiveTeamPlay.SelectedValue         = player.DefensiveTeamPlay.ToString();
                dropdownHockeySense.SelectedValue    = player.HockeySense.ToString();
                dropdownStrengthPower.SelectedValue  = player.StrengthPower.ToString();
                dropdownWorkEthic.SelectedValue      = player.WorkEthic.ToString();
                dropdownOverallRanking.SelectedValue = player.OverallRanking.ToString();
                txtNotes.Text = player.Notes;
            }
        }
示例#2
0
        protected void BtnCancel_Click(object sender, EventArgs e)
        {
            PlayerReport player = ConnectionClass.DisplayPlayerReport(Request.QueryString["id"]);
            string       url    = "ViewRecruit.aspx?id=" + player.RecruitId;

            Response.Redirect(url);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // get recruitId from url param
            string reportId = Request.QueryString["id"];

            // check username, reportId and accountType valid
            if (Session["username"] == null || String.IsNullOrEmpty(reportId))
            {
                Response.Redirect("Recruits.aspx");
            }

            lblLoggedInUser.Text = "Welcome, " + Session["username"];

            PlayerReport player  = ConnectionClass.DisplayPlayerReport(reportId);
            RecruitClass recruit = ConnectionClass.DisplayRecruit(player.RecruitId);

            lblRecruitIDData.Text = player.RecruitId.ToString();
            lblFirstNameData.Text = recruit.FirstName;
            lblLastNameData.Text  = recruit.LastName;
            lblSkatingData.Text   = player.Skating.ToString();
            lblIndividualOffesiveSkillsData.Text  = player.IndividualOffensiveSkills.ToString();
            lblIndividualDefensiveSkillsData.Text = player.IndividualDefensiveSkills.ToString();
            lblOffensiveTeamPlayData.Text         = player.OffensiveTeamPlay.ToString();
            lblDefensiveTeamPlay.Text             = player.DefensiveTeamPlay.ToString();
            lblHockeySenseData.Text    = player.HockeySense.ToString();
            lblStrengthPowerData.Text  = player.StrengthPower.ToString();
            lblWorkEthicData.Text      = player.WorkEthic.ToString();
            lblOverallRankingData.Text = player.OverallRanking.ToString();
            lblNotesData.Text          = player.Notes;
            lblCreateDateData.Text     = player.ScoutingReportDate.ToShortDateString() + " " + player.ScoutingReportDate.ToShortTimeString();
        }