Пример #1
0
        protected void FillCombos(DropDownList ddl, string sComboName, string sDefault)
        {
            switch (sComboName)
            {
            case "load":
                var loadList = Admin.GetLoadListWithActiveDueDate();
                ddl.Items.Clear();
                ddl.DataSource     = loadList;
                ddl.DataValueField = "LoadID";
                ddl.DataTextField  = "DataSource";

                ddl.DataBind();

                if (ddl.Items.Count == 0)
                {
                    lblError.Text = DisplayMessage("There are no loads with active due date", false);
                }
                else
                {
                    if (sDefault != "")
                    {
                        ddl.Items.Insert(0, sDefault);
                    }
                }
                break;

            default:
                break;
            }
        }
Пример #2
0
        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;
            }
        }