private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { toolStrip1.Visible = false; if (e.Node.GetType().Name == "NodesCategory") { tabControl1.SelectedIndex = 1; } if (e.Node.GetType().Name == "NodeCategory") { tabControl1.SelectedIndex = 0; NodeCategory node = (NodeCategory)e.Node; try { PopulateListView(new DirectoryInfo(node.getDirectory())); } catch (Exception exp) { MessageBox.Show("Error in category " + exp.Message); } FillGuiCategory(node); currentImageListView = imageListView1; toolStrip1.Visible = true; } if (e.Node.GetType().Name == "NodeUser") { buttonPrint.Visible = false; buttonCash.Visible = true; tabControl1.SelectedIndex = 2; NodeUser node = (NodeUser)e.Node; node.refresh(); PopulateListViewCustomer(SHOWPICTURE.ALL); FillGuiCustomer(node); currentImageListView = imageListView2; toolStrip1.Visible = true; } if (e.Node.GetType().Name == "NodesUser") { tabControl1.SelectedIndex = 3; // Blanck } if (e.Node.GetType().Name == "NodesPhotographer") { tabControl1.SelectedIndex = 4; } if (e.Node.GetType().Name == "NodePhotographer") { tabControl1.SelectedIndex = 5; NodePhotographer node = (NodePhotographer) e.Node; FillInfoPhotoGraphe(node); } if (e.Node.GetType().Name == "NodesInfo") { tabControl1.SelectedIndex = 6; } if (e.Node.GetType().Name == "NodeInfo") { NodeInfo node = (NodeInfo)e.Node; FillGuiInfo(node); tabControl1.SelectedIndex = 7; // Blanck } if (e.Node.GetType().Name == "NodeConfig") { NodeConfig node = (NodeConfig)e.Node; FillGuiConfig(node); tabControl1.SelectedIndex = 8; } if (e.Node.GetType().Name == "NodePrice") { VerySimpleInputDialog login = new VerySimpleInputDialog("Please Enter Password"); if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (login.UserInput == "maurice") { NodePrice node = (NodePrice)e.Node; FillGuiPrice(node); tabControl1.SelectedIndex = 9; } else { MessageBox.Show("Bad Password"); } } } //@"C:\Users\c\Pictures")); //if (e.Node.Tag == null) return; //KeyValuePair<DirectoryInfo, bool> ktag = (KeyValuePair<DirectoryInfo, bool>)e.Node.Tag; //PopulateListView(ktag.Key); }
private void labelPassword_DoubleClick(object sender, EventArgs e) { if (treeView1.SelectedNode != null) { NodeUser nu = (NodeUser)treeView1.SelectedNode; VerySimpleInputDialog passChange = new VerySimpleInputDialog("Change the password"); passChange.UserInput= nu.Password.ToString(); if (passChange.ShowDialog() == System.Windows.Forms.DialogResult.OK) { try { //int newPass = int.Parse(passChange.UserInput); if (passChange.UserInput.Length > 0) { nu.Password = passChange.UserInput; labelPassword.Text = nu.Password; } } catch(Exception exp) { MessageBox.Show("Error " + exp.Message); } } } }