Example #1
0
        private void frm_rolemenu_Load(object sender, EventArgs e)
        {
            IsysService service = sysService.GetService();
            var         data    = service.GetAllMenuByRoleId(roleID);

            foreach (var m in data.OrderBy(p => p.MENUCODE))
            {
                CheckBox cb = new CheckBox();
                cb.Tag     = m.ID;
                cb.Text    = string.Format("[{0}]{1}", m.MENUCODE, m.MENUNAME);
                cb.Checked = (m.FLG == "0" ? true : false);
                cb.Width   = 160;
                if (m.MENUCODE == "123")
                {
                    cb.Enabled = false;
                    cb.Checked = true;
                }

                pnl.Controls.Add(cb);
            }
        }