4 Replies - 1029 Views - Last Post: 06 July 2010 - 12:24 PM Rate Topic: -----

#1 maxpfc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 04-June 10

Inventory Data Table. just read it :)

Posted 06 July 2010 - 07:33 AM

Hi There,
Heres the question: I've got a screen with all the details of a product that corresponds to a table (eh products) in the db. On that screen is an 'add' button and a 'next' button. I need to have a way so that if a user clicks 'next' 'next', then adds a product, clicks 'next' some more they're not seeing any products they already saw. Tables in databases are not sequential, so if my first way of managing the next item in the list was:

command = "select product.code from products";
reader = command.ExecuteReader();
(*user clicks next*) new Form(reader.NextProductCode) 



It's now been cocked up because when user adds a new item order of DataReader is not the same.
Any help appreciated. And yes I know the code isn't real, it's for clarity (you wouldn't know the name of my forms or DataReaders so the types of objects would be unclear);

Is This A Good Question/Topic? 0
  • +

Replies To: Inventory Data Table. just read it :)

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,187
  • Joined: 12-June 08

Re: Inventory Data Table. just read it :)

Posted 06 July 2010 - 07:42 AM

View Postmaxpfc, on 06 July 2010 - 08:33 AM, said:

Hi There,
Heres the question: I've got a screen with all the details of a product that corresponds to a table (eh products) in the db. On that screen is an 'add' button and a 'next' button. I need to have a way so that if a user clicks 'next' 'next', then adds a product, clicks 'next' some more they're not seeing any products they already saw. Tables in databases are not sequential, so if my first way of managing the next item in the list was:

command = "select product.code from products";
reader = command.ExecuteReader();
(*user clicks next*) new Form(reader.NextProductCode) 



It's now been cocked up because when user adds a new item order of DataReader is not the same.
Any help appreciated. And yes I know the code isn't real, it's for clarity (you wouldn't know the name of my forms or DataReaders so the types of objects would be unclear);


This all pretty much didn't make sense. Can you restate what the problem is?

All I got was:
- screen with two buttons: next and add
- user starts program, clicks "next", and "next" again.. then adds an item.. the items they previously clicked "next" through are not visible?

Clearly if you have navigation only going one way the items you moved past won't be seen.. do you have some sort of picklist or what not for direct item selection?
Was This Post Helpful? 1
  • +
  • -

#3 maxpfc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 04-June 10

Re: Inventory Data Table. just read it :)

Posted 06 July 2010 - 11:18 AM

View Postmodi123_1, on 06 July 2010 - 06:42 AM, said:

View Postmaxpfc, on 06 July 2010 - 08:33 AM, said:

Hi There,
Heres the question: I've got a screen with all the details of a product that corresponds to a table (eh products) in the db. On that screen is an 'add' button and a 'next' button. I need to have a way so that if a user clicks 'next' 'next', then adds a product, clicks 'next' some more they're not seeing any products they already saw. Tables in databases are not sequential, so if my first way of managing the next item in the list was:

command = "select product.code from products";
reader = command.ExecuteReader();
(*user clicks next*) new Form(reader.NextProductCode) 



It's now been cocked up because when user adds a new item order of DataReader is not the same.
Any help appreciated. And yes I know the code isn't real, it's for clarity (you wouldn't know the name of my forms or DataReaders so the types of objects would be unclear);


This all pretty much didn't make sense. Can you restate what the problem is?

All I got was:
- screen with two buttons: next and add
- user starts program, clicks "next", and "next" again.. then adds an item.. the items they previously clicked "next" through are not visible?

Clearly if you have navigation only going one way the items you moved past won't be seen.. do you have some sort of picklist or what not for direct item selection?



The issue is one of order. think of it as an dataset with one field, 'product code' right? So you've got a dataset full of the current product codes. Then you have a Form (which takes the code as a parameter) this Form loads each product code in sequence that they appear in the dataset, each time the user clicks next it loads a new code. The previous forms are not visible only the current one. The previous forms have been Disposed as they are all the same class, ie the pointer to the Form is assigned a new Form each time the user clicks next and the old one is disposed. Now in the middle of cliking next, the user clicks add, thereby altering the original data and making the dataset redundant(there is one extra product code now, or possibly more than one) because we don't really know what the user has added we have to reload the dataset and get all the product codes from the db. But now how do we retain our 'position' and make sure the client does not start at a random point? they've already clicked next through half the inventory items.
Thanks for answering.
Was This Post Helpful? 0
  • +
  • -

#4 maxpfc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 04-June 10

Re: Inventory Data Table. just read it :)

