예제 #1
0
        public static Control Create()
        {
            TreeStyleMenu result = new TreeStyleMenu();

            CreateMainMenu cm   = new CreateMainMenu();
            DataSet        data = cm.GetData();

            result.SetMenu(data.Tables[0]);
            return(result);
        }
예제 #2
0
        private void m_treeViewOne_AfterSelect(object sender, TreeViewEventArgs e)
        {
            m_treeViewTwo.Nodes.Clear();

            if (e.Node == null)
            {
                return;
            }

            TagData tag = e.Node.Tag as TagData;

            string menuLevel = tag["MenuLevel"].ToString();
            string filter    = string.Format("Len(MenuLevel) > {0} and SubString(MenuLevel, 1, {1}) = {2} and MenuCaption <> '-' ",
                                             menuLevel.Length, menuLevel.Length, menuLevel);

            DataRow[]      rows           = m_mainMenuTable.Select(filter, "MenuLevel");
            CreateMainMenu createMainMenu = new CreateMainMenu();
            DataSet        data           = new DataSet();
            DataTable      table          = new DataTable();

            data.Tables.Add(table);
            table.Columns.Add("MenuCaption");
            table.Columns.Add("MenuLevel");
            table.Columns.Add("ActionId");
            table.Columns.Add("AssemblyName");
            table.Columns.Add("ClassName");
            table.Columns.Add("MethodName");
            table.Columns.Add("ObjId");
            foreach (DataRow row in rows)
            {
                table.Rows.Add(new object[] { row["MenuCaption"], row["MenuLevel"], row["ActionId"],
                                              row["AssemblyName"], row["ClassName"], row["MethodName"], row["ObjId"] });
            }
            createMainMenu.Execute(data, m_treeViewTwo);

            m_treeViewTwo.ExpandAll();
        }
예제 #3
0
 public MainWindow(string Login, string Password)
 {
     InitializeComponent();
     sLogin    = Login;
     sPassword = Password;
     CreateMainMenu.CreateRadioButtons(stackPanelMainMenu, this);
     _iYear           = DateTime.Now.Year;
     _iSemestr        = GetSemestr(DateTime.Now.Month);
     CurrentUser.Text = Login;
     if (Session.Access == Session.ACCESS.Superadmin)
     {
         listViewRating.ItemsSource   = RWM.LoadRating(Queries.GetRatingTotal(_iYear, _iSemestr));
         cbItemTotalRating.IsSelected = true;
         gridRating.Visibility        = Visibility.Visible;
     }
     else
     {
         WindowHeader.Children.Remove(Settings);
         WindowHeader.Children.Remove(Export);
         lViewCoinsList.ItemsSource   = CLVM.LoadCoinsList(Queries.GetViewCoinsList(sLogin, _iYear, _iSemestr));
         gridCoinsImages.DataContext  = CCVM.LoadCoinsCount(Queries.GetTCoinsCount(sLogin, _iYear, _iSemestr));
         gridTeachersCoins.Visibility = Visibility.Visible;
     }
 }