Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi,

I am creating a Purchase ORder(PO) system using ASP.net.

So it is basically a Master -detail system,with the PO header and the items in the PO.

I am using a Datagrid to enter the details part of the form.

When a user creates a new PO , I dont want the PO to be added to the Database (Sql Server), till the user clicks on the ADD button (since the PO has to be given a specific PO Number, which is given only when the order is added.)

 

My question is , where can I save the items that are added to the datagrid , till the user clicks on the ADD button. (What technique should I use here)

 

Remember that , a user may later decide to modify an already added PO , so the technique shoudld work in that scenario also.

 

Links to similar applications will be highly appreciated.

 

Thanks

When you gotta go,you gotta go !!!!!!!
  • 2 weeks later...
Posted

Hi,

I have loaded the Detail part of the PO in a dataset and placed into a session varaiable.

It works fine when a new PO is being added, since all the Detail items have to be ADDED to the Database.

I face a problem when trying o modify already existing PO's. (i.e. already having some detail rows)

I am unable to track the rows that are modified and those that are newly added to the PO.

 

Is there a technique I can use for this?

 

Thanks

When you gotta go,you gotta go !!!!!!!
Posted
In your datatable have a field like DetailID which is your unique key. When you update your db, if this field is null, then it is new and requires a INSERT, otherwise, it is a UPDATE
Posted
I hope your application has code for the situation where one po is being edited/accessed by multiple users and I'm not sure how you're implementing the creation of new pos for the user, but make sure you don't have a situation where multiple users create new pos but are being assigned the same po number, though the dataadapter's update method should throw an exception triggered by the datdabase server if the po number is an unique index.
Posted

Thanks kahlua001 and HJB417.

I got the Update and Inserting of rows to work using your advice.

Now my only problem is of deleting Detail Items.

How can I delete Rows so that they donot appear in the Datagrid (which has d dataset as its datatsource), but are only deleted from the database only when the user clicks on Update.

Is there a way of marking a row for deletion in a dataset so that they are not a part of the Dataset??

 

Thanks for your patience. I am new to ASP.net so it takes a while to understand the internal functioning of controls :)

 

Thanks

When you gotta go,you gotta go !!!!!!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...