2023 In the Group Project lecture for this week we looked at how to use an Oracle form that works within | Assignment Collections
In the Group Project lecture for this week, we looked at how to use an Oracle form that works within the Citrix environment. If you have not downloaded the form (SAI430_Form.ZIP) and read through the form description under the Group Project tab for this week, please complete that before you proceed with this lab.
Each of the C# projects you will be building in this week’s iLab should be on the Q: drive in your directory SAI430_### where ### is your number that was assigned to you at the beginning of the course
In this lab, you will execute the form and generate the output files. The customer information form will generate a single XML file, customerlab6.xml, containing as many customer records as you wish to enter. The customer order portion of the form will generate two sequential files based on the data that is entered. The first file,Lab6TestOE.txt, is the order file and the second file, Lab6TestOL.txt, is the order line file containing the actual items ordered. It is possible to enter multiple orders while the form is open.
Deliverables
You will be generating a set of three files during this lab. The first file will be an XML file containing at least two customer records, customerlab6.xml. The second and third files, Lab6TestOL.txt and Lab6TestOE.txt will be sequential files that contain the order information for one of the customer records contained in the XML file. All three files will need to be submitted for a grade in this lab. Place all three files in a single ZIP file and submit that file to the Dropbox for this lab.
iLAB STEPS
The files from the user interface must be written to the directory that you have access to on the Q: drive. It will be necessary for you to change three file paths that currently exit in the code for the form. Each file path will need to point to Q:sai430_###filename where ### is your number that was assigned to you at the beginning of the course. All three of these files will be accessed by Oracle procedures so it is imperative that the files be in this directory. The following is a sample in Form.cs of the code that will need to be changed:
namespace SAI430_FORM
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
string path = @"Q:sai430_###customerlab6.xml";
In Form.cs you also need to search for the strings:
"Q:SAI430_###Lab6TestOE.txt"
and
"Q:SAI430_###Lab6TestOL.txt"
and change them to reflect the correct directory.
Once you have made these changes then you will need to compile the form and make sure that it will execute. IMPORTANT: As with previous C# applications for this course, you will need to make sure that it is built with the proper settings for the project (must be 32-bit and trusted). You can refer back to Lab 1 if you need to for how to set this up.
STEP 2: Testing the Form and Verifying the Files
Back to Top
You will want to create at least one customer and related order for the lab. When complete, you should have one XML file for the customer (named customerLab6.XML) record and two text files (named Lab6TestOE.txt and Lab6TestOL.txt) for the Order and Order Line data. You can tab through the form and you can refer back to the lecture material for this week that will explain more of the functionality of the form.
Once finished, open the files on the Q: drive and verify that the data is there (I would suggest right clicking on the XML file and select to open it with Notepad). Once you have verified that the data is there and correct then place all three files in a ZIP file to be submitted for a grade.
STEP 3: Setting up the Remaining Applications
Back to Top
There are two C#.NET applications that you have not set up yet that need to be added to your list of applications at this time. You do not need to do any coding for either of these applications, but you will need to change some directory paths in both so that they will write files to the correct place. You will also need to make a minor change to the login path for one of the applications and test the connection to make sure you can access the Oracle database.
The TRANS_APP C#.NET application – This application will pull the order data from the Oracle database and generate the order file that will be read and processed by the Transaction Processing application (MainTrans) that you will modify next. To set up this application you will need to change a file path and reset the connection user ID for the Oracle database.
- Download the trans_app.ZIP file from Doc Sharing. Copy the file to your directory structure on the Q: drive of the Citrix server and extract the file to your SAI430_### directory structure. It will automatically set up the additional folders for the application.
- Open the project up in Visual Studio. The first thing that you need to do is change the user id for the Oracle login and then set up the connection. To do this, you need to first change the ID in the connection string that can be found in the code section. Find the code “string conString” and change the userid and password to what you use to log into Oracle. You will also need to change the Data Source listing to ORACLE.
- Next, you need to change the path that will be used to write out the order file (named trans_file.txt). Change the path to show your directory structure on the Q: drive that you have been assigned.
- Now, build the application and you are finished with this application for now.
IMPORTANT: Like the applications in Labs 1 and 3 this application must be built as a 32-bit application. Refer back to Lab 1 if you need to for instructions on how to do this. DO NOT build it with the security settings as a trusted application as you did in Labs 1 and 3.
The mainTrans C#.NET application – This is the main processor for the system and will only require that you change a few directory paths to make sure that it writes files to the correct place. To set up this application and make the directory changes you will need to follow these steps.
- Download the MainTrans.ZIP file from Doc Sharing. Copy the file to your directory structure on the Q: drive of the Citrix server and extract the file. It will automatically set up the additional folders for the application.
- Open the project up in Visual Studio. In the Solutions Explorer, you will want to expand the IO folder in the solutions list.
- Double click on the CompletedOrdersFile.cs icon to place the code contents in the editor window. Change the path for the file to point to the Q:SAI430_###. Make note of the file name, as you will need to know this later. Repeat this process for NonCompletedOrderFile.cs. These files must end up on the Q drive because they will be read by an Oracle procedure.
- Now, double click on the InventoryInputFile.cs and change the file path in this class to indicate your directory path on the Q: drive. Repeat this process for InventoryUpdateFile.cs and OrderFile.cs. Again, make sure you are keeping note of the actual file names each time.
- Now, you will need to build the MainTrans application. IMPORTANT: Like the applications in Labs 1 and 3 this application must be built as a 32-bit application with the security settings for a trusted application. Refer back to Lab 1 if you need to for instructions on how to do this