locked
Methodology for updating server side lists RRS feed

  • Question

  • User-2145974911 posted

    I am currently writing a ASP.Net web application that has a section for out IT department to manage users. One of the things it will do is give a checkbox list of the active directory security groups and email groups a user can be a member of. I was easily able to work out the code needed to add a user to a group when the use is first created. Now I am trying to figure out an efficient way to update the groups when a user changes, for instance the user is part of 5 groups and IT updates them to add a new group and remove them from 2 existing groups.

    I have thought about just doing a blanket remove from all the groups then go back and add them back to the selected ones. I have also thought of querying to get a list of all the groups they are in now, doing a compare to a list of the selected groups, calculating out which ones where removed and which where added then doing the appropriate calls. Both these methods do not seem very efficient and potentially process intensive.

    What is the more common ways a skilled/experienced developer deals with this kind of situation?

    Wednesday, February 22, 2017 10:06 PM

All replies

  • User2117486576 posted

    What DB access technology are you using: Ado.Net, EF something else?  If you want to implement this in the DB, then are you using Sql Server, MySql, Oracle...? 

    Wednesday, February 22, 2017 10:40 PM
  • User753101303 posted

    Hi,

    Rather than posting the final state and having still to figure out which differences you have, you should be able to keep track of which changes the user is doing through your UI. That is each time a checkbox is changed:
    - if it is now checked, add a "add" operation for this group to a list
    - if it is now unchecked add a "remove" operation for this group to the same list

    And so on submit, you'll just post this list of changes  that you can then directly use (rather than posting the current state for all those checkboxes and still having to compute the difference with the previous state).

    Wednesday, February 22, 2017 11:17 PM
  • User-2145974911 posted

    What DB access technology are you using: Ado.Net, EF something else?  If you want to implement this in the DB, then are you using Sql Server, MySql, Oracle...? 

    There is no database in this situation, I am updating a security groups in active directory.

    Thursday, February 23, 2017 1:25 PM