mcdonnc2004
01-24-2007, 12:34 PM
Hi all,
I am trying to do what I thought would be a simple page but it is turning out to be challenging for me!
I have a page with a GridView containing a bunch of offers that would be converted to orders. Say a sales rep submitted an offer through our purchasing system. This would be sent to my web page. The person who converts these offers would check my page to see what offers are waiting. They look up the order number on the purchasing system and check the offer is valid. If it is, they tick the box. This works fine as demonstrated here (feel free to play with it):
http://cherrysoft.co.uk/OrderGrid.aspx
My problem is, I'd like it to be a little more complex. I want the page to be able to send an e-mail to the sales rep to say the offer is valid. Ideally I'd like this to fire when the Update link is clicked, so the database is updated and the e-mail is sent. So what I need the page to do is to check the primary key field for the current row being updated. Once I have that ID value I can then use code to connect to various other tables and retrieve the info (email address, full name, etc) but I need the ID first and I cannot work out how to get it when the update link is clicked!
My database fields are:
OrderID [Primary Key - ID field]
sales_rep [Char]
order_no [Int]
order_date [DateTime]
order_value[Int]
order_checked [Bit]
How can I retrieve the OrderID of the row currently being updated and store it in a variable for use in the code-behind?
Thanks.
I am trying to do what I thought would be a simple page but it is turning out to be challenging for me!
I have a page with a GridView containing a bunch of offers that would be converted to orders. Say a sales rep submitted an offer through our purchasing system. This would be sent to my web page. The person who converts these offers would check my page to see what offers are waiting. They look up the order number on the purchasing system and check the offer is valid. If it is, they tick the box. This works fine as demonstrated here (feel free to play with it):
http://cherrysoft.co.uk/OrderGrid.aspx
My problem is, I'd like it to be a little more complex. I want the page to be able to send an e-mail to the sales rep to say the offer is valid. Ideally I'd like this to fire when the Update link is clicked, so the database is updated and the e-mail is sent. So what I need the page to do is to check the primary key field for the current row being updated. Once I have that ID value I can then use code to connect to various other tables and retrieve the info (email address, full name, etc) but I need the ID first and I cannot work out how to get it when the update link is clicked!
My database fields are:
OrderID [Primary Key - ID field]
sales_rep [Char]
order_no [Int]
order_date [DateTime]
order_value[Int]
order_checked [Bit]
How can I retrieve the OrderID of the row currently being updated and store it in a variable for use in the code-behind?
Thanks.