Exemplo n.º 1
0
        protected void LoadAgency(int siteLocation)
        {
            var cAgency = new CAgency();

            ddlAgency.DataSource     = cAgency.GetAgency(siteLocation);
            ddlAgency.DataTextField  = "Name";
            ddlAgency.DataValueField = "Value";
            ddlAgency.DataBind();
            ddlAgency.Items.Insert(0, new RadComboBoxItem("-None(Direct Student)-", "0"));
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Id = Convert.ToInt32(Request["Id"]);

            if (!IsPostBack)
            {
                var cAgency = new CAgency();
                ddlAgencyName.DataSource     = cAgency.GetAgency(CurrentSiteLocationId);
                ddlAgencyName.DataTextField  = "Name";
                ddlAgencyName.DataValueField = "Value";
                ddlAgencyName.Filter         = (RadComboBoxFilter)Convert.ToInt32(1);
                ddlAgencyName.Items.Insert(0, new RadComboBoxItem("Type a Agency Name"));
                ddlAgencyName.DataBind();

                //LoadSite();

                // new
                if (Request["type"] == "0")
                {
                    GetSiteLocation(false);
                }
                // modify
                else
                {
                    GetSiteLocation(true);

                    var cP = new CScholarship().Get(Id);

                    foreach (RadComboBoxItem item in ddlAgencyName.Items)
                    {
                        if (item.Value == cP.AgencyId.ToString())
                        {
                            item.Selected = true;
                            break;
                        }
                    }

                    if (cP.Amount == 0)
                    {
                        rbWeeks.Checked = true;
                        tbWeeks.Text    = cP.Weeks.ToString();
                    }
                    else
                    {
                        rbAmount.Checked = true;
                        RadNumericTextBoxAmount.Value = (double)cP.Amount;
                    }
                    tbExpireDate.SelectedDate = cP.ExpireDate;

                    foreach (RadComboBoxItem item in RadComboBoxMinimum.Items)
                    {
                        if (item.Value == cP.MininumRegistrationWeeks.ToString())
                        {
                            item.Selected = true;
                            break;
                        }
                    }

                    tbComment.Text = cP.Memo;
                }
            }
        }