This topic is locked
[SOLVED]

 Duplicate Add page

5/3/2010 5:40:52 AM
ASPRunnerPro General questions
C
CC88 author

I created an Add Page with wizard and works like a charm.
Now I need to duplicate this Add Page and modify it (basically I like to have another Add Page but without a parameter).
Then I like to catch parameters value and execute a personalized query.
Something like that:
insert into Competenze_MTS

select <cat>, <group>, <family>, Comuni.ISTAT, Provincia,Regione from Comuni

inner join Province on Comuni.Provincia = Province.ISTAT

where Provincia = <country>
where I catch <cat>, <group>, <family> and <country> from the select box. Is it possibile or is it fast adding a custom asp page created by myself?
Kind regards.

Sergey Kornilov admin 5/3/2010

I don't really understand when this SQL query needs to be executed. Typically you can use AfterAdd or BeforeAdd events for this purpose though I'm not sure if this is the case.

C
CC88 author 5/4/2010



I don't really understand when this SQL query needs to be executed. Typically you can use AfterAdd or BeforeAdd events for this purpose though I'm not sure if this is the case.


no <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=49522&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
I need to execute that type of query for adding multiple line in a table at once.
Suppose you have a '<cat>' that is a service center. Those service center could cover multiple city in a country '<country>'. With that sql statement you can add all the city in a country at once instead of adding them one to one in the table. Simply, you can associate a service center to cover all the city in a country for a particular '<group>' and '<family>' of product.
That's why I need it.

Sergey Kornilov admin 5/4/2010

I understand what you need to do. It's still not clear when you need to do this.

C
CC88 author 5/10/2010



I understand what you need to do. It's still not clear when you need to do this.


mmm... I need to do this every time I have a service center that cover a country instead one or two or ten city in a country (to cover one or two or ten city I use the normal add page for the table 'Role'). But to cover all the city in a country (suppose around 100 city) I could not be able to add every 100 city, that would be a waste of time.
So, I need to do this in a separate add page. Alternatively I can do this in the normal add page I've made but I need to change the insert query executed, adding an If condition to the query executed.

Sergey Kornilov admin 5/10/2010

According to what you saying - you can get away using a standard Add page and BeforeAdd event.
In this event you can construct and execute your own SQL Query. To prevent the standard query from being executed add the following line at the end of event:
BeforeAdd = false
Hope this makes sense.

C
CC88 author 5/12/2010



According to what you saying - you can get away using a standard Add page and BeforeAdd event.
In this event you can construct and execute your own SQL Query. To prevent the standard query from being executed add the following line at the end of event:
BeforeAdd = false
Hope this makes sense.


I will give it a try as soon as I have the official version <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=49726&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
But I don't understand how to duplicate the add page in list menu etc. Because I need the modified add page (without city specified) but also the 'original' add page.

Sergey Kornilov admin 5/12/2010

I think you can add an extra column to your List page and insert a link to your new Add page there.

C
CC88 author 5/13/2010



I think you can add an extra column to your List page and insert a link to your new Add page there.


that's awesome. Thank you so much.