Loading ...
Sorry, an error occurred while loading the content.

Master Detail Table Prob

Expand Messages
  • Qurashi Ameer
    hi all Acctuly i have using Ms sql server 2000 n Vb.net. ma problem is dat i have a customer invoice. When i save the records it goes in to
    Message 1 of 2 , Oct 31, 2006
    • 0 Attachment
      hi all

      Acctuly i have using Ms sql server 2000 n Vb.net.
      ma problem is dat i have a customer invoice. When i save the records
      it goes in to CustomerInvoiceMaster table and CustomerInvoiceDetail
      Table. In the form CustomerInvoiceDetail data is entring in a
      listview(and these r products). When the user Save its invoice the
      data saved in CustomerInvoiceDetail and it deduct the product
      Quantity from Stock Table. it going fine no problem till here. When
      the user enter the customerInvoiceNo which he already saved all the
      form populated itself. No Heres the problem begins. User Can change
      the populated data in the list mean the product can be deleted, qty
      may be changed or so on. Now how i can make a store procedure or
      write the code in the .net that add back the already qty in the
      stock table which i deduct When user saved. and add the orignal qty.

      plz help me for this.

      Regards
      Amz Qurashi
    • srussell@lotmate.com
      ... Well this gets into the meat of programming and what rules you want to follow. 1) Make a Business Class for inventory and put all inventory code there. 2)
      Message 2 of 2 , Nov 1, 2006
      • 0 Attachment
        > hi all
        >
        > Acctuly i have using Ms sql server 2000 n Vb.net.
        > ma problem is dat i have a customer invoice. When i save the records
        > it goes in to CustomerInvoiceMaster table and CustomerInvoiceDetail
        > Table. In the form CustomerInvoiceDetail data is entring in a
        > listview(and these r products). When the user Save its invoice the
        > data saved in CustomerInvoiceDetail and it deduct the product
        > Quantity from Stock Table. it going fine no problem till here. When
        > the user enter the customerInvoiceNo which he already saved all the
        > form populated itself. No Heres the problem begins. User Can change
        > the populated data in the list mean the product can be deleted, qty
        > may be changed or so on. Now how i can make a store procedure or
        > write the code in the .net that add back the already qty in the
        > stock table which i deduct When user saved. and add the orignal qty.

        Well this gets into the meat of programming and what rules you want to
        follow.

        1) Make a Business Class for inventory and put all inventory code there.
        2) Add method to that class ChangeInInventory( invID, ChangeType, Quantity)
        3) Your grid action for CRUD to the Detail table now has to reference this
        new mthod.
        4) For an edit or deletion, you need to know what the starting Quantity
        was and add that back in your ChangeType param.

        This same class can be used in your inventory PO receiver process :)

        HTH

        __Stephen
      Your message has been successfully submitted and would be delivered to recipients shortly.