Example #1
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Userod       user  = Userods.GetUser(ListUser[e.Row].UserNum);
            FormUserEdit FormU = new FormUserEdit(user);

            FormU.ShowDialog();
            if (FormU.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            if (Security.CurUser.UserNum == user.UserNum)
            {
                Security.CurUser = FormU.UserCur;              //if user changed their own password, this keeps the CurUser synched.  Needed for eCW bridge.
            }
            FillUsers();
            for (int i = 0; i < ListUser.Count; i++)
            {
                if (ListUser[i].UserNum == FormU.UserCur.UserNum)
                {
                    gridMain.SetSelected(i, true);
                    SelectedGroupNum = FormU.UserCur.UserGroupNum;
                }
            }
            FillTreePerm();
            changed = true;
        }
Example #2
0
		private void userControlSecurityTabs_EditUserClick(object sender,SecurityEventArgs e) {
			FormUserEdit FormUE = new FormUserEdit(e.User);
			FormUE.ShowDialog();
			if(FormUE.DialogResult == DialogResult.OK) {//update to reflect changes that were made in FormUserEdit.
				userControlSecurityTabs.FillUserTabUsers();
				userControlSecurityTabs.RefreshUserTabGroups();
			}
		}
Example #3
0
		private void userControlSecurityTabs_AddUserClick(object sender,SecurityEventArgs e) {
			Userod user = new Userod();
			FormUserEdit FormU = new FormUserEdit(user);
			FormU.IsNew=true;
			FormU.ShowDialog();
			if(FormU.DialogResult == DialogResult.OK) {//update to reflect changes that were made in FormUserEdit.
				userControlSecurityTabs.FillUserTabUsers();
				userControlSecurityTabs.RefreshUserTabGroups();
				userControlSecurityTabs.SelectedUser=FormU.UserCur; //select the user that was just added.
			}
		}
Example #4
0
 private void treeUsers_DoubleClick(object sender, System.EventArgs e)
 {
     if (treeUsers.SelectedNode == null)
     {
         return;
     }
     treeUsers.ExpandAll();
     if (treeUsers.SelectedNode.Parent == null)          //group
     {
         UserGroup         group = UserGroups.List[treeUsers.SelectedNode.Index];
         FormUserGroupEdit FormU = new FormUserGroupEdit(group);
         FormU.ShowDialog();
         if (FormU.DialogResult == DialogResult.Cancel)
         {
             return;
         }
         FillTreeUsers();
         //reselect group
         for (int i = 0; i < treeUsers.Nodes.Count; i++)
         {
             if ((int)treeUsers.Nodes[i].Tag == group.UserGroupNum)
             {
                 treeUsers.SelectedNode = treeUsers.Nodes[i];
                 SelectedGroupNum       = group.UserGroupNum;
             }
         }
     }
     else             //user
     {
         Userod       user  = UserodB.GetUser((int)treeUsers.SelectedNode.Tag);
         FormUserEdit FormU = new FormUserEdit(user);
         FormU.ShowDialog();
         if (FormU.DialogResult == DialogResult.Cancel)
         {
             return;
         }
         FillTreeUsers();
         for (int i = 0; i < treeUsers.Nodes.Count; i++)
         {
             for (int j = 0; j < treeUsers.Nodes[i].Nodes.Count; j++)
             {
                 if ((int)treeUsers.Nodes[i].Nodes[j].Tag == FormU.UserCur.UserNum)
                 {
                     treeUsers.SelectedNode = treeUsers.Nodes[i].Nodes[j];
                     SelectedGroupNum       = FormU.UserCur.UserGroupNum;
                 }
             }
         }
     }
     FillTreePerm();
     changed = true;
 }
Example #5
0
        private void userControlSecurityTabs_AddUserClick(object sender, SecurityEventArgs e)
        {
            Userod       user  = new Userod();
            FormUserEdit FormU = new FormUserEdit(user);

            FormU.IsNew = true;
            FormU.ShowDialog();
            if (FormU.DialogResult == DialogResult.OK)                //update to reflect changes that were made in FormUserEdit.
            {
                userControlSecurityTabs.FillGridUsers();              //New user is not in grid yet, add them.
                userControlSecurityTabs.SelectedUser = FormU.UserCur; //Selects the user that was just added in the grid.
                userControlSecurityTabs.RefreshUserTabGroups();       //Previously selected users User Groups are still selected, refresh for UserCur.
            }
        }
Example #6
0
        private void butAddUser_Click(object sender, System.EventArgs e)
        {
            Userod user = new Userod();

            user.UserGroupNum = SelectedGroupNum;
            FormUserEdit FormU = new FormUserEdit(user);

            FormU.IsNew = true;
            FormU.ShowDialog();
            if (FormU.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            FillTreeUsers();
            FillTreePerm();
            changed = true;
        }
Example #7
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Userod       user  = UserodB.GetUser(PIn.PInt(table.Rows[e.Row]["UserNum"].ToString()));
            FormUserEdit FormU = new FormUserEdit(user);

            FormU.ShowDialog();
            if (FormU.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            FillUsers();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (table.Rows[i]["UserNum"].ToString() == FormU.UserCur.UserNum.ToString())
                {
                    gridMain.SetSelected(i, true);
                    SelectedGroupNum = FormU.UserCur.UserGroupNum;
                }
            }
            FillTreePerm();
            changed = true;
        }
Example #8
0
		private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			Userod user=Userods.GetUser(ListUser[e.Row].UserNum);
			FormUserEdit FormU=new FormUserEdit(user);
			FormU.ShowDialog();
			if(FormU.DialogResult==DialogResult.Cancel){
				return;
			}
			if(Security.CurUser.UserNum==user.UserNum) {
				Security.CurUser=FormU.UserCur;//if user changed their own password, this keeps the CurUser synched.  Needed for eCW bridge.
			}
			FillUsers();
			for(int i=0;i<ListUser.Count;i++) {
				if(ListUser[i].UserNum==FormU.UserCur.UserNum) {
					gridMain.SetSelected(i,true);
					SelectedGroupNum=FormU.UserCur.UserGroupNum;
				}
			}
			FillTreePerm();
			changed=true;
		}
Example #9
0
		private void butAddUser_Click(object sender, System.EventArgs e) {
			Userod user=new Userod();
			user.UserGroupNum=SelectedGroupNum;
			FormUserEdit FormU=new FormUserEdit(user);
			FormU.IsNew=true;
			FormU.ShowDialog();
			if(FormU.DialogResult==DialogResult.Cancel){
				return;
			}
			FillUsers();
			FillTreePerm();
			changed=true;
		}