Posted 06 July 2010 - 11:25 AM

View Postmodi123_1, on 06 July 2010 - 06:42 AM, said:

View Postmaxpfc, on 06 July 2010 - 08:33 AM, said:

Hi There,
Heres the question: I've got a screen with all the details of a product that corresponds to a table (eh products) in the db. On that screen is an 'add' button and a 'next' button. I need to have a way so that if a user clicks 'next' 'next', then adds a product, clicks 'next' some more they're not seeing any products they already saw. Tables in databases are not sequential, so if my first way of managing the next item in the list was:

command = "select product.code from products";
reader = command.ExecuteReader();
(*user clicks next*) new Form(reader.NextProductCode) 



It's now been cocked up because when user adds a new item order of DataReader is not the same.
Any help appreciated. And yes I know the code isn't real, it's for clarity (you wouldn't know the name of my forms or DataReaders so the types of objects would be unclear);


This all pretty much didn't make sense. Can you restate what the problem is?

All I got was:
- screen with two buttons: next and add
- user starts program, clicks "next", and "next" again.. then adds an item.. the items they previously clicked "next" through are not visible?

Clearly if you have navigation only going one way the items you moved past won't be seen.. do you have some sort of picklist or what not for direct item selection?


Sorry I wanted to add, there is a way to directly search for and open a particular product. However it is essential for things like stock takes that clients are able to go through the masterfile sequentially. This via next and previous buttons.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,187
  • Joined: 12-June 08

Re: Inventory Data Table. just read it :)

Posted 06 July 2010 - 12:24 PM

View Postmaxpfc, on 06 July 2010 - 12:18 PM, said:

View Postmodi123_1, on 06 July 2010 - 06:42 AM, said:

View Postmaxpfc, on 06 July 2010 - 08:33 AM, said:

Hi There,
Heres the question: I've got a screen with all the details of a product that corresponds to a table (eh products) in the db. On that screen is an 'add' button and a 'next' button. I need to have a way so that if a user clicks 'next' 'next', then adds a product, clicks 'next' some more they're not seeing any products they already saw. Tables in databases are not sequential, so if my first way of managing the next item in the list was:

command = "select product.code from products";
reader = command.ExecuteReader();
(*user clicks next*) new Form(reader.NextProductCode) 



It's now been cocked up because when user adds a new item order of DataReader is not the same.
Any help appreciated. And yes I know the code isn't real, it's for clarity (you wouldn't know the name of my forms or DataReaders so the types of objects would be unclear);


This all pretty much didn't make sense. Can you restate what the problem is?

All I got was:
- screen with two buttons: next and add
- user starts program, clicks "next", and "next" again.. then adds an item.. the items they previously clicked "next" through are not visible?

Clearly if you have navigation only going one way the items you moved past won't be seen.. do you have some sort of picklist or what not for direct item selection?



The issue is one of order. think of it as an dataset with one field, 'product code' right? So you've got a dataset full of the current product codes. Then you have a Form (which takes the code as a parameter) this Form loads each product code in sequence that they appear in the dataset, each time the user clicks next it loads a new code. The previous forms are not visible only the current one. The previous forms have been Disposed as they are all the same class, ie the pointer to the Form is assigned a new Form each time the user clicks next and the old one is disposed. Now in the middle of cliking next, the user clicks add, thereby altering the original data and making the dataset redundant(there is one extra product code now, or possibly more than one) because we don't really know what the user has added we have to reload the dataset and get all the product codes from the db. But now how do we retain our 'position' and make sure the client does not start at a random point? they've already clicked next through half the inventory items.
Thanks for answering.


Okay.. I am not sure what you are talking about creating and destroying forms. If it's what I think is going on that's horribly inefficient... but that aside the answer's pretty easy depending on how you want to deal with inserts.

Option 1.. user inserts a new item 'x' way through the list. User wants to be returned to the previous item they viewed before clicking 'new'.

When the user clicks 'new' retain the previous item # loaded in a variable. After the 'insert/save' for the new item load up the item number saved.

Option 2: the user wants that item saved to be the current item... save the new item and then on the return load up the returned item information.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1