Пример #1
0
		public FormEditGroup(bool newGroup, string[] groupTemplates, string[] existedGroups, UserModel[] users, SoapLibrary[] libraries)
		{
			InitializeComponent();

			_newGroup = newGroup;
			_existedGroups.AddRange(existedGroups);

			_users.AddRange(users);
			gridControlUsers.DataSource = _users;
			comboBoxEditName.Properties.Items.AddRange(groupTemplates);

			_libraries.Clear();
			_libraries.AddRange(libraries);
			_pages.Clear();
			_pages.AddRange(libraries.SelectMany(x => x.pages));

			gridViewLibraries.MasterRowEmpty += OnLibraryChildListIsEmpty;
			gridViewLibraries.MasterRowGetRelationCount += OnGetLibraryRelationCount;
			gridViewLibraries.MasterRowGetRelationName += OnGetLibrariesRelationName;
			gridViewLibraries.MasterRowGetChildList += OnGetLibraryChildList;
			gridControlLibraries.DataSource = _libraries;

			comboBoxEditName.Enter += FormMain.Instance.Editor_Enter;
			comboBoxEditName.MouseUp += FormMain.Instance.Editor_MouseUp;
			comboBoxEditName.MouseDown += FormMain.Instance.Editor_MouseDown;

			if (_newGroup)
				Text = "Add Group";
			else
				Text = "Edit Group";
		}
Пример #2
0
		public FormEditUser(bool newUser, bool complexPassword, string[] existedUsers, GroupModel[] groups, SoapLibrary[] libraries)
		{
			InitializeComponent();

			_newUser = newUser;
			_complexPassword = complexPassword;
			_existedUsers.AddRange(existedUsers);

			_groups.AddRange(groups);
			gridControlGroups.DataSource = _groups;

			_libraries.Clear();
			_libraries.AddRange(libraries);
			_pages.Clear();
			_pages.AddRange(libraries.SelectMany(x => x.pages));

			gridViewLibraries.MasterRowEmpty += OnLibraryChildListIsEmpty;
			gridViewLibraries.MasterRowGetRelationCount += OnGetLibraryRelationCount;
			gridViewLibraries.MasterRowGetRelationName += OnGetLibrariesRelationName;
			gridViewLibraries.MasterRowGetChildList += OnGetLibraryChildList;
			gridControlLibraries.DataSource = _libraries;

			textEditLogin.Enter += FormMain.Instance.Editor_Enter;
			textEditLogin.MouseUp += FormMain.Instance.Editor_MouseUp;
			textEditLogin.MouseDown += FormMain.Instance.Editor_MouseDown;
			textEditFirstName.Enter += FormMain.Instance.Editor_Enter;
			textEditFirstName.MouseUp += FormMain.Instance.Editor_MouseUp;
			textEditFirstName.MouseDown += FormMain.Instance.Editor_MouseDown;
			textEditLastName.Enter += FormMain.Instance.Editor_Enter;
			textEditLastName.MouseUp += FormMain.Instance.Editor_MouseUp;
			textEditLastName.MouseDown += FormMain.Instance.Editor_MouseDown;
			textEditPhone.Enter += FormMain.Instance.Editor_Enter;
			textEditPhone.MouseUp += FormMain.Instance.Editor_MouseUp;
			textEditPhone.MouseDown += FormMain.Instance.Editor_MouseDown;
			textEditEmail.Enter += FormMain.Instance.Editor_Enter;
			textEditEmail.MouseUp += FormMain.Instance.Editor_MouseUp;
			textEditEmail.MouseDown += FormMain.Instance.Editor_MouseDown;
			textEditEmailConfirm.Enter += FormMain.Instance.Editor_Enter;
			textEditEmailConfirm.MouseUp += FormMain.Instance.Editor_MouseUp;
			textEditEmailConfirm.MouseDown += FormMain.Instance.Editor_MouseDown;
			buttonEditPassword.Enter += FormMain.Instance.Editor_Enter;
			buttonEditPassword.MouseUp += FormMain.Instance.Editor_MouseUp;
			buttonEditPassword.MouseDown += FormMain.Instance.Editor_MouseDown;

			if (_newUser)
			{
				Text = "Add User";
				checkEditPassword.Visible = false;
				laPassword.Visible = true;
				textEditLogin.Enabled = true;
				buttonEditPassword_ButtonClick(null, null);
			}
			else
			{
				Text = "Edit User";
				checkEditPassword.Visible = true;
				checkEditPassword.Checked = false;
				laPassword.Visible = false;
				textEditLogin.Enabled = false;
			}
		}