I am currently building an asp.net application. Its supposed to be pretty simple.
The problem is, I've only experience with asp.net mvc and for this app I'm limited to .net 2.0 so no mvc.
The only requirement is this.
I have a table of about 2000 records with these columns:
Id, Code1(unique), Code2(unique), Name, LastName, Email.
The table is already populated with Id, Code1, Code2.
Now, the idea is that when someone looks up their record (through Code1 or Code2) they are able to fill the rest of the fields (Name, LastName, Email).
So, search -> if no email, name, lastname set =>edit=>display
What do I need? please help.
I have tried Details View but Im not sure how to allow edit only if the email field is blank.
Do I need something else?
I think the easiest way to go is the following:
2 textboxes, 1 button (Search), 1 GridView, 1 SqlDataSource.
Gridview should be hooked up to SqlDataSource, which in turn should take 2 parameters (textbox values)
use textboxes for searching, on Search click, GridView.DataBind()
Make sure your SqlDataSource has the Update command specified
Check out ASP.NET Data tutorials for more info, got to Step 3 in this tutorial for GridView Updating help.
You'd be able to edit 1 record at a time, I wish I could give you more details on setting up the Gridview for automatic Updates, but it's been a while since I've worked with it (Google should help you with this though).
Related
In FSCM I am looking to modify the Search view on Add/Update PO page (Main Menu--> Purchasing--> Purchase Orders--> Add/Update POs) to display the Requisition ID associated with the PO in the search results page. The only table I have found that has both PO_ID and REQ_ID is PS_PO_LINE_DISTRIB however unless I use a SELECT DISTINCT clause I will get multiple PO_ID rows when there are more than 1 line on a PO.
Within Purchase Order Inquiry you can see the related Requisition ID's related to a PO by clicking on Document Status link inside the Purchase Order inquiry details page.
I started looking at the PeopleCode within the the Purchase Order Inquiry to see how they are linking the PO to a Requisition and it appears to use work tables with related PeopleCode function libraries, but I wasn't able to figure our how they get linked. I am hoping someone else may know the answer to this. Thank you.
I'm on an old version of PeopleSoft (SCM 8.80, Tools 8.51), so your mileage may vary. I'm assuming you're familiar with App Designer. If not, comment below and I'll add some details about what I'm clicking on.
Find the name of the Add/Update PO component.
Open the PURCHASE_ORDER component in App Designer. Now let's find the name of the search record. Note that there is a different record for the Add Search Record, so if you want to change that too, do all of this for that record as well.
Open the PO_SRCH record, and add the REQ_ID field to it. Make sure you mark the field as a key. You should consider saving your modified PO_SRCH under a new name in case you want to be able to revert to vanilla PeopleSoft. If you do, change the Search Record in the component to your new record name.
We can see that PO_SRCH is a view. So let's modify the view to pull in REQ_ID from PO_LINE_DISTRIB. As you mentioned above, there doesn't appear to be another table with both PO_ID and REQ_ID, so you'll have to do a SELECT DISTINCT.
We should do a LEFT OUTER JOIN instead of a standard join because if you do a standard join and you enter a purchase order with no lines and save it, then you'll never be able to retrieve that purchase order in this window. Since REQ_ID is a key field, we can't have a null, so we have to do the CASE.
One odd thing that I ran into here was building the view now gave me an error about selecting fewer columns in the SQL than I had in my record definition. I solved it by modifying the view for SQL Server. I've never had to do that before and I don't know why I had to do it for this specific record. But anyway, I entered the same SQL under the record's "Microsoft SQL Server" definition.
In the properties of PO_SRCH, we can see that it has a related language record. If you're only using one language, you can probably get away without changing this, but I'll do it for completeness. Open PO_SRCHLN. Now add REQ_ID to it (mark it as a key field like you did above), and save it as PO_SRCHLN2 (I'm saving it under a new name so I don't break anything else that may be using PO_SRCHLN).
Edit the SQL the same was as you did above. Note: I didn't have to also change the Microsoft SQL Server definition like I did above. I have no idea why.
Now build PO_SRCHLN2.
Go back to PO_SRCH and change its related language record to PO_SRCHLN2.
Now build PO_SRCH.
Hopefully you didn't get any errors and your search page has the requisition ID in it now. My system doesn't use requisitions so they're all blank in the example below, but the new field is there.
I am doing a project in asp.net, in that i have a listview in one page(Home.aspx) that takes the GroupID & GroupName from the productgrp table in database. And i have the other page named product.aspx,in that i have an another listview which have to take the values like GroupID,ProductID,Image,Description from the productmst table by comparing GroupID from the productgrp table. What i have to do is,if i click on the GroupName in the listview in Home.aspx, it have to go to product page and display that another listview as i mentioned before. what i have to do for this? Help me....
Thanks in advance
Hari
As far as I understood your question, you need to carry some information from the one ASP.NET page to another one.
There are several options to do it:
You can use your Session object and persist some information there:
Session["somestring"] = somedata;
You can pass some parameters, like GroupID etc. to the new page either by GET (termed "query strings" in ASP.NET) or POST, here is an example how to do it: http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx
You can register your own routes for ASP.NET application and then dynamically generate the page link to pass your data in a RESTful way. Here is some info about it: http://msdn.microsoft.com/en-us/library/cc668201.aspx
Ive been tasked with creating a user input form that has a set of defined fields and the ability for the user to add their own fields on the fly. e.g textbox, select box with options etc etc. Has anyone got any ideas on how i could implement this. What do i need to consider?
Also How would i store the data as i wont know the amount of fields. Generally in past projects a field in the input form has mapped to a column in the database.
Any ideas
Thanks in advance
It will need to be stored in a denormalised fashion:
QuestionField
AnswerField
So you'll probably need a Questions table which defines the question and maybe the type of input and any contraints.
You'll then have an answers table which is linked to whatever your entity is. The answers table will have an question and an answer field.
Do your users log into your site? If so you could use a SQL table to store each users controls e.g. :
UserName ControlID ControlType
JohnSmith 1 TextBox
JohnSmith 2 CheckBox
JoeBlogs 3 TextBox
You can then have another table with each controls value within it:
ControlID Value
1 My Text Value
2 False
3 Hi I’m Joe
You can then just do a simple join to get all the users controls and there values. You can also store information such as location/index of the control on screen. Doing it this way you can add more than one value per control, meaning things like list box's will have multipul rows.
If your not using a log in system you could do the same sort of thing but using Cookies.
I am implementing an online parking reservation system and I need to bind a table with 2 Controls.
for example the user selects a Reservation start date and the parking location from a RadioButtonList and then a button (Search Availability) is pushed to fetch the parking from the database according to the Date selected and Location.
the question is: How can I bind the (Reservation Start Date Control) with (RadioButtonList) to both search in the database? and what would be the Sql Query?
Regards.
This is pretty basic stuff so you've got a lot of work ahead of you.
On your aspx page, you will want to use a SqlDataSource and add two ControlParameters to the SelectParameters, one for the RadioButtonList, one for the TextBox/Calendar with the date. Then create a GridView control to display the results and set the DataSource of the gridview to be the SqlDataSource.
Depending on your database schema, the SQL Statement will look something like this:
SELECT * FROM [Parking] WHERE [LotID] = #LotID AND [Date] = #Date AND [Reserved] = FALSE;
However, I have done reservation systems in the past, and queries to find available spots for a particular day are rarely simple. I would suggest worrying about writing the SQL query first and then getting the web page to run the query later. If you post information about your table schema and tag it as a SQL question you'll probably have better luck.
Hope this helps.
Using the ASP.NET grid view. It displays 3 columns with 1 row for each, displaying an integer saved in the database. I would like to have a text input one for each column, so the user can add a new row of integers to the database. (The table only displays the last row updated, that part seems to be working OK)
Here is the code I have that displays data but without the input option I would like.
What is the way this is done in ASP.NET (3.5)? Are there more options in the control or do I need to manually bring in text input controls and give each one manual code to update the database? Any help is appreciated.
Thank You.
Do you know the asp.net website? There are a lot of tutorials, e.g. about data access. You might find the information you need, e.g An Overview of Inserting, Updating, and Deleting Data.
Also check out the ASP.NET Dynamic Data section on the same page.