VB.Net Part-7: How to Pass data/value from one form to another form in vb.net | Product to Checkout

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back so guys we are continuing our vb.net project so as we saw in previous video we have done about the category and its products right so guys now we will in this video we are doing that how to fetch the data from one page to another page so which means like from buy now which will be your product page if i buy now all the details of this product should be going to billing page and show over there so let's get started guys so first we required this product details and its name and price so guys let's make this form little bigger and just make it small little let's pull it down and now is we need to set the product name so my product name is nothing but let's select with the label first to name that product drag and drop done and the product name which we are going to give so let's go to text so inside this we will tell red m i note 8 okay and we increase the font size let's go to font and over here i'm going to type 14 so this is my product name and same we are going to copy and paste again and we will mention this price where it is the price will be twelve thousand nine nine nine this will be the price and simple one quantity to increment or decrement so let's add the quantity also let's give an input text box drag and drop and this will be a quantity let's give a label for this type label click drag and mention this as quantity qty increase the size of it font which will be will give 13 that's it so same way you have to make for these things also so let's let's set that and now let's copy this copy paste pull for this again paste for this so same way you have to put in all your products so we have how many categories over here you can see mobile footwear and soft toys so one is mobile so i have created that mobile page which we saw in previous video and then soft toys which is softwares over here the same way you have to create for this and then your footwear so my footwear over here so same way you are going to create all this pricing list also so let's set all this pricing list go to its property change from node mi to no red mi and let's make this as any phone call samsung just give random names of your product and the pricing we need to change that so let's change the pricing we'll give 8999 and the samsung over here let's use seven triple line that's it control s and now guys we need to create one billing page for this so when you click on this by now that time this name and price and the quantity detail should be taken to another building page so first the first for that we need to create a page so let's click on right click on the project and add and add a new windows form windows form select that and give billing dot vb or you can tell checkout also so let's move on check out and click to add checkout page created so guys now what are the details you are going to create on this checkout so checkout means is nothing but your billing order and checkout so let me just create a label for that label we will mention this name as checkout or billing or order so it might be no confusion for you guys 16 and now guys we need what are the fields required over here so my fields are nothing but over here you can see i have created some user fields and the product which we are going to fetch from there so and one simple submit button so guys now let's create this input boxes over here so first let's search one label and type over here first name so let's give that label first name and one text box text box drag save let's copy this again and make for the last name field so let's make this label and give other last name and then guys as per this field we need to arrange that so let me just finish with this and yep so guys i have just designed a simple checkout or a billing form or a billing page for this detail so we are using basic details of the users and this is the product details when you get that so what you're going to get when you click on this by now the time this product details due to the product name price and its quantity which will be taken and sent to this checkout page where it will be filled as a product name price quantity and multiplied with this price and quantity and give the total price and then guys you need to give a button where for the place order so before giving the button we need to set all these things so what set we have to name this text box so over here you can see in the properties so if you don't get properties right click on the text box click on property and over here you can see the text box so instead of text box one you have to name that text box so what is that text box called as so you need to name this is first name so we'll give first name or you can mention as fname also shortcut so let's give fname for the last name as l name l name and the email address so we'll give this as email and then there's the phone number we'll give this as phone phony phone and then address res address city mention that city next is state state state and this final pin code and now is coming to product details we are going to mention this as product name okay so over here we'll mention that product prod product name will give shortcut okay prod name prod price this is broad qty quantity and this is product total price so let's give prod prod total price that's it let's save guys and now let's create a simple button so let's search one button but ton button just click and drag and let's name this button as place order so there are two options like one is on cash on delivery one is online so that will be learning in further videos so before that one simple button i am going to create and this button name will be place order the button name and the button text which we are going to provide as place pl ac place order and the font size i'm going to increase to 16. save and now guys let's start the main concept to fetch the data from this product page to this billing page okay so let's start with it so first double click on this buy now button double click where you can see mobile one button so i have named each button so this is mobile one button where that mobile and this is mobile to mobile 3 so you can see that names so according to that you need to fetch all this so let's leave take this label name first this is label 2 so instead of label 2 you can directly assign the name for this where you can tell mi mobile 1 okay and the second name mi mobile one price and this is your quantity mi mobile one quantity so this is how you are going to specify each names for it each things so this is one this second and this is third so you can specify this mi second version right so for example i'll just show off here only so where is the name for this here's the design label 10 instead of label term you need to give mi mobile to mi mobile to price and this is mi mobile 2 qty quantity so this is 1 and this is 2 and then we'll make this as mobile 3. let's take that so let's make it this also as a mi1 okay let's take this as mi mobile 3. mi mobile 3 price then the final this name mi mobile 3 qty that's it so each label has on its own name so double click on this and start coding with it so let's get started so guys now we need to fetch the data so what data you are going to fetch this mobile so we clicked on this buy now button where when we click on this the data of this redmi and this price and the quantity so these three details should come over here on the button one click so now let's create a variable so for example we will create one product underscore name is equal to then your label so what is the label name over here you can see so let's go to its properties you can see that mi mobile one so that mobile one mi mobile one dot t e x t so this will be your label name and then you are storing this value in this product name but this is showing an error because we didn't declare anywhere or create a variable for this so how will you create a variable in vb.net so guys first you need to go to your project let me just make it small okay so click on your project and then right click go to add and you can see that class so let's click on the class and now select this class and give a class name so let's give product details let's add so this is the class created product details over here you can see that product details dot vb so this is the class so now let's create that class uh public shared then variable name so product underscore name please give a unique name as string string string then same way you have to copy and paste and tell this product price and then one more thing product quantity qty and then if you require one more thing you can use that so for example we will use one more thing called product id done so product id let's save so this is your class created with the variable so now let's use this class variables in your mobile so let's import that at the top so let's tell imports where the project name so my project name is panda project dot your product details class so this is the class which you are fetching over here and now the error has gone because this variable name is declared inside this class over here as you can see so same way you are going to as with the price also and quantity let's give price is equal to where the price label name is mi mobile one price so let's type that mi mobile one price dot t e x t and then the quantity is equal to which is that text box name mi mobile 1 qty okay mi mobile 1 qty dot text and if you want to give the product id also so you can just directly declare let's copy this and paste is equal to where not not one okay or you can tell one double zero one this will be the product id and now guys once you click this where it should go when we click on buy now it should go to checkout page so this checkout page so let's write that code over here so what is that form name checkout checkout dot show function before that you need to close this me dot hide function okay so let's save this and same way you have to code for the second button also so let's double click on this and let's copy and paste this now this will be the product id2 and this will be the mmr while 2 and with this also 2 and this finally m i q t by two mobile okay save and then again you are going to show that so guys now let's execute and see we need to fetch these values where we need to fetch this value inside this checkout page inside this text box right so for that what we have to do uh let us test once it is coming to this page or not when we click on this buy now button so let's start this project okay so login wait gmail.com one two three four five six click on login logged in successfully let's move to mobile and this is by now we are going to add the quantity 2 by now see you can see that checkout page has come so over here we need that the value so product name price and the quantity and total price so let's get back guys so let's close this stop the project and now as simple after this after this by now button you are going to checkout page so let's move on checkout page and start the code so double click on the form this is your form so i'm going to double click on it and you can find that checkout load over here okay so let's remove unwanted things we don't require so this is your checkout load page click once again it will be over here load checkout page load so now let's import that class just now we created so this class only are going to import let's copy import the project name funda project dot your class okay and then call that values so what value you are going to call the variables product id so product id we didn't create in this page so we'll directly fetch the product name over here so let's fetch that product name so whatever we have passed inside this c this value is passed inside this and this value is stored over here so this stored value we are going to fetch over here so first you need to go to checkout page over here product name so you can see that product name is defined right sprout name so let's type prod prod name dot t e x t is equal to where you are going to get this product name and store inside this product name that's it so same way again go to checkout you can see prod price so that's label name let's type prod price dot t e x t is equal to product product underscore price so this is my class which is class variable name and then which is the quantity so let's get that quantity broad qty dot t e x t so inside this is equal to where product underscore qty the class name and now the total of this total price the price and multiplied by quantity will be your total price so let's get back product product total price dot t e x t is equal to let's put braces round braces and then let's tell this product quantity into i mean product price into product quantity now let's save and guys let us see that so it's working or not all the value is fetched inside this and now let's start this project login with gmail.com123456 login ok mobiles so i'm going to select redmi note 8 so 12 9 quantity is 2. so let's give by now you can see that redmi note 8 value is patched and the price and the quantity is 2 and this is multiplied and shown the total value so this is how you get all the values from that page to this page okay so let's close this and again select with the mi where i am going to update with the new one red mi so let's take this value quantity one let's click on buy now you can see that redmi so this is how we have covered about this fetching from one page to another page data so as you can see that this text box is editable right so you can see that you can edit this so we don't want to edit right so for that you need to just change some settings over there so let's close this project and stop now select this your text box and go over here on the behavior go to its property on the behavior and make this enabled which will be false okay so let's select false go to its product price also which we don't want to change over there let's move to behavior and go to enable and go to false same way you can move with the quantity false and the total price which will be behavior as false let's save the project and now let's debug start your project and check that so let's login once again with gmail.com123456 login logged in now let's select this and let's click quantity two by now you can see that the product name is shown and but it is disabled so guys you can design this text box in a very good manner so that will be visible so guys in this video that's it let's see next video about how to store this value and do cash or card payment online payment thing in further videos so guys thank you for watching this video please subscribe like and share
Info
Channel: Funda Coder
Views: 13,515
Rating: undefined out of 5
Keywords: fundaofwebit, how to pass data from one form to another form in vb.net, how to make product page form in vb.net, how to make billing page form in vb.net, checkout form in vb.net, billing form in vb.net, passing a value from one form to another form in vb.net, pass value to one page to another in vb.net, pass data from one form to another, how to get data from one form to another form, how to make a project in vb.net, how to create project in vb.net, vb.net project
Id: _hPUemWr8Bo
Channel Id: undefined
Length: 24min 7sec (1447 seconds)
Published: Thu Mar 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.