示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Set Page Heading
        var lbl = (Label)this.Master.FindControl("lblPageHeading");

        lbl.Text = "Camper Summary";

        _strFedId = Session["FedId"].ToString();
        string strMaxAmt = ConfigurationManager.AppSettings["MaxAmt"];

        rgvAmt.ErrorMessage = "Amount can not be greater than " + strMaxAmt;
        rgvAmt.MaximumValue = strMaxAmt;

        var strRole = (string)Session["RoleID"];

        CamperApplication objCamperApplication = new CamperApplication();

        if (Session["FJCID"] != null)
        {
            isPaymentDone = objCamperApplication.IsPaymentDone((string)Session["FJCID"]).ToString();
        }

        //Only Camp Director can change no. of Days, but he/she cannot change the camp
        if (strRole == strCampDir)
        {
            //Disable camp combo for Camp Director
            ddlCamp.Enabled = false;
            btnCancelChangeRequest.Visible = ddlAdjustmentType.Visible = btnViewCancelChangeRequest.Visible = false;
        }
        //Approver cannot change the camp; but Only Approver can change the Amt

        //Added by Ram (18 Feb 2010) Change/Cancel Request
        //Fed Admin can raise request for cancel application and change camp, federation & session
        if (strRole == strFedAdmin)
        {
            //txtAmt.Enabled = true;
            //ddlCampYear.Enabled = true;
        }
        else if (strRole == strApprover)
        {
            ddlCamp.Enabled     = false;
            txtAmt.Enabled      = true;
            ddlCampYear.Enabled = true;
        }

        if (!IsPostBack)
        {
            DataSet dsCamprDetails = GetValues();

            // 2013-11-12 After 2013, Camps can contact campers directly
            if (Convert.ToInt32(dsCamprDetails.Tables[0].Rows[0]["CampYearID"]) >= 6)
            {
                lblPermissionNA.Visible = true;
            }
            else
            {
                lblPermissionMsgNo.Visible  = true;
                lblPermissionMsgYes.Visible = false;
                if (dsCamprDetails.Tables[0].Rows[0]["PermissionToContact"] != DBNull.Value)
                {
                    if (Convert.ToBoolean(dsCamprDetails.Tables[0].Rows[0]["PermissionToContact"]))
                    {
                        lblPermissionMsgNo.Visible  = false;
                        lblPermissionMsgYes.Visible = true;
                    }
                }
            }

            int iCurrentStatus = Convert.ToInt32(dsCamprDetails.Tables[0].Rows[0]["StatusID"]);

            if (dsCamprDetails.Tables[0].Rows[0]["FedID"] != DBNull.Value)
            {
                iFedID = Convert.ToInt32(dsCamprDetails.Tables[0].Rows[0]["FedID"]);
            }

            string strCurrentStatus = dsCamprDetails.Tables[0].Rows[0]["Status"].ToString();

            PopulateDropdowns(iCurrentStatus, strCurrentStatus, iFedID);

            DataSet           dsCampyear    = new DataSet();
            CamperApplication objCamperAppl = new CamperApplication();
            DataRow           dr;
            dsCampyear = objCamperAppl.CheckSecondQuestion(iFedID);
            int iCount = dsCampyear.Tables[0].Rows.Count;

            if (iCount > 0)
            {
                dr = dsCampyear.Tables[0].Rows[0];

                hdnMaxTimeInCamp4Fed.Value = dr["question"].ToString();
            }
            SetValues(dsCamprDetails);

            if (_strFedId == "0")
            {
                lnkFedQuestionnaire.Enabled = false;
            }


            if (strRole == strCampDir)
            {
                lnkFedQuestionnaire.Enabled = true;
            }
            if (lnkFedQuestionnaire.Enabled)
            {
                lnkFedQuestionnaire.Enabled = Convert.ToBoolean(dsCamprDetails.Tables[0].Rows[0]["CurrentYear"].ToString());
            }
            //added by sreevani to enable view application link of 2011 applications also
            if (strRole == strFJCAdmin)
            {
                if (dsCamprDetails.Tables[0].Rows[0]["campyearid"].ToString() == "3")
                {
                    lnkFedQuestionnaire.Enabled = true;
                }
            }
        }

        EnableChangeCancelRequestButton(strRole);


        PopulateChangeHistory();
        ddlStatus.Attributes.Add("onChange", "javascript:ValidateDays(" + strRole + "," + ddlStatus.SelectedValue + ");");
        btnUpdate.Attributes.Add("onClick", "javascript:return ConfirmUpdateAmt(" + strRole + "," + strApprover + "," + hdnMaxTimeInCamp4Fed.Value + ");");
    }