Dateset question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Agnes

    Dateset question

    I am doubtful about some point or confuse on design program.
    User A run Invoice form, Load the current month data into the dataset.
    ADMIN want to lock some invoices , so ADMIN just update the dataset in his
    "admin form"
    Now, if USER A never exit the form, He can amend the record everytimes.
    Does anyfunction set auto refresh in USER A 's invoice form ??
    or I should change some design, for example, extra security tables, If USER
    A amend the record, a extra function to check the status out side from the
    dataset , so It must be up-to-date.

    Please give some advice.
    Thanks a lot


  • Ken Dopierala Jr.

    #2
    Re: Dateset question

    Hi,

    The easiest way is to have a date/time stamp field in the table. Whenever
    an update occurs, update this field. Whenever you do an update check this
    field in your dataset against the current field in the table. If it doesn't
    match anymore then you know someone else updated the record since you first
    retrieved it. Relay this news to the user along with the new data and then
    ask them to re-do the update. That should get you started. You can do more
    complicated things like saving what the user entered so they don't have to
    re-key it in when there is a concurrency issue and etc. Good luck! Ken.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:


    "Agnes" <agnes@dynamict ech.com.hk> wrote in message
    news:Omo6jbLoEH A.3968@TK2MSFTN GP11.phx.gbl...[color=blue]
    > I am doubtful about some point or confuse on design program.
    > User A run Invoice form, Load the current month data into the dataset.
    > ADMIN want to lock some invoices , so ADMIN just update the dataset in his
    > "admin form"
    > Now, if USER A never exit the form, He can amend the record everytimes.
    > Does anyfunction set auto refresh in USER A 's invoice form ??
    > or I should change some design, for example, extra security tables, If[/color]
    USER[color=blue]
    > A amend the record, a extra function to check the status out side from the
    > dataset , so It must be up-to-date.
    >
    > Please give some advice.
    > Thanks a lot
    >
    >[/color]


    Comment

    • Agnes

      #3
      Re: Dateset question

      thanks Ken, But I don't understand for some points.
      How can I [ do an update check this field in your dataset against the
      current field in the table ]??
      Where should I [do an update ]? Invoice Form ?

      "Ken Dopierala Jr." <kdopierala2@wi .rr.com> ¦b¶l¥ó
      news:OiY1SrLoEH A.132@TK2MSFTNG P09.phx.gbl ¤¤¼¶¼g...[color=blue]
      > Hi,
      >
      > The easiest way is to have a date/time stamp field in the table. Whenever
      > an update occurs, update this field. Whenever you do an update check this
      > field in your dataset against the current field in the table. If it[/color]
      doesn't[color=blue]
      > match anymore then you know someone else updated the record since you[/color]
      first[color=blue]
      > retrieved it. Relay this news to the user along with the new data and[/color]
      then[color=blue]
      > ask them to re-do the update. That should get you started. You can do[/color]
      more[color=blue]
      > complicated things like saving what the user entered so they don't have to
      > re-key it in when there is a concurrency issue and etc. Good luck! Ken.
      >
      > --
      > Ken Dopierala Jr.
      > For great ASP.Net web hosting try:
      > http://www.webhost4life.com/default.asp?refid=Spinlight
      >
      > "Agnes" <agnes@dynamict ech.com.hk> wrote in message
      > news:Omo6jbLoEH A.3968@TK2MSFTN GP11.phx.gbl...[color=green]
      > > I am doubtful about some point or confuse on design program.
      > > User A run Invoice form, Load the current month data into the dataset.
      > > ADMIN want to lock some invoices , so ADMIN just update the dataset in[/color][/color]
      his[color=blue][color=green]
      > > "admin form"
      > > Now, if USER A never exit the form, He can amend the record everytimes.
      > > Does anyfunction set auto refresh in USER A 's invoice form ??
      > > or I should change some design, for example, extra security tables, If[/color]
      > USER[color=green]
      > > A amend the record, a extra function to check the status out side from[/color][/color]
      the[color=blue][color=green]
      > > dataset , so It must be up-to-date.
      > >
      > > Please give some advice.
      > > Thanks a lot
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Ken Dopierala Jr.

        #4
        Re: Dateset question

        Hi,

        I think I read your original post wrong. You wanted to be able to actually
        lock the invoices for a while, not check for concurrency. To do that you
        could put a field in the invoice table (i.e. Locked). If it is 0 then the
        invoice is unlocked, if it is 1 then the invoice is locked. Then if you
        query this field before you do an update you'll know if the user can do the
        update or not. For example:

        User loads invoice and starts editting it.
        Admin locks invoice.
        User finishes editting and tries to update.
        Your code would first look at the invoice number the user is trying to
        update. Then it would go to the database and check the Locked field on that
        record. If it is unlocked then you would do the update. If it is locked
        then you could send a message back to the user telling them that the invoice
        has been locked.

        Good luck! Ken.

        "Agnes" <agnes@dynamict ech.com.hk> wrote in message
        news:uXdxa6QoEH A.3172@TK2MSFTN GP10.phx.gbl...[color=blue]
        > thanks Ken, But I don't understand for some points.
        > How can I [ do an update check this field in your dataset against the
        > current field in the table ]??
        > Where should I [do an update ]? Invoice Form ?
        >
        > "Ken Dopierala Jr." <kdopierala2@wi .rr.com> ¦b¶l¥ó
        > news:OiY1SrLoEH A.132@TK2MSFTNG P09.phx.gbl ¤¤¼¶¼g...[color=green]
        > > Hi,
        > >
        > > The easiest way is to have a date/time stamp field in the table.[/color][/color]
        Whenever[color=blue][color=green]
        > > an update occurs, update this field. Whenever you do an update check[/color][/color]
        this[color=blue][color=green]
        > > field in your dataset against the current field in the table. If it[/color]
        > doesn't[color=green]
        > > match anymore then you know someone else updated the record since you[/color]
        > first[color=green]
        > > retrieved it. Relay this news to the user along with the new data and[/color]
        > then[color=green]
        > > ask them to re-do the update. That should get you started. You can do[/color]
        > more[color=green]
        > > complicated things like saving what the user entered so they don't have[/color][/color]
        to[color=blue][color=green]
        > > re-key it in when there is a concurrency issue and etc. Good luck![/color][/color]
        Ken.[color=blue][color=green]
        > >
        > > --
        > > Ken Dopierala Jr.
        > > For great ASP.Net web hosting try:
        > > http://www.webhost4life.com/default.asp?refid=Spinlight
        > >
        > > "Agnes" <agnes@dynamict ech.com.hk> wrote in message
        > > news:Omo6jbLoEH A.3968@TK2MSFTN GP11.phx.gbl...[color=darkred]
        > > > I am doubtful about some point or confuse on design program.
        > > > User A run Invoice form, Load the current month data into the dataset.
        > > > ADMIN want to lock some invoices , so ADMIN just update the dataset in[/color][/color]
        > his[color=green][color=darkred]
        > > > "admin form"
        > > > Now, if USER A never exit the form, He can amend the record[/color][/color][/color]
        everytimes.[color=blue][color=green][color=darkred]
        > > > Does anyfunction set auto refresh in USER A 's invoice form ??
        > > > or I should change some design, for example, extra security tables,[/color][/color][/color]
        If[color=blue][color=green]
        > > USER[color=darkred]
        > > > A amend the record, a extra function to check the status out side from[/color][/color]
        > the[color=green][color=darkred]
        > > > dataset , so It must be up-to-date.
        > > >
        > > > Please give some advice.
        > > > Thanks a lot
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Agnes

          #5
          Re: Dateset question

          thanks Ken, But I don't understand for some points.
          How can I [ do an update check this field in your dataset against the
          current field in the table ]??
          Where should I [do an update ]? Invoice Form ?

          "Ken Dopierala Jr." <kdopierala2@wi .rr.com> ¦b¶l¥ó
          news:OiY1SrLoEH A.132@TK2MSFTNG P09.phx.gbl ¤¤¼¶¼g...[color=blue]
          > Hi,
          >
          > The easiest way is to have a date/time stamp field in the table. Whenever
          > an update occurs, update this field. Whenever you do an update check this
          > field in your dataset against the current field in the table. If it[/color]
          doesn't[color=blue]
          > match anymore then you know someone else updated the record since you[/color]
          first[color=blue]
          > retrieved it. Relay this news to the user along with the new data and[/color]
          then[color=blue]
          > ask them to re-do the update. That should get you started. You can do[/color]
          more[color=blue]
          > complicated things like saving what the user entered so they don't have to
          > re-key it in when there is a concurrency issue and etc. Good luck! Ken.
          >
          > --
          > Ken Dopierala Jr.
          > For great ASP.Net web hosting try:
          > http://www.webhost4life.com/default.asp?refid=Spinlight
          >
          > "Agnes" <agnes@dynamict ech.com.hk> wrote in message
          > news:Omo6jbLoEH A.3968@TK2MSFTN GP11.phx.gbl...[color=green]
          > > I am doubtful about some point or confuse on design program.
          > > User A run Invoice form, Load the current month data into the dataset.
          > > ADMIN want to lock some invoices , so ADMIN just update the dataset in[/color][/color]
          his[color=blue][color=green]
          > > "admin form"
          > > Now, if USER A never exit the form, He can amend the record everytimes.
          > > Does anyfunction set auto refresh in USER A 's invoice form ??
          > > or I should change some design, for example, extra security tables, If[/color]
          > USER[color=green]
          > > A amend the record, a extra function to check the status out side from[/color][/color]
          the[color=blue][color=green]
          > > dataset , so It must be up-to-date.
          > >
          > > Please give some advice.
          > > Thanks a lot
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Ken Dopierala Jr.

            #6
            Re: Dateset question

            Hi,

            I think I read your original post wrong. You wanted to be able to actually
            lock the invoices for a while, not check for concurrency. To do that you
            could put a field in the invoice table (i.e. Locked). If it is 0 then the
            invoice is unlocked, if it is 1 then the invoice is locked. Then if you
            query this field before you do an update you'll know if the user can do the
            update or not. For example:

            User loads invoice and starts editting it.
            Admin locks invoice.
            User finishes editting and tries to update.
            Your code would first look at the invoice number the user is trying to
            update. Then it would go to the database and check the Locked field on that
            record. If it is unlocked then you would do the update. If it is locked
            then you could send a message back to the user telling them that the invoice
            has been locked.

            Good luck! Ken.

            "Agnes" <agnes@dynamict ech.com.hk> wrote in message
            news:uXdxa6QoEH A.3172@TK2MSFTN GP10.phx.gbl...[color=blue]
            > thanks Ken, But I don't understand for some points.
            > How can I [ do an update check this field in your dataset against the
            > current field in the table ]??
            > Where should I [do an update ]? Invoice Form ?
            >
            > "Ken Dopierala Jr." <kdopierala2@wi .rr.com> ¦b¶l¥ó
            > news:OiY1SrLoEH A.132@TK2MSFTNG P09.phx.gbl ¤¤¼¶¼g...[color=green]
            > > Hi,
            > >
            > > The easiest way is to have a date/time stamp field in the table.[/color][/color]
            Whenever[color=blue][color=green]
            > > an update occurs, update this field. Whenever you do an update check[/color][/color]
            this[color=blue][color=green]
            > > field in your dataset against the current field in the table. If it[/color]
            > doesn't[color=green]
            > > match anymore then you know someone else updated the record since you[/color]
            > first[color=green]
            > > retrieved it. Relay this news to the user along with the new data and[/color]
            > then[color=green]
            > > ask them to re-do the update. That should get you started. You can do[/color]
            > more[color=green]
            > > complicated things like saving what the user entered so they don't have[/color][/color]
            to[color=blue][color=green]
            > > re-key it in when there is a concurrency issue and etc. Good luck![/color][/color]
            Ken.[color=blue][color=green]
            > >
            > > --
            > > Ken Dopierala Jr.
            > > For great ASP.Net web hosting try:
            > > http://www.webhost4life.com/default.asp?refid=Spinlight
            > >
            > > "Agnes" <agnes@dynamict ech.com.hk> wrote in message
            > > news:Omo6jbLoEH A.3968@TK2MSFTN GP11.phx.gbl...[color=darkred]
            > > > I am doubtful about some point or confuse on design program.
            > > > User A run Invoice form, Load the current month data into the dataset.
            > > > ADMIN want to lock some invoices , so ADMIN just update the dataset in[/color][/color]
            > his[color=green][color=darkred]
            > > > "admin form"
            > > > Now, if USER A never exit the form, He can amend the record[/color][/color][/color]
            everytimes.[color=blue][color=green][color=darkred]
            > > > Does anyfunction set auto refresh in USER A 's invoice form ??
            > > > or I should change some design, for example, extra security tables,[/color][/color][/color]
            If[color=blue][color=green]
            > > USER[color=darkred]
            > > > A amend the record, a extra function to check the status out side from[/color][/color]
            > the[color=green][color=darkred]
            > > > dataset , so It must be up-to-date.
            > > >
            > > > Please give some advice.
            > > > Thanks a lot
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            Working...