コード例 #1
0
    protected void loadPageInfo(int school_district_id)
    {
        qOrg_SchoolDistrict district = new qOrg_SchoolDistrict(school_district_id);

        litTitle.Text = "<h3>" + district.DistrictName + "</h3>";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            group_request_id = Convert.ToInt32(Request.QueryString["groupRequestID"]);

            if (!String.IsNullOrEmpty(Convert.ToString(group_request_id)))
            {
                qOrg_GroupRequests request = new qOrg_GroupRequests(group_request_id);

                populateSchools();

                lblTitle.Text = "Edit Group Request (ID: " + request.GroupRequestID + ")";

                lblRequestTimestamp.Text = Convert.ToString(request.Created);

                string advisor_info = string.Empty;
                advisor_info = "<span class=\"NormalBoldDarkGray\">Name:</span> " + request.AdvisorFirstName + " " + request.AdvisorLastName;
                advisor_info += "<br><br><span class=\"NormalBoldDarkGray\">Position:</span> " + request.AdvisorPosition;
                advisor_info += "<br><br><span class=\"NormalBoldDarkGray\">Other Position:</span> " + request.AdvisorPositionOther;
                advisor_info += "<br><br><span class=\"NormalBoldDarkGray\">Email:</span> " + request.AdvisorEmail;
                advisor_info += "<br><br><span class=\"NormalBoldDarkGray\">Phone:</span> " + request.AdvisorPhone;
                litAdvisorInfo.Text = advisor_info;

                string group_info = string.Empty;
                group_info = "<span class=\"NormalBoldDarkGray\">Name:</span> " + request.GroupShortName;
                qSoc_SpaceCategory category = new qSoc_SpaceCategory(Convert.ToInt32(request.SpaceCategoryID));
                group_info += "<br><br><span class=\"NormalBoldDarkGray\">Type:</span> " + category.CatgoryName;
                group_info += "<br><br><span class=\"NormalBoldDarkGray\">Other Type:</span> " + request.CategoryOther;
                group_info += "<br><br><span class=\"NormalBoldDarkGray\">Description:</span> " + request.GroupDescriptionOther;
                group_info += "<br><br><span class=\"NormalBoldDarkGray\">Why Join:</span> " + request.WhyJoin;
                group_info += "<br><br><span class=\"NormalBoldDarkGray\">How Many Members:</span> " + request.NumNumbers;
                group_info += "<br><br><span class=\"NormalBoldDarkGray\">When Founded:</span> " + request.WhenFounded;
                litGroupInfo.Text = group_info;

                string school_info = string.Empty;
                school_info += "<br><br><span class=\"NormalBoldDarkGray\">School:</span> " + request.OtherSchool;
                if (!String.IsNullOrEmpty(Convert.ToString(request.SchoolDistrictID)))
                {
                    int school_district_id = request.SchoolDistrictID;
                    qOrg_SchoolDistrict district = new qOrg_SchoolDistrict(school_district_id);
                    school_info += "<br><br><span class=\"NormalBoldDarkGray\">District:</span> " + district.DistrictName;
                }
                else
                {
                    school_info += "<br><br><span class=\"NormalBoldDarkGray\">District:</span> none";
                }
                school_info += "<br><br><span class=\"NormalBoldDarkGray\">Type:</span> " + request.SchoolType;
                school_info += "<br><br><span class=\"NormalBoldDarkGray\">Address:</span><blockquote><span class=\"Normal\"> " + request.OtherSchoolAddress1 + ", " + request.OtherSchoolAddress2 + "<br>" + request.OtherSchoolCity + ", " + request.OtherSchoolStateProvince + " " + request.OtherSchoolPostalCode + "</span></blockquote>";
                school_info += "<br><br><span class=\"NormalBoldDarkGray\">Phone:</span> " + request.OtherSchoolPhone;
                litSchoolInfo.Text = school_info;

                string principal_info = string.Empty;
                principal_info = "<span class=\"NormalBoldDarkGray\">Name:</span> " + request.PrincipalFirstName + " " + request.PrincipalLastName;
                principal_info += "<br><br><span class=\"NormalBoldDarkGray\">Position:</span> " + request.PrincipalRole;
                principal_info += "<br><br><span class=\"NormalBoldDarkGray\">Email:</span> " + request.PrincipalEmail;
                principal_info += "<br><br><span class=\"NormalBoldDarkGray\">Phone:</span> " + request.PrincipalPhone;
                litPrincipalInfo.Text = principal_info;

                txtAdvisorEmail.Text = request.AdvisorEmail;
                txtGroupName.Text = request.GroupShortName;
                txtPrincipalEmail.Text = request.PrincipalEmail;
                txtAdvisorNotes.Text = request.AdvisorNotes;
                txtGroupNotes.Text = request.GroupNotes;
                txtSchoolNotes.Text = request.SchoolNotes;
                txtPrincipalNotes.Text = request.PrincipalNotes;
                ddlStatus.SelectedValue = request.Status;
                if (!String.IsNullOrEmpty(Convert.ToString(request.SchoolID)))
                    if (request.SchoolID > 0)
                        ddlSchools.SelectedValue = Convert.ToString(request.SchoolID);
                    else
                    {
                        btnApproveRequest.Enabled = false;
                        lblApprovalInfo.Text = "<br><br><strong>*** WARNING: This request does NOT have a school associated with it yet. A school must be selected from the pull down in the School Info section below. ***</strong>";
                    }

                else
                {
                    btnApproveRequest.Enabled = false;
                    lblApprovalInfo.Text = "<br><br><strong>*** WARNING: This request does NOT have a school associated with it yet. A school must be selected from the pull down in the School Info section below. ***</strong>";
                }

                if (!String.IsNullOrEmpty(request.ApprovedBy))
                {
                    btnApproveRequest.Visible = true;
                    lblApprovalInfo.Text = "Approved by " + request.ApprovedBy + " and email last sent at " + request.WhenApproved;
                }
                else
                    btnApproveRequest.Visible = true;

                if (request.Status == "Completed")
                    lblPrincipalApprval.Text = "Request APPROVED by " + request.PrincipalInitials + " at " + request.PrincipalWhenApproved;
                else if (request.Status == "Rejected-Principal")
                    lblPrincipalApprval.Text = "Request DENIED by " + request.PrincipalInitials + " at " + request.PrincipalWhenApproved;

            }
            else
            {
                lblTitle.Text = "A Problem Has Occurred: Please go back and try again";
            }
        }
    }