Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void populateDashboardButtons()
- {
- //Connect to MongoDB, Grab Buttons
- MongoDBConnection mongoConnection = new MongoDBConnection();
- var dashboardButtons = mongoConnection.ReadButtons("USERID");
- //Loop Through each button in list
- foreach ( var button in dashboardButtons )
- {
- //add buttons to form (dashboard)
- if (flowLayoutDasboardButtons.Controls.Count < 0)
- {
- flowLayoutDasboardButtons.Controls.Clear();
- }
- else
- {
- button.Click += new EventHandler(do_somehting);
- flowLayoutDasboardButtons.Controls.Add(button);
- //button.Click += new EventHandler(do_somehting);
- }
- }
- }
- void do_somehting(object sender, EventArgs e)
- {
- Debug.WriteLine("Holy Shit it started to Execute");
- var btn = sender as Button;
- if (btn.Text == "This Button")
- {
- //Do This Code Now
- Debug.WriteLine("Holy Shit it worked");
- }
- else
- {
- Debug.WriteLine("Holy Shit Code Block Executred");
- }
- //Delete This code (testing only)
- //mongoConnection.createPermission("Group A", "RocketButtons", "Create");
- //Debug.WriteLine(GetTime.GetNetworkTime().ToString());
- }
Advertisement
Add Comment
Please, Sign In to add comment