- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
case enter:
						{
							TreeNodeBackColorChange();
							if (Connection.Login == "" || Connection.Login == null)
							{
								new fmlogin().ShowDialog();
								try
								{
									if (Connection.Login != "")
										foreach (TreeNode item in tvMenuList.Nodes)
										{
											if (item.Name == lk)
											{
												item.NodeFont = new Font("arial", 10, FontStyle.Bold);
												item.Text += " (" + Connection.Login + ")";
											}
										}
								}
								catch { }
							}
							else MessageBox.Show("Вы уже авторизованы!", "Вход в личный кабинет", MessageBoxButtons.OK, MessageBoxIcon.Warning);
							break;
						}
					case leave:
						{
							TreeNodeBackColorChange();
							if (Connection.Login != "" && Connection.Login != null)
							{
								if (MessageBox.Show("Вы уверены, что хотите выйти?", "Выход", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
								{
									Connection.Login = "";
									Connection.Pass = "";
									try
									{
										foreach (TreeNode item in tvMenuList.Nodes)
										{
											foreach (TreeNode item2 in item.Nodes)
											{
												foreach (TreeNode item3 in item2.Nodes)
												{
													if (item3.Name == lk)
													{
														item.NodeFont = tvMenuList.Font;
														item3.Text = "Личный кабинет";
													}
												}
												if (item2.Name == lk)
												{
													item.NodeFont = tvMenuList.Font;
													item2.Text = "Личный кабинет";
												}
											}
											if (item.Name == lk)
											{
												item.NodeFont = tvMenuList.Font;
												item.Text = "Личный кабинет";
											}
										}
									}
									catch { }
									MessageBox.Show("Выход произведен успешно!", "Выход", MessageBoxButtons.OK, MessageBoxIcon.Information);
								}
							}
							else MessageBox.Show("Вы не авторизованы!", "Выход из личного кабинета", MessageBoxButtons.OK, MessageBoxIcon.Warning);
							break;
						}