コード例 #1
0
 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("-请选择-", ""));
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     RegisterOEMSkins("form.css");
     RegisterOEMSkins("page.css");
     if (!IsPostBack)
     {
         InitData();
         string ariline = Request.QueryString["airline"];
         if (!string.IsNullOrWhiteSpace(ariline))
         {
             this.lblAddOrUpdate.Text = "修改";
             var defaultPolicy = PolicyManageService.GetNormalDefaultPolicy(ariline);
             ddlAirlines.SelectedValue = defaultPolicy.Airline;
             ddlAirlines.Enabled       = false;
             AdultAgentCompany.SetCompanyName(defaultPolicy.AdultProviderId);
             ChildAgentCompany.SetCompanyName(defaultPolicy.ChildProviderId);
             txtAdult.Text = double.Parse((defaultPolicy.AdultCommission * 100).ToString()).ToString();
             txtChild.Text = double.Parse((defaultPolicy.ChildCommission * 100).ToString()).ToString();
         }
     }
 }