Esempio n. 1
0
        public static DropDownList FillddlMainMenu(DropDownList ddl, int EVENT, int ID, string CODE)
        {
            ddl.Items.Clear();
            var dt = BL_MainMenu.GetMainMenu(EVENT, ID, CODE);

            if (dt.Rows.Count > 0)
            {
                ddl.DataSource     = dt;
                ddl.DataValueField = "MainMenuID";
                ddl.DataTextField  = "MenuName";
                ddl.DataBind();
                ddl.Items.Insert(0, new ListItem("Select", "0", true));
            }
            return(ddl);
        }
Esempio n. 2
0
        private void FillgvMenu()
        {
            var dt = new DataTable();

            dt = BL_MainMenu.GetMainMenu(1, 0, "");
            if (dt.Rows.Count > 0)
            {
                gvMenu.DataSource = dt;
                gvMenu.DataBind();
            }
            else
            {
                gvMenu.DataSource = new string[] { };
                gvMenu.DataBind();
            }
        }