Exemplo n.º 1
0
		//-------------------------------------------------------------------------------------
		private void btnAddUsers_Click(object sender, EventArgs e)
		{
			try
			{
				PList<SecurityItem> list = new PList<SecurityItem>();
				foreach(Person u in users)
				{
					bool need = true;
					foreach(ACEitem i in ACL)
						if(i.ACE.SID ==  u.OID)
						{
							need = false;
							break;
						}
					if(need)
						list.Add(SecurityItem.FromUser(u));
				}

				SimModalMultiChoiceBox frm = new SimModalMultiChoiceBox();
				frm.Parent = PanelBack;
				frm.DialogClosed += new DialogClosedEventHandler(SimModalMultiChoiceBox_DialogClosed);
				frm.Tag = 2;
				frm.CaptionImage = global::Sim.AdminForms.Properties.Resources.User;
				frm.CaptionText = "Добавление пользователей";
				frm.VariantsCaption = "Доступные пользователи";
				frm.ChoicesCaption = "Выбранные пользователи";
				frm.Variants = new ListBinder(list);
				frm.Show();
			}
			catch(Exception Err)
			{
				Sim.Controls.ModalErrorBox.Show(Err, PanelBack);
			}
		}
Exemplo n.º 2
0
		//-------------------------------------------------------------------------------------
		/// <summary>
		/// Добавление пользователей в группу
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void btnChildUserAdd_Click(object sender, EventArgs e)
		{
			try
			{
				if(fdgvGroups.SelectedRows.Count == 0)
					return;
				SecurityGroup cur = (SecurityGroup)((IKeyedValue)fdgvGroups.SelectedRows[0].GetData()).Value;
				PList<SecurityItem> list = new PList<SecurityItem>();
				foreach(Person u in users)
					if(childsList.FirstOrDefault(x => x.SID == u.OID) == null)
						list.Add(SecurityItem.FromUser(u));

				SimModalMultiChoiceBox frm = new SimModalMultiChoiceBox();
				frm.Parent = PanelBack;
				frm.DialogClosed += new DialogClosedEventHandler(SimModalMultiChoiceBox_DialogClosed);
				frm.Tag = 2;
				frm.CaptionImage = global::Sim.AdminForms.Properties.Resources.User;
				frm.CaptionText = "Добавление пользователей";
				frm.VariantsCaption = "Доступные пользователи";
				frm.ChoicesCaption = "Выбранные пользователи";
				frm.Variants = new ListBinder(list);
				frm.Show();
			}
			catch(Exception Err)
			{
				Sim.Controls.ModalErrorBox.Show(Err, PanelBack);
			}
		}
Exemplo n.º 3
0
		//-------------------------------------------------------------------------------------
		private void btnAddGroups_Click(object sender, EventArgs e)
		{
			try
			{
				PList<SecurityItem> list = new PList<SecurityItem>();
				foreach(SecurityGroup g in pSec.SecurityGroups.Values)
				{
					bool need = true;
					foreach(ACEitem i in ACL)
						if(i.ACE.SID ==  g.SID)
						{
							need = false;
							break;
						}
					if(need)
						list.Add(SecurityItem.FromGroup(g));
				}

				SimModalMultiChoiceBox frm = new SimModalMultiChoiceBox();
				frm.Parent = PanelBack;
				frm.DialogClosed += new DialogClosedEventHandler(SimModalMultiChoiceBox_DialogClosed);
				frm.CaptionImage = global::Sim.AdminForms.Properties.Resources.Group;
				frm.CaptionText = "Добавление групп";
				frm.VariantsCaption = "Доступные группы";
				frm.ChoicesCaption = "Выбранные группы";
				frm.Variants = new ListBinder(list);
				frm.Show();
			}
			catch(Exception Err)
			{
				Sim.Controls.ModalErrorBox.Show(Err, PanelBack);
			}
		}
Exemplo n.º 4
0
		//-------------------------------------------------------------------------------------
		/// <summary>
		/// Добавление дочерних групп
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void btnChildGroupAdd_Click(object sender, EventArgs e)
		{
			try
			{
				if(fdgvGroups.SelectedRows.Count == 0)
					return;
				SecurityGroup cur = (SecurityGroup)((IKeyedValue)fdgvGroups.SelectedRows[0].GetData()).Value;
				PList<SecurityItem> list = new PList<SecurityItem>();
				foreach(SecurityGroup g in psec.SecurityGroups.Values)
					if(!(g == cur || parentsList.FirstOrDefault(x => x.SID == g.SID) != null ||
										childsList.FirstOrDefault(x => x.SID == g.SID) != null))
						list.Add(SecurityItem.FromGroup(g));

				SimModalMultiChoiceBox frm = new SimModalMultiChoiceBox();
				frm.Parent = PanelBack;
				frm.DialogClosed += new DialogClosedEventHandler(SimModalMultiChoiceBox_DialogClosed);
				frm.Tag = 2;
				frm.CaptionImage = global::Sim.AdminForms.Properties.Resources.Group;
				frm.CaptionText = "Добавление дочерних групп";
				frm.VariantsCaption = "Доступные группы";
				frm.ChoicesCaption = "Выбранные группы";
				frm.Variants = new ListBinder(list);
				frm.Show();
			}
			catch(Exception Err)
			{
				Sim.Controls.ModalErrorBox.Show(Err, PanelBack);
			}
		}