private void InitData() { this.ddlAirlines.DataSource = from item in FoundationService.Airlines select new { ShortName = item.Code + "-" + item.ShortName, Code = item.Code }; ddlAirlines.DataTextField = "ShortName"; ddlAirlines.DataValueField = "Code"; this.ddlAirlines.DataBind(); ddlAirlines.Items.Insert(0, new ListItem("-请选择-", "")); //AdultAgentCompany.InitCompanies(CompanyService.GetCompanies( CompanyType.Provider )); AdultAgentCompany.SetCompanyType(CompanyType.Provider); ddlProvince.DataSource = from item in FoundationService.Provinces select new { Name = item.Name, Code = item.Code }; ddlProvince.DataTextField = "Name"; ddlProvince.DataValueField = "Code"; ddlProvince.DataBind(); ddlProvince.Items.Insert(0, new ListItem("-请选择-", "")); }
protected void Page_Load(object sender, EventArgs e) { RegisterOEMSkins("form.css"); RegisterOEMSkins("page.css"); if (!IsPostBack) { InitData(); string ariline = Request.QueryString["airline"]; string provinceCode = Request.QueryString["ProvinceCode"]; if (!string.IsNullOrWhiteSpace(ariline) && !string.IsNullOrWhiteSpace(provinceCode)) { this.lblAddOrUpdate.Text = "修改"; var defaultPolicy = PolicyManageService.GetBargainDefaultPolicy(ariline, provinceCode); ddlAirlines.SelectedValue = defaultPolicy.Airline; ddlAirlines.Enabled = false; ddlProvince.Enabled = false; this.ddlProvince.SelectedValue = defaultPolicy.ProvinceCode; AdultAgentCompany.SetCompanyName(defaultPolicy.AdultProviderId); AdultAgentCompany.SetCompanyType(CompanyType.Provider); txtAdult.Text = double.Parse((defaultPolicy.AdultCommission * 100).ToString()).ToString(); } } }