public void GetCBS() { this.costAccountList = CostAccounting.GetByD(); CostAccounting item = CostAccounting.Create(" ", " ", " ", " ", " "); this.costAccountList.Insert(0, item); }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { System.Collections.Generic.List <CostAccounting> byD = CostAccounting.GetByD(); this.ddlCBS.DataSource = byD; this.ddlCBS.DataTextField = "Name"; this.ddlCBS.DataValueField = "Code"; this.ddlCBS.DataBind(); this.ddlCBS.Items.Insert(0, new ListItem("--请选择直接成本--", "")); if (string.Compare(this.action, "Add", true) == 0) { this.InitAdd(); return; } if (string.Compare(this.action, "Update", true) == 0) { this.InitUpdate(); return; } if (string.Compare(this.action, "Query", true) == 0) { this.InitUpdate(); } } }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { System.Collections.Generic.List <CostAccounting> byD = CostAccounting.GetByD(); this.ViewState["CBSList"] = byD; this.DataBindContractType(); } }