private void LoadMenu() { Myuser = new UserHandling(Program.AccountStatic.LoggingAsLocal); DataTable tb = Myuser.GetMenuObjectList(0,0); if (tb != null) { int mcy=0; foreach (DataRow r in tb.Rows) { TreeNode trn = new TreeNode(); trn.Name = r["ObgfileName"].ToString(); trn.Text = r["ObgDisplayName"].ToString(); int MainobgID = int.Parse (r["SysID"].ToString ()); TreeMenu.Nodes.Add(trn); TreeMenu.Nodes[mcy].ImageIndex = int.Parse(r["IconID"].ToString()); mcy++; DataTable tb1 = Myuser.GetMenuObjectList(MainobgID, 1); // tb1 = Myuser.GetMenuObjectList(MainobgID, 1); if (tb1 != null) { int Nount1 = TreeMenu.Nodes.Count - 1; int Secline = 0; foreach (DataRow r1 in tb1.Rows ) { TreeNode trn2 = new TreeNode(); trn2.Name = r1["ObgfileName"].ToString(); trn2.Text = r1["ObgDisplayName"].ToString(); MainobgID = int.Parse (r1["SysID"].ToString ()); TreeMenu.Nodes[Nount1].Nodes.Add(trn2); TreeMenu.Nodes[Nount1].Nodes[Secline].ImageIndex = int.Parse(r1["IconID"].ToString()); int MainobgID1 = int.Parse(r["SysID"].ToString()); Secline++; DataTable tb2; // Myuser.GetMenuObjectList(0, 0); tb2 = Myuser.GetMenuObjectList(MainobgID, 2); int Nount2 = TreeMenu.Nodes[Nount1].Nodes.Count - 1; if (tb2 != null) { int imx1 = 0; foreach (DataRow r2 in tb2.Rows) { TreeNode trn3 = new TreeNode(); trn3.Name = r2["ObgfileName"].ToString(); trn3.Text = r2["ObgDisplayName"].ToString(); MainobgID = int.Parse(r2["SysID"].ToString()); TreeMenu.Nodes[Nount1].Nodes[Nount2].Nodes.Add(trn3); TreeMenu.Nodes[Nount1].Nodes[Nount2].Nodes[imx1].ImageIndex = int.Parse(r2["IconID"].ToString()); imx1++; } } } } } } }
private void rbtLocal_CheckedChanged(object sender, EventArgs e) { try { WrireConf("local"); Program.AccountStatic.LoggingAsLocal = true; MyUser = new UserHandling(Program.AccountStatic.LoggingAsLocal); MyGeneral = new CommonOperations(Program.AccountStatic.LoggingAsLocal); MyGeneral.LoadCompany(cmbCompanyName); } catch (Exception ex) { } }