Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Lines of Invoice

Lines of Invoice

Scheduled Pinned Locked Moved Database
questionannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ruifernandes24
    wrote on last edited by
    #1

    Hi I have two Classes: Invoice and LineOfInvoice. In class LineOfInvoice I have a field named "line_number". My question is: in a datagrid the user removes line 3 of the invoice. What is the best way to update the line number field of invoice after third line (witch was removed). Line 4 becomes line 3, line 5 becomes line 4, ... Remove all lines and insert all lines again with the right numbering from datagrid? update only de rows after the line removed? Thanks!

    E 1 Reply Last reply
    0
    • R ruifernandes24

      Hi I have two Classes: Invoice and LineOfInvoice. In class LineOfInvoice I have a field named "line_number". My question is: in a datagrid the user removes line 3 of the invoice. What is the best way to update the line number field of invoice after third line (witch was removed). Line 4 becomes line 3, line 5 becomes line 4, ... Remove all lines and insert all lines again with the right numbering from datagrid? update only de rows after the line removed? Thanks!

      E Offline
      E Offline
      Edbert P
      wrote on last edited by
      #2

      I did something similar to this a while ago. I just updated the lines after the one that was removed with an SQL like this: UPDATE [tableName] SET line = line - 1 WHERE idKey = @idKey AND line > @removedLine Hope it helps! ;) Edbert P. Sydney, Australia.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups