protected void FillCombos(string sComboName) { var iID = 0; ddlUsers.Enabled = true; switch (sComboName) { case "user_new": // add new NCR user var ds = UsersBO.GetAllNCRUsers(); ddlUsers.Items.Clear(); ddlUsers.DataSource = ds; ddlUsers.DataTextField = ds.Tables[0].Columns["FullName"].ToString(); ddlUsers.DataValueField = ds.Tables[0].Columns["Email"].ToString(); ddlUsers.DataBind(); break; case "user_old": // edit existing ULO User var users = UsersBO.GetAllULOUsers(); //active and inactive ddlUsers.Items.Clear(); ddlUsers.DataSource = users; ddlUsers.DataTextField = "FullName"; ddlUsers.DataValueField = "Email"; ddlUsers.DataBind(); break; case "user_new2": // add new non-NCR user manually ddlUsers.Enabled = false; break; case "role": mgUserRole.FillMultiGrid("spGetAllUserRolesByApp", "RoleCode", "@app", "ULO", false, out iID); // only for ULO // mgUserRole.FillMultiGrid("spGetAllUserRoles", "RoleCode", "", "", false, out iID); // For ULO and FundStatus apps //spGetAllUserRolesByApp mgUserRole.ShowHeader = false; mgUserRole.MultiChoice = true; break; case "org": var orgs = Org.GetAllOrganizations(); ddlOrg.Items.Clear(); ddlOrg.DataSource = orgs; ddlOrg.DataTextField = "OrgAndOrgCode"; ddlOrg.DataValueField = "Organization"; ddlOrg.DataBind(); break; default: break; } }
protected void FillCombos(DropDownList ddl, string sComboName, string sDefault) { //int iID = 0; switch (sComboName) { case "load": var loadList = Admin.GetLoadListWithActiveDueDate(); ddl.Items.Clear(); ddl.DataSource = loadList; ddl.DataValueField = "LoadID"; ddl.DataTextField = "LoadDesc"; ddl.DataBind(); if (ddl.Items.Count == 0) { lblDueDateMessage.Text = DisplayMessage(lblDueDateMessage, "There are no loads with active due date", false); //btnReset.Enabled = false; // btnReset.ToolTip = "button disabled"; btnSendDueDateReminder.Enabled = false; //Send Reminder" OnClick="btnSendDueDateReminder_Click btnSendDueDateReminder.ToolTip = "button disabled"; } else { if (sDefault != "") { ddl.Items.Insert(0, sDefault); //btnReset.Enabled = true; btnSendDueDateReminder.Enabled = true; } } break; case "users": var users = Users.GetAllULOUsers(); ddlULOUsers.Items.Clear(); ddlULOUsers.DataSource = users; ddlULOUsers.DataTextField = "FullName"; ddlULOUsers.DataValueField = "Email"; ddlULOUsers.DataBind(); ddlULOUsers.Items.Insert(0, "- select -"); break; default: break; } }