Hey guys welcome back.
In this video we'll continue putting in functionality into our wind farms application our most recent
set of tasks had us do our manage vehicle listings where we could add a new car and just add one for
sample sake and we know that when we click save changes it will get added to the database and there
would have to refresh the grid to see or a new car.
Of course when we select the roll and click edit car we could change this so if I if manual suppose
I have two ends then I correct it.
Click save changes and then once again refresh the grid so we can look into automating that grid refresh
in a bit and I'll be doing that in the rental record and management.
But just to finish up or recap the final thing that I would want to do with our vehicles would be to
remove them.
So if I select a roll and remember we discussed that if there is our entire record already associated
with a vehicle that the database would make it a bit more difficult to actually delete the vehicle itself.
But I can always select this vehicle click delete car and then it would OK and I refresh.
And then I see.
So you'd want to automate that refresh because just know the car was removed but the grid didn't show
me it was removed and then I tried again and then I got an error.
All right.
So what we want to do is have grid like sitting in the view archive and then this will allow us to kind
of do those CRUD operations and then I'll show you other things like automating that grid refresh so
to get this party started the first thing I want to do is create a new form that will serve as my archive
window for my rental record.
So I go to my solution Explorer I right click in the solution go to add new item or I can just go down
to form I want to call this form management records and then click Add and once our form is added We
do our regular changes where we go to properties and we change the text in the header to be more you
know more human readable we make it a little bigger and then I'm going to borrow the same elements that
I had over on the managed vehicle listing on went to bar each and every one of them so I'm just going
to bar the label and I'm holding down control while I click.
So I'm holding don't control what I click the Refresh button.
Agreed the three buttons that I want to control C to copy go back over to my design and then control
V to paste after pasting I'm just going to change this label text so I click the label go to properties
and I'm just going to change this to manage our entire records.
It's all right.
This week's my spelling errors.
And then we're good to go.
So manage very entire records.
That's our new window.
And then of course from the main window I need to set it up on the click events several scenes of close
all the unnecessary windows right.
No go back to my mean window yet the button and I'll save you archive.
Set up a click event and Autumn went to do is launch this new windows.
I'm just going to copy sorry I just wrecked it also.
Var manage her and her cards is equal to a new manage or an auto records as my class then I will do
that.
MDI appearance
is equal to this and the window should show all right.
Now after copying over these things what you want to do of course after renaming or label we want to
change out our buttons so right.
No.
They still have the same names from the previous form.
And that's because well the same name can exist on two entirely different forms.
So into entirely different classes.
Sure you can have the same names.
What's contextually.
I don't want this to be beaten out of Cairo.
I want it to be beaten.
I'd maybe record all right.
And just the same way.
Anything that's his car for these buttons should see a record.
So the text should be ad new or into entire record or a record.
I just say a record.
And then I'll do the same for the edit.
So I'll just change those all you can do those on your own.
All right so by the end of that exercise anything that's said car should not see a record.
Also might want to change a name on this grid just to make sure everything is consistent because this
is GV vehicle list.
So I wanted to see GV a card list.
All right.
So now that we have you know Oh I think the refresh button may also need to be changed what it's been
generally for.
So that can see.
All right.
Now we know that we need to click events for each of these buttons someone to just set up those click
events from low by just double clicking each button and generating the Click event.
So of the click event to add click event for the record and clicking event for the delete.
We already have a window that adds so I can actually just read that quote right now and we would kind
of follow the same pattern as we did when we were doing the manage vehicle listings.
So if I go back to that click event for a new car you see that what we did was just launched a window.
Tell it's that the parent off the launching window is experience also.
And then sure someone to follow that same pattern for the ad ad beaten at a record click.
All right.
There we go.
So when we click the beaten ad record it will launch the same window as we would have launched if we
clicked from the many ways so far.
So we're giving the user two options of course it's your application.
You can styled it all you would like but that's how I'm doing it.
Now if you pay attention here I don't know if I would have gone through this before.
But you see those three dots underneath the new if I hover over it and click on that light bulb that
appears they showed me that I can actually simplify the initialization our declaration of this object
right.
So if I click on that then you're going to see a different way to initialize the object which would
have seen when you were using the link code.
Right.
So it's universal one sailor class any are setting properties off the class after initializing the object
you can actually do it like this or you can do it the way you're comfortable doing it and that visual
studio rearrange it for you know for their entire records are going to have to write a lot of similar
code to what we're doing when we're doing manage vehicle listing so I'm actually just going to be copying
and pasting a lot of the code because would have written a lot of it already so I'm pasting my connection
to the database or my entity's object and the object initialization which went inside of my constructor.
Also I would have set up the Load event for the form so I need a load event on this form.
So I just go and double click the form itself and that gives me a load event and then inside off this
load event for the mileage vehicle listings I would have tried and I'm just going to copy all of this
because I mean I'll be re typing very similar code anyway so I am I copied over populate grid but of
course I don't have a method inside of this new form called populate grid.
So I can hover over it and keep that light bulb.
And then this is generate the method for me which.
OK that's good.
Get a move that generates a design and then forward the populates grid.
I'll be doing a similar query.
So let's just write the query for the populate grid for our manage rental records.
So of course the first thing I want to do is declare some object or some variable I just say var or
a cards is equal to.
And then I call on my database object dot car into records which is my table and then I would say dot
select.
And I want to be very specific with what I'm selecting.
So I would just say select open up my lambda expression using q as my object or my token.
And but I'm bloating into a new blank object.
All right.
Let me just put a semicolon here so I don't forget later on and then I'm going to say what it is I want
to select and what that column name is.
All right so the columns that we intend to have would be a customer.
So I'm just going to say customer is equal to huge dots and I are on customer name comma and then date
in.
So here I can actually use my own names for our property right.
So date in is going to have the value of Q dots data into the sorry date out my bud is going to have
the value of data printed.
All right.
And then I'm going to say comma date in of the value of Q Dot date returned.
Of course I need the I.D. So I.D. is going to be equal to cue that I.D..
All right.
And then the last one that I would want is the cost.
So cost is equal to.
That costs.
But then you noticed.
No.
That of course I need to see the type of car or what car was borrowed.
So you see cost this kind of great.
Everything else is you know strong and wide.
What this is great all because the property name I'm giving it is the same as a property coming from
the database so I can actually just remove that and just secured up costs give me the costs and I need
the car.
No.
If you look back in our database and others go over to the database quickly you'll see that we have
the type of car I.D. I have a table for the types of cars.
Sure.
But then I have the name and the I.D. over in that one.
So then you just select top 1000 or let me just look at the design rather so that we can see the column
names.
So I have ideas make model Vin license plate number and we're no in showing the details of their entire
record.
I probably wouldn't want to just show that I.D. because I.D. car I.D. 1 means nothing to me.
But that is the property that I have access to inside of my rental record.
No.
In a typical situation like in escrow syntax I would have to use an inner join statement to actually
get the details of the car being a reference details meaning the make and model.
Right.
So if I wanted to see all of this information and then print the car details Kyra make and model inside
of a query then I would have to use an inner join link allows me to actually access the property.
So let's say I said car as my property and then I wanted to make and the model off the related car or
the car related to this record.
All we really have is the idea because if I say a Q Dot then you're going to see type of car I.D. once
again that is not useful.
So I can kind of simulate a situation where I would need an inner join in any details from the related
entity or the related a record by saying I know we see the use of this types of car properties.
So remember that we add the types of car I.D. and I was seeing that we have inside of the relationship
what link does is give us access to all related objects off the bat.
So I can actually say.
Q What types of car and then they try to make it singular sometimes awkward because it's types of cars.
That's the name of the table.
And in this it's types of car.
Because it's saying that I know only one car is associated with this rental record.
So it's a car.
All right.
So they did try to you know modify the the ten not the tents the singularity and plurality of each property
just to indicate whether it's a singular or multiple.
Right.
So if we're looking at the types of car table types of cars table then link would show us that we ever
integrate cards because one car could be in multiple rental red cards.
But then since you're looking at the entire card that we know one rental record is associated with one
car.
Are types of car.
In this situation.
Oh that's not too confusing but the more you use it those the more you realize how exactly it works.
So I can say.
Q What types of car which is a class the representing or the entity or the related correct card once
again off the card details.
So then I can see the types of car dot and then it gives me access to every single property that would
have been in the types of cars table anyway.
So I did say I wanted the make and the model cyclists a car is equal to Q What types of car make and
then concatenate that onto.
Q What types of car Dot's model.
All right.
So when this runs it will give me all of these properties basically from the database table they're
all right there in the database table and then it will kind of do an inner join to say Okay give me
the details of the related red card from the types of cars table and give me the make space model and
store that inside my custom property called car.
All right.
So the expectation is that when this grid loads we're going to be seeing all of these details in addition
to the details for the related car.
And then while I was pretty much sure with a semicolon of course after all of this we always do a test
just to make our lives easier.
All right.
So the next line which I'm just going to go back over to manage vehicle listing would have me set up
the data source the header text for any one of them that I think is too cumbersome to display and then
they hide the idea.
So I'm just going to copy these lines and then I'm just going to meet them relative to this situation.
So actually I don't think OK.
Dating on dates.
So I definitely want to change those.
But before I do that I need to change older references so I need GV and that it's red card list.
So it's no longer a vehicle this button on its record list.
So in a sense it changes the result the data source is not cars but it's records.
All right.
And then the header text so no I can actually say which column header takes I want to change it so I
can probably use the named columns here because I'm not so confident about the ordering read ordering
my change at anytime I may introduce or remove.
So if I don't see it for like I did in manage vehicle easily it worked here you know.
But then if I modified the arrangement of these columns then for me not to be license plate number anymore.
Right.
So instead of referencing it by its subscript or its placement instead I'm went to reference it by its
name someone to see that the column called it out or a date in it doesn't really matter.
I just duplicate that's under one foot you're not on for oats.
All right.
And then the date in one I wanted to see a date space in and then the dates all one I wanted to see
date space out.
All right.
And then I want to once again hide the column for the I.D..
All right.
So with all those changes made let's at least see if our grid load so I'm just going to start up this
application that I went to manage rent records and click to view archive and voila.
So our grid is loading and notice that we're seeing the car records Subaru and Honda space civic right.
So just to verify I can actually have multiple windows open.
So just expand the application so you can see both the vehicles listed to the left and their entire
regards to the right.
So we see that Subaru is really just the meek.
So that's why we're only seeing the word Subaru whereas Honda Civic make and model are displaying the
details accordingly.
All right.
Further so that if I click add new record then we see add new record coming up allowing us to put in
a new record so I'm going to put in one test driver cost is fifteen hundred dollars and the date returned
would be let's say the 1st of March the type of car is a Rolls Royce Phantom I submit and then everything
goes through I can modify this window no that's it kills is afterwords.
All right.
So that we don't have somebody clicking submit twice but once we close and we click refresh Well there's
no refresh here.
So we need to wire that refresh button up what we did see we're going to try for an automatic refresh
but by closing the window and reopening it it rear end that query that populate grid query and then
we see that our greatest populated.
So I'm just going to quickly wire up the edit and the delete record functionality so I'm going to go
back to my core that we wrote for the edit car listing and I'm going to just take all of this school
because literally it's going to be very similar and I'm going to place it inside of the function and
then I'm just going to change all the relevant references so it's not GV vocalists anymore it's GV or
chord list and I'm getting the same rule with the same so I'd be looking inside of current records.
This time though not types of car car entire records is our table.
So D.B. car entire records first are default.
Give me where to.
Come on I d so you may have some little cosmetic things that change out and the variable here is not
car but it is no record.
All right and then we're here launching an edit vehicle sermon that we did add a vehicle as our window
to allow us to edit or add a vehicle.
We started off with a car and tarot card.
So we're going to have to make some major modifications to that to get it to work.
So I'm just going to come into these lines for No.
All right.
And we'll get back to them.
Gwen's off to do that's in part two.
I'm just going to go back and get that delete code and get the try catch everything.
Bring it over me.
Those cosmetic changes once again.
So it's GV record list and not GV vehicle list.
So I'm getting the same call home different table once again car our cards.
Come on I a B.
And then I'm seeing remove the object and this is a record not car.
So remove the object or a card from the table save changes and then I could just recall populate grid
here instead of doing that a shred.
Delete I just recall populate grid which should rear on the query I did allude to us doing it in part
to what I'm just going to push ahead and finish this up in this video.
So we need to make some modifications to our window that we were using to add or rent record.
So we call it our entire record.
I'm going to rename it's to add edit our entire record and by renaming it and saving it it's going to
ask me if I want to rename all references so I click.
Yes.
So that everywhere that it was making reference to add her entire record it will no say add editor into
our record.
Of course I need to modify the code so I'm just going to write clicks a view code and that brings me
directly to the view file but I'm also going to bring up our ad edit vehicle code file so that we can
see them side by side once again I'm when to make some very similar modifications.
I'm going to take most of the properties that I had in edit vehicle and place instead of ad edit rent
record starting with the edit mode because then we need to track if it's a bit more or add mode you'll
see that we had to construct here.
So I'm going to take all of these properties are all of these lines of code that were inside of the
windows remove what's not necessary.
So I had a car into entities as the name here.
So to keep everything consistent up as I've been saying before I'm just going to rename it to underscore
D.B..
All right.
So it's better to just keep everything consistent.
Use one variable name across the board so that everybody knows who they are.
Right.
So LBO title I didn't give the label inside of this window title but I just say add knew her intro and
the text of the window should also see add new rental and is edit more these forms.
All right.
And then I will declare another constructor sic industry CTO R by step twice and then it generates another
constructor and then I will put in the object off or entire record second a car rental or a card another
Sarah card.
All right.
So remember that when we're doing the ad edit vehicle what we did was create a second constructor that's
allowed us to pass in the the record that needed to be edited.
In this case it was a car to edit.
So to keep be consistent take and say or a card to edit.
All right.
And then once again I'm just going to copy most of this well all of this code since is very similar.
Once again.
And then I'll just change.
Oh.
So this is idiots Renato Ricard.
Let me put the record so that my sentences are complete.
Through and through.
So her entire record it earned her a card.
And then this is record to it it's not card to edit.
All right.
And then populate fields.
That is a that is something that we need to load up so I'm just going to generate a method for that
and then go back to ad vehicle and then we'll see all of the fields that were populated.
So we're probably going to have to do that part manually since there are two entirely different forms.
I'm not going to copy this code but I'm going to still follow that pattern.
All right.
So then what I'm going to do is scroll down to the beat button one click so you see even these things
when we're starting off I was starting off simple so I didn't want to complicate everything but know
that we're at more advanced so we're going back to our old code we realize that we have some gaps so
like button 1 underscore click I don't like this button one on the score click we didn't name the button
at a time but you know that we're naming buttons you can probably go back and give it a better name
and change the name of the button click event that is associated with it so that your code is more readable.
ANNIE HALL What I'm really here for is to get but these fields.
So what I'm going to do is just copy all of this so that I have all of the fields that need to be populated.
And then I'm going to remove.
So I just wanted the field names.
That's all I really wanted.
I'm trying to work you know a bit smarter than I'm trying to work harder so I'm just getting the really
fun parts because I have it's all over.
So instead of sitting down and read typing and trying to remember all of these fields I know I had them
somewhere else.
So I just went and got them right.
And you see here I have a few arrows because this is calling on the car into entities which we changed
the DB So we just fix that same time.
So I mean if you you may not have some other problems I I'm having what I'm going through them just
so that when you see similar problems you know exactly what you need to do to fix them.
Right.
So here I see that I have my fields and I need to give them values so TB customer name not text is going
to have the value of this is car to it it's I don't want it to say car to edit.
So it's a scar to edit because I generated the property based on the function called the function based
on the function called sorry.
So it's required to edit changes that are required to edit and also changes direct or to edit and change
the type.
So you notice it's a generic Object type.
So to make sure that it says car into record so strongly tied to language make sure that all of your
your types are proper.
So it's red card to edit dot and then I'll see costumer name.
All right.
And then just the same for the day it's rented DTA entered that value is going to be required to edit
dot data printed and then the same here.
Oh but I'm getting an arrow where it's seeing that it cannot convert he cannot implicitly convert knowledgeable.
So once you see that question mark alongside a data type it means it's not a boom which means that I
may or may not have a date time or a value inside of it.
So it's in that to the to the right.
This is knowledgeable but to the left it's not multiple.
The value is not knowable so they're saying they can't just see it at.
Okay.
I have another data types so I'm just going to see date time to convert it.
All right.
So now we see that the date time is not knowable.
All right.
So I converted it from a notable date time to an actual date time.
So once again if you look if you just hover over a data until to see the question mark.
So the reason the question mark is there and it's notable is that this is coming from the database and
remember that our database design or at least my database design says that the date time I Low's nodes.
So if I load knows from the database design when the link was converting it into C sharp equivalent
data types then it would have retained that low null property so that the data type would have had this
question mark to say that the date time is a load to be known in C sharp just like oh it is a low to
be no in the database.
In reality however that that knowledgeable date time data type is actually different from our regular
date time just to see him with string and in an almost every other data type you have a multiple version
and you have a version that requires of value.
All right.
So I'll just do the same thing for the next line where I'll just go ahead and write the date time at
the front and then I will call the object that date returned and then for the cost I'll see object not
cost.
All right I don't believe I need any of this but then I see here where they're saying that they I have
what is the problem.
So this is a decimal.
So of course I need to do this to string.
So the database from the database it's a decimal.
I need to convert it to a string so that it can go inside of the text box.
All right so I slow a few errors the fixed gluing back to the top.
We see where there is no there is no object on my form called be a title so I'm just going to make sure
I go or to my design.
So solution expert add ed into a record and this would be the set title right.
So I'm just are said label or other so I'm just going to go to the properties and give it a name so
right.
No.
By default this label one I just rename it to build title and once I do that that should solve that
error.
And there goes.
And see if there are any other errors so you can always see if they're arrows in your code by just looking
over here you see that that's a red line that has an error it was showing red square on that line has
a visual cue and the next error here is that it's still looking for the old entities reference so does
change that's all to my new object name which is on the score sheet.
All right.
So the next thing I would probably want to do is to enforce that edit mode so I have edit mode declared
I have it being set to True or false based on which constructor is being called or so.
All right I'll do that later.
And then what I do is modify the Click event to get all of the data and then do the validations and
then after checking if it is valid we check if we're in edit mode or not.
So we just do that quickly.
So if if is it its mode and ls all right.
So I put else so put all of this in the LS because this is what happens if it's not an idiot mode it
adds it so if it's not an edit more than we're adding I already have the add code splits it into else
but then if it is edit mode then I need to get the record by ideas and then he added so then I'm sorry
if I've seen back unfair to what we're just going through this together from scratch anyway so to get
the idea.
Remember that what we did in the ad edit vehicle was that we created a property or we created control
which was hidden a label which was hidden to which we had assigned the idea off the record that came
over in the of course.
So we failed to do that this time let's just do that to make sure that we have all the bases covered.
Once again it's good that we already rode this good because when we do a side by side comparison we
can.
It can help to inform what we need to do right.
So I'll go back to my design for the ad edit or into record.
I will bring over from the tool box label all right so come on controls get to a label place it somewhere
it doesn't really matter at this point I can just change the properties to see that.
Okay I want this one to be red card or LBO or a card I.D..
Sorry.
Let's text how long it takes to be blank don't want to type in a text.
What I do want it to have the name it'll be a record idea and then I want its visibility to be falls
so it will be hidden.
All right so we have that hidden label somewhere.
It doesn't really matter where if he concedes or not it doesn't really matter unless you need to delete
it.
Then I guess again paint over that area to help selected more moving along what we want to do is to
make sure that we are also populating that LBO record I.D. up text with the idea coming from or a card
so.
Edit all rights are a card to edit that I.D..
All right.
And of course off to see it's a string.
Sorry good.
So we have or I.D. somewhere on the farm.
Right.
So when I move along and I'm about to do editing no the first thing I do is retrieve that.
So var ideas equal to and then I can just implicitly convert this one.
I can't I can go on in that pious rather in that pass and then I'm passing the record i.e. that text
all right so whatever gets stored in that in the text value for that label I'm passing it on.
And I'm retrieving that idea and then I can say via a card is equal to gets it from the database.
D.B. dot and now on car entire records not first are defaults that and then queuing up my lambda expression
Q that I.D. property is equivalent to whatever I.D. value I just got and stored inside of my variable
called I.D..
All right now that I have the record I need to go about changing all the actual values so I can actually
just well.
So what I already did was I scraped the values from the form.
That's what we're doing from day one right.
When we submit the form we have local variables that gets all of these values from the farm.
All right.
So what I'm going to do is not to have the red card.
I'm just going to borrow this code down here.
Actually they can just bought all of this code here base it's up here and then what I will say is instead
of seeing or entire card because our entire record is relative to the object we created from the start
when we set our entire record is blank and then start assigning all the values accordingly.
This time I got retrieved our EBT card that existed and by variables record on well I could actually
just call the variable or entire a just a same because within the scope this rental record exists within
the if scope and then this rent a record object exists instead of the S scope.
All right.
So then based on whatever and I mean this code could probably be refracted I'm seeing how it can be
refracted right.
No to be no more you know much cleaner but I'm not going to complicate it.
I'm just going to leave it like that so I'm declaring an object.
Well I'm retrieving our record here and then using this record I'm going to reset all of the values
based on what we just stored in our local variables coming from the the farm.
All right.
And then in this situation I mean the El situation I'm creating a brand new record and then I'm still
populating this brand new record with but it's coming from the farm.
So even populating with values coming from the farm all of that.
That's his repeated code.
This code could have been done one time really.
All right.
So anytime you see repeated code like this you can look for an opportunity to do refractory it's someone
to leave you to do that outer factor it later and explain it to you but then you can try it on your
own and see how basic entry into the code that your you know you don't repeat all of these lines of
code but you could do it one time and get away.
All right.
So moving on the next thing that we want to do having repopulated all of the records with the potential
new value is even if they're old buddies what a potential new voters from the database is to save the
changes.
I can just once again Copy that.
See if changes.
And then once we're done we want to close.
So much change is going to right close after the message box comes up.
If you're adding We disclose or rather I can just the one close I don't have to close if it's close
if you delete but if is valid and you do all of these things then you just close at the end of that.
Right.
So I'm going to set a message box after saving change is often at its operation and I'll just duplicate
this.
So that's another duplication here again.
Right.
So the problem with duplication is that if I have to make a change to something then I have to do it
here and have to remember to do it here and then in this case with a message box I have to do it here.
And then after remember to do it here.
So on the way four up to code would be to just show you know like call a method that does something
one time.
All right.
So I have multiple ways to do it.
As I said you can find a way I'll do it on my own and then explain it later on but I want to challenge
you guys to start thinking about refactoring code and reducing repetition.
All right.
So before I moved on are fractured the code so I hope you pause the video and try to do yourself.
But either way I did it and explain to you what I did.
So I said after checking if it is valid then I declared an object off car into a red card.
All right.
This is what we would have done if it was create what we need an object of that type either way whether
it is create mode or not.
So within the context then it's okay to just do this step next I think if it is it mode then I want
to retrieve the idea and I want to then retrieve the record from the database and then set that as the
value offerings are required.
So if it is not and if it does not edit mode then this is still just a blank object off car to record
it has no value yet except the fact that it is an initialized object if it is edit mode then we give
it the value based on the record that we're retrieving from the database.
Either way whether it is edit mode or not we want to be populating all off the properties with stuff
from the farm.
So if if it is edit mode then we know the farm is going to have values and if the person is just creating
Eric or the A student of value.
So we're just getting all of those values and placing inside of the object whether or not it was retrieved
or it is still empty.
After doing all of that I'm just saying if it is not edit mode which means that I about to add a red
card then I want to do this step to add the record to the database right to the database table.
And then if it does skip all that then well either way it's going to see the changes the saving the
changes I call the message box so the same message box and then I close the window and that's it that's
all I refracted that whole section to have you know one instance of everything instead of having two
instances of the same operations you know you can look for things that have to hop regardless of the
situation and how you can rearrange your code into fewer lines just to make it easier.
So you can actually go ahead and pause at the different parts just to see add comments.
All rights of added some some comments and the fix a spelling error here.
And so you can actually just go ahead and pause the video you know look at the the comments look at
the code that's written rewrite your code that way or whatever it is you need to do to get acquainted
with what was done here.
All right.
So notice that the statement here I don't know if I pointed it out if you have one line often operationally
you don't need a curly braces.
So here you have to have created braces because I have two lines within here I just said if it's not
adding more than just indented into the next line and indented it will only operate on that one line.
So nothing else will be seen as parts of that if statement now that I'm finished wiring up the edit
her entire record I need to go back to my manage and manage print our cards and that edit click event
and then I will be able to launch the window like I need to.
Right.
So let's say add edit or or a car that's any of my object and that's equal to a new instance of ad edit
or in or card and then the object we're passing in is red card not car.
And then it's the same lines of code just changing the object references there and then we should be
able to properly test the functionality of what we've just done.
All right.
So I clicked on view archive and then let's see what happens if I click a new record.
So we see add new or entire record comes up.
We get our blank form.
Let me just make sure that it works properly.
So he's renting or Volkswagen Beetle for that many days submit all right and then okay.
And the window closes it doesn't refresh.
But then let's try it.
Edit So edit is going to give us that error.
If I had to record and click edit then I see that I'm getting my edit to screen up just as I expected.
So now we know that our ad an edit for the entire record works just that it worked for a managed vehicle
listing and once again we copied and pasted a lot of code made some minor changes but the functionality
was so similar that we really did enough to sit and retype everything right so we can reuse code and
then by refactoring code we're reducing the number of steps in between.
Finally I think we've done quite a bit of work on this form.
So what we will do is end here.
You can go through and you can review revise everything that was done if you have any problems any difficulties
with anything feel free to let me know.
I'd now be more than happy to help.