private void BindFinancialPeriod() { DropDownListFinancialPeriod.DataSource = FinancialPeriod.GetFinancialPeriodList(Account.GetAccountByUserName(Page.User.Identity.Name.ToString()).CompanyId); DropDownListFinancialPeriod.DataTextField = "Description"; DropDownListFinancialPeriod.DataValueField = "FinancialPeriodId"; DropDownListFinancialPeriod.DataBind(); if (DropDownListFinancialPeriod.Items.Count > 1) { DropDownListFinancialPeriod.Items.Insert(0, new ListItem("Please select", "0")); } }
private void BindFinancialPeriod() { DropDownListFinancialPeriod.DataSource = FinancialPeriod.GetFinancialPeriodList(Account.GetAccountByUserName(Page.User.Identity.Name.ToString()).CompanyId); DropDownListFinancialPeriod.DataTextField = "Description"; DropDownListFinancialPeriod.DataValueField = "FinancialPeriodId"; DropDownListFinancialPeriod.DataBind(); //if (DropDownListFinancialPeriod.Items.Count > 1) //{ // DropDownListFinancialPeriod.Items.Insert(0, new ListItem("Please select", "0")); //} //else //{ this.financialPeriodId = Convert.ToInt32(DropDownListFinancialPeriod.SelectedValue); //} }