Restaurant App in MVC C# Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
well in this video we are going to create the restaurant app application in the restaurant up application there you can create the order you can delete the atom you can check the history and you can delete the order before we are going to start I would like to ask you a favor if you found this video helpful please like and subscribe my channel let's start first we are going to create their database open the SQL server right click on a database new database and here I am right here there's trained TV click on ok first I'm going to create that three this Kiba 30 schema will be the master the master schema or will be DP u object click on OK now here the table was table with that customer letter to the customer ID end and your customers name make your primary key but the properties here you can write like a customers and the schema will be the master identity column with the customer ID please save that table and refresh it you can see that master our customer and another one with the item so it was with the item id make end this one make a primary key then item name and item price decimal now go to the properties write the items in this schema will be master and identical I will be the item id save that now another one is that payment type that payment type I T make your primary killed here they will do right like the demon type do with the wear caps a q150 right now payment that name go to the properties right here payment types and select the schema and I can click on update payment type ID and save it now I'm going to add some dummy data to close all documents refreshed at first I'm going to add the customer here I'm going to add some dummy data customer e we see [Music] he and another one I'm going to add the items so little bit tea so here you can see that I have added some Demeter kind of payment types I'm going to add like a gas and did it okay now top in the visual studio get the new project right under project then click on OK select the empty and receipt and click from here now you can see that project has been created first of all I'm going to add that entity remember right click and models add new item and select that data ad rotted entity model and here what it will be the best friend we model click on next username password and then your databases restaurant it will click on OK yes next next and select the tables later we are going to add more tables because first of all in the mean pages it's required that three table that customer item and payment ID so select all and click on finish now you can see here if in the IDS where file there is a three taper or three entity that is a customer a demand payment type so now I'm going to create that view model and that in the few models so I am going to create the class that is the first one is that item view model okay next one is that payment payment I'm immortal and third one is customer you murdered so let's start with that item you modern so what I actually mean purpose that view model is that because in that database and the table there is so much more on which one is not required in for MVC just like in date all those things although some of the fields is not required in embassy where I am going to use so that's why we are creating that view model so we model is basically the which field is required that fields I am going to add in the new model and another part is that if we are going to change anything in that entry or that table in the database I mean just like if you change that particular column name you something a was there then you say have changed to the B so if you well if you will not use that view model then every places you have to change in that all the project where you have used that particular column that all the places you need to change so that's why you have creating that fund that I VM order so one places if it's change a to P so one places only them in the view model you can change that one that particular need to be just released and it will affect to the whole project so that's why we are getting there to be model that is second one is your item dean and third one is your item price mr. 9 the payment terms let's start I don't know what's the problem with your research but neither work see in this is that payment type payment type ID that another one visa payment happening to do the string that is time name third one is your customer so that returns the customer ID see again it's a term that is a customer ID and next one is your string festival day okay mystery field now I'm going to create the repository so add one folder that will be the repository repositories and right-click on the repository add class that will be first one is your customer repository next twenty years old I thought it was a tree item depository third one is your payment type third one is for payment so if I start with the pmontap I am going to create the constructor of constructor the entity's name is reg tool and there's 20 entities we are going to create that object restaurant DB entities variable now I'm going to create that object okay next one is that it will return that select item list select list item okay so get all payment so it will be returned Nega return offer still ripped and this one it will start from your obj in that entity stock payment I'm introduced our payment types then select it's a necklace type of item your first phone is the text then it will be then just select item dot no this one sorry obj dot your payment type name next one will be the value that opt tower payment type ID this will need to convert into string and here if you selected it will prove then automatically by default or into the selected just change this one to the same things need to copy just copy from here and open that item repository just paste it here just copy this one import and this one instead of the minterms it will become like items and obj dot item name and here that item ID that is transform your here get all items that is it now seemed 1e2 copy for your customers just copy this one that for customer repository this one is customer repository that all customers that all customer here I'm going to select this customer and instead of that item name it will be that a customer mean and I instead of ID it will be the customer ID that is done we created that now I'm going to add the controller the right click on a controller add controller that empty controller will tell you the name of the home controller now right-click on a action method add a view that will be the index view and that we were a spectator here because I have to pass in that index view three different your view model so they'll just women even way to pass from controller to view in a multiple model so here I am going to use that topple so it will be the I'm in the middle of your select list of item then another one is that also that I know very well that select stop item and because three I am going to pass first one is a customer item and demented if you pass like that this one is I'm going to use that Apple here and create that object so here just tease this one to make you mad because he promised long this paste it here okay and this one this one we have to move to the new line and here that I'm going to give that repository for your customer repository customer repository so ODG a customer repository to the new system of the puzzle tree and this one first first one is your I'm going to pass that focus to my deposit area so just to pass the customer positive dot get all customers then next next one is your item depository so item repository the ovg item depository felt a new item depository so the second one will be the item repository dot a lot hit all items third one is your payment type so here I'm going to add a payment I'm the repository obj your payment app depository equal to new event type repository so third one is you get on a meantime till now it's done so I'm going to return to view that particular object so this one will be the yield model go to the view open there to you in the solution Explorer that view is here I'm going to write like you're a direct model and you can see this one so because it's not coming by if you are going to use topple so that times it will come like an item 1 item 2 item 3 so you have to know that one which one is the item 1 so once you go to the controller first one is that customer that item 1 is the customer second one is your items third one is your payment so just keep in mind this thing's okay just said now going to start designing this one delete this one first one is Atlas hand filss it just put it here to save it like the first one is that I'm going to like to have a store and first one so here I'm going to divide that in the first one the restaurant it will display that customer or your payment time so just start that one div class container I'm going to use that bootstrap so the class container second one is your row that is a class is called a row okay this one is a row then another one is your divide into that class would take column meat that it will be the six okay so first one is that your div it will with that class that group that will be the form group okay next one here I'm going to write like the first one I'm going to select the customer this one is the customer next one would be the drop-down so this one is a drop-down list first one this one is a customer so I'm going to act like a customer and your model so that's if you click place the dot you will see that item 1 item 2 item 3 so here if in the home controller first one is that your customers you know means item one is your customers so this one is the item farm so this one it will become inside the cell new select list make your bracket select least first one is your model this second when you were actually reads this is the value and third one is here touched the next is your optimal attributes so it will be the new new at the rate class so it will be the your form control this one is done so first one is your customer okay next one will be that your payment then just copy this one and this paste it here instead of customer I'm going to like a payment type this one is a peer mentor and that is the first one I am going to write like a payment type okay that is done so second one third one is your payment type so I turn three will be the your payment I'm if you look at item 3 is the game in time look at this dis done that - is this done so I'm going to change something for that design just run the application let's see or it will be look like now you look like this one the first one is the customer and second one is your payment type okay I am going to change something or design this one this customer if you want go to the hair pin this time first building up our copy this one this particular project designed this is the CSS searchers sorry load again okay nice look like okay first one baby select the customer the second one is your payment type they will select okay now in the next one we are going to add so there they will add that select that items your quantity your price and total it will display an discount also so come to the visual studio again I am going to write like if your failed set okay then listened okay so this one will be the your restaurant item items to save and replace that will come with bottom of this one yeah Nordstrom in the restaurant items so first one they will selected items so I'm going to clear that div dead glass then it will be the container okay then do that class it'll be the row then - this one out so I'm going to divide it into two parts - mine's like a two column so column then it will be the six that is done here I am going to add that Dave that class will be that your form group Foam proof in the formula it will be the item and next one I'm going to see in things I'm going to copy but instead of three it will be two and that pigmented it will be the item okay now save it and reload again here it Wilson you can see that all those item the next one will will be your item price here it will display the item price per Tara once you will going to select this one this Apple so automatically that item price will be displayed here so same things I'm going to copy this one so here that will be the unit price and this one need to delete to write like input type your text but it will will be read-only because you need prices are not allowed to change then if it's a read-only then ID make your tht unit price okay first one is the unit price then value well they will be use 0 first time name will be the unit price then mortals I'm going to add that is a you plus class will be that form control yeah you can see this one is gonna be better you can make in other ways it's so make it to only now again I'm going to pop it til here and paste it this one is that quantity quantity and this one after that discount this one is a discount just copy this one and paste it here because quantity this one is the TST quantity and this one is worth quantity with a zero one zero okay then discount discount will be not read only you can use the discount so this one there turkey as t20 discount here Alfred William discount okay till nuts with now in the bottom it will display the total so this one tht total right here total this one also total and instead of that discount here I'm going to add that input type that is a button add to the list this one with the button and the value will be the to list a next name I'm going to write like you to list then raise to a next one we're going to add an ID that button I have to list this one is add to list the next one that that heidi still not going to add a class that it will be the button button does success the sample tried to save it and reload again let see the load yeah but it's little bit up night so quantity should not be read only first to remove that quantity their trade only this one this one should be okay this one is not read only and that but I'm going to use the style margin from top margin top I'm going to write a fight itself not so move a little bit more down change to not alert nice look perfect night I had to list they're over there moodle's multis I'm going to change into three columns because splitting too much space okay first one over the item then you realized in quantity then discount total and add to list me to the three column the straight items it will mean straight up six it will be the four instead of 60 it will be the four at this one to the top here just make it four okay this one also it will be the four then this to remove this lastly this one copy not equal to four and you for receive it save it let me see that yeah because in the quarter part we have to add so that I transmission we are going to add here so it will be soap in the bottom and this quantity this alignment should be right so every element style text-align:center not awkward only for that unit price the sound nice perfect Landon now I'm going to add here when table so once you are going to click on add to list so it will be added to the table that last part is said again I'm going to add the field list intelligent in the reagent the dentist at items now went right the cable it will be the style width will be hundred percent so now litter the key head PR then th first will be that the your item ID this one with the hidden field so make this one is first item ID next one it is your item name you light on them this will not get in the next will be the unit price the tears this one give me the unit price the next if it's a unit price then it will be the quantity then it will be your discount then total and one ball will come that for axle action in the same space delete you want to remove the title so it will come into the action and it Lord yeah I'm going to plus going to the disgruntled tutorial I said okay that is done no-till knots done that part now going to call one jQuery open the script forward and move to the jQuery adhere draperies I'm going to write that a script tag should type equal to your javascript next one of your dollar document dot ready and it will be the function it is so first what I'm going to write once you are going to select this Apple okay so automatically that unit price would come display here once I am going to select the burger so display the unit price or burger and it's a franchise then your french fries unit price will display so I will do that the script tag again I'm going to write like a dollar your item name what's the name of an item that is your item so just paste it here okay make your space this one dot your value so this one it will actually it will be the your item ID okay but once you are going to select that you are going to change some things that time certifier so first I'm going to write it like a concern here it will be the gate unit price so here that value balloons instead I'm going to right-click the item ID so in sort of item ID look at that to place so first of all I'm going to start that dollar with JX ejects then we are going to right first one is that you sing it will be the true type it will be the gate type them data type it will be the magician director position then content content time it will the application this injection cursor is equal to u TM test heat print that understand then data here I'm going to write like item ID item ID that is your data then URL URL will with your home slash get item ID Egypt item by unit price okay this was the then success so let me to look at the phone son and it will return the data then data data will be your unit price then yeah give me price like the Nerds okay here this one will be the where your item item ID will be the value and then when it was going to fire the start use change this one should be fine first remove the item then I totally okay that is done then stop dipping you need to create that one matter that is your get unit price open that controller home controller create the attraction public adjacent result here it will be the end item ID okay now we're going to write it because it will return the decimal so this will be the unit price equal to your en AXA you to create that one entities just like this that this one that object so now this value dot items that single or default or single only then model model dot item ID equal to item ID doubt unit applies at item by 0 so this one is the unit wise what it will return the return Jason first one is so related class and then actually the behavior what is it love it okay till hurt so it's okay here by default it will be the edge to be get on the but I'm going to write like a stupid and open the index this one is you're done here need to write like a hash sorry has this one they with that this one is the ID selector dot chain then we'll call okay so it will pass that item id this ones will come here that is item ID okay now going to assign so what's the unit price textbox named this one is a unit of my sight what's the name TFT unit price so right here what is that okay yeah it'll be the dollar ID selector dot value we live them to your doctor the heat the year I'm going to convert this one to parsefloat this one fast mode because I'm going to formatting to the smell dot-to-dot to fixed with her pro decimal not on the application okay this means Apple I'm going to select this one too brother so here getting that module now going to select that Apple will get that Apple value knife will change the french fries will get them french husband now the rice then it's getting the rice value noodles we are changing them you can see that here it's really good changing okay this one is changing now I'm going to add with just like a 2250 and I'm going to do that discount 21 so I am going to click or before that clicking if I'm changing some value some like a 50 so this total also sought to change granite so this one this total should we changed once you are going to change this on orange okay so the value is same so this one will make it 30 just reload again once I want you to see something well because if my Apple is automatically selected first that unit price is not change okay once you are going to start changing then you've seen value is changing first I will fix this problem open that I tell repository here you'll see that it says selected making false now on the plication let's say it should we by default it should be blank so it's it's coming in the first half once the page will load that particular item fields will be blank it's not changing because history's the page load time where is that please Lord let's open it index folder mediate this value document not ready I'm going to file change to this world over to 0 first 1 it will be 0 if first time was to document will be ready so it should we make a blank reload that see not sublime now that it's forcing to user first select that so this you can see now that allows changing okay now start with the quantity was able inter are that one changing me keep please now we're going to create that one method that one concern that is a calculate subtotal this is a fraternity okay that is that so first of all to understand what all things is required first one is that your unit price this one is required for calculating so this one is require so how you will get that unit place unit price will get where your txt you gives t even place over here just copy yes you know trash dot value so now we've got that unit price now next one is your quantity your quantity so how you will get the quantity has your est quantity dot value okay next one what's the next next is that your discount so discount to have your TST your discount discount or value correct so finally it will be that total so unit price into quantity minus discount so it will look unit price into quantity minus discount and it will be total so here writer where the total equal to your unit price into quantity - you discount your discount no discount now this one is your total right so this one you have to add into that your total total what's the name of the total react tht total see here I'm going to us in that value so how will its I'm taller and deselect the dot your value it will be your I am going to convert that hot your power slot are here it will be your total over total then who fixed to traditional delights okay so if you will call here so once when it will have had that particular calculate subtotal when it will have because I we don't have any button because we don't have anybody button to calculate this value so this should be calculated automatically okay once I am going to write like a here I felt right like a 20 so automatically that once I will leave from here okay so automatically it so we will be multiply that 50 into 20 if I'm going to write to get something discount like a 10 so it should be 50 to 20 minus 10 so what about this will be calculated so in the change event so unchanged so how we will try it for everyone in the window today I am going to write like a dollar here I'm going to write like a input okay so make a bracket once it will type equal to text dark change event will be the change then with a fun Sun this particular value that calculates total it is correct once it will be the input if input is type equal to text means of one of whenever I use that type equal to text or something look that input type equal to text input type equal to text or input tab equal to text that times this one so five to see and alert here here I'm going to select that from for some bloggers and if the unit price is 150 this into something 50 if I will move from here so see that is calculated v 150 into 50 so I'm going to write it to move that one it's coming there 300 if I'm going to write like a 10 so it will be calculate also get to 2021 15 to 2 so 300 minus 10 into your decision final total is 290 and it's coming that 2 decimals because of that you use them use that word to fixed so it's coming like a 2-1 still-lifes clear so now here once you are going to click on an ad then it should add into that particular list so here it should be had okay now what's the button name where you are going to click that add to need to mean know the name so that is just but an ADD list so go to the document or trading funds then just come here and here I'm going to write like that here also it will with the ID selector dot click click once and then it will be your function and now where did you get the one concern it will be that add to item just this one to call here to add to the item is this volunteer then so what all field is required first of all is your item ID item the item ID item lien so instead of item name so right like item two unit price quantity discount total and accent okay that's all filters we should required now start in the actor now first we'll check that one that your table metro right likely ID TBN your restaurant item list so this one is your ID just copy this one and put it here it will be the where is call to your TBN item list it will be that your ID selector this one here at a selected now same thing it's required because all those things is required so just copy and paste it there and now another thing is that your where your item ID item ID is also required this one for ID selector that will be the item dot value this one is it is getting their item ID now just say that it's item only linked yeah this one is item now another one is your item name so by item name so how will you get that item item name is going to ID selector you write item selector spit it will be the option selected print dot test so which one you are selected that it will be come here so all things what all field is required that is done here so pin this one item ID one that one is a hidden field unit price quantity discount total salting item ID item name unit price quantity discount and total that health is with another will to write like your where item list that one is going to be add when I'm first angle to start with a TR then your TD first turn is done then TD frustrated with the item ID that will we have to make that hidden so this one T DS will be open so I'm going to write luggage today my term ID then you're first to do the close then second TD will be open then + here it will become that item name ok seem like under just copy this one so after that item name it will be the unit price so right after he read price plus then after that you read place but a little bit unit price that quantity then discount then that quantity wasted quantity and here 20-day is done after that quantity it will be that discount plus again that it will be dead discount discount is done after the discount it will become total so total right total so based teeth so one thing to notice that then the last one is the total but one more thing one button so do we have that will be far removed so that one we are going to write here so this one is easy for me because here you can see that intelligence is coming this will be the button then value it will be the button oh sorry value will be the delete or remove mean also it will be the remove and that class I am going to use that is your button but understand sir this one and your conflict we'll be able to remove item and pass - this instead of double quote should replace with a single goat this one will do the single quote this one the single in straight-up devil should I use their single goat instead of devar we still give a single quote this set of double - reduce that single quote this one else around that single quote yeah well things has been done here so now cut and paste it here so last one is your your total but I'm going to add T DT D here I'm going to write it like a TD then last one you have to close that TV inside here you can write like a close that TD and close that TR all so that now this one they will list dot append upend your item list after that we should reset that value so going to add that once on a reset item just copy on this 20 hours of sleep I said 20 I'll serve it at hood then after quantitate the discount also sort of it I said discount all sorts of useless item well that I'll switch over recept this item ID said please serum okay I understand then total assets should be reset total where you've got the total this one this would come in the reset here now your receptor so it research item has been 10 answer this was what happened where everything has been done this one you can make a formatter so that is it had to decimal this our smart down to fixed to fixed - fixed this one also - without negative fixed so it will come at like a two decimal so it will be looking good - fixed okay now save it and reload the application just reload first of all I'm going to select that orange it's a 70 with unit price going to a 5 then it will be the 350 then change to this 1 to 5 I'll make it came first was to be 340 now you can see that 340 once you are going to click to add to list you can see you sent it your 70 is the unit price then quantitate and discount then total its reset also again I'm going to add the noodles so that I want to quantity 0 discount so click on add to list you can see that your noodles has been added ok again that it will track french fries and want one quantity 0 discount and click on add to list and it here you can see that it's now your list has been added now once you are going to click that remove it so to remove so that also we can do this one is your funds and we have created so called create one France and that is your once I remove that I am going to write like the item id this one is item id dollar this one is your item ID dot so dark that is a closer than gives possessed this closes what's with the closest that is a DF than have been remove that closest a particular item I did that one and the closest closest missed the nearest row and we were saying that one nearest that particular row there that particular row we have to remove that's how this one you can see that one so you got to play move now save and reload again they said note that select that items bother to and click on add discount also to make that zero this will be good go to that we set one dataset item where is the discount that right - to the point 0 0 okay reload again select item at a noodles 5 quantity ad in the list then again burger it will be the 5 quantity and to the list and again that rice this values a to credit e and to the list okay this one is ended now if I want to remove that bugger so click on remove so remove if I want to remove that noodles so click on remove that poodle sylvilla book for enduring of that rice also just to remove it that system right one more thing we can do here this one that customer this one also I am going to make it because here you can see it's a two column right I am going to divide into three column third one column it should display the total the final big one which will be the display the total to total of this value okay so change to two column two three garden this one is a two column right one more column I'm going to add this one going to add okay she is the event tab set up tonight I'm going to me write a total and then change to you know for this one will be the for this one also do the for the total into the moves so here input type text and it will have the read only read only then friendly ID is equal to tht final total and Alto tell then class will be the form control the form control okay this one is their form control this is a total anything else is required to aged when Lucas time values will be 0 1 0 0 and need that also it I'm going to write Peggy find them portal that so this one is your final test so copy just below it should with number 3 with load that one this one also should come with 3 Carlo customer payment type and final this one will be a proper total I am going to move this one into alignment which will be right so that style text-align so we write then save it now it will be the load the test a lens will be right yeah sorry okay now I'm going to calculate the final total where it is that calculated at adding that items there TVL this one here we are appending then cleared of concern and it will be the final item total so first of all use the ID selector of that random top value first time to make you see set 0 which is reshooting that was the name of that give it of it this one then dollar so you have to use that pitchman son this dot find okay it's fine j'tia greater than zero because the first first drawing is it not allowed to take then each one's own then we're going to write that function so finally we have to take that total wave total equal to dollar dot this dot find your TD u TD dot equal to which number is then start your test so need to change that which number is that first one is the item id 0 1 2 3 4 5 that is a 5 so we also write like a five the text and here where that is a your subtotal here I'm going to let a man with a finer to tell well 20.00 final total to make them like a new total class welcome your total okay so now this one seems to your final total again we can write like a password that value DARPA fixed you to to this one that is and this one your final total should come after yeah right that has just dot find the total has sounded save it and reload now here that totals would be display still just reloading now select the item like a pizza 452 quantity then the clue benign left click on hat didn't do it then noodles two quantities that it will be the 160 so he you can see that total it's coming again if we are going to write their price to quantity click on add and read the orange here five quantity which will be that so here you can see the total and there select the payment I'm doing this one is a team in time and here you can see that total I hope it's a clear in the next video we are going to see that I am going to add that one button that is called save once we are going to click on save then it will be saved on the database so here you can see that one so maybe that going to add to here or it will sort of be I am going to add here just I am going to add the simple one button to see button so in the last we are going to add that button this is a filled so class is not us please here I'm going to that let me input diet that will be the button there to value it will be the save name to do the save then ID going to add that is a button save order okay and then class I'm going to write like a button button button primary to enter library so this one turbot on now save it and reload then you can see one button so this button so this one I'm going to move that here that right side let's this time focus on it should not good taste the land should be flogged that's what will float floats would be light so reload one more thing you can do with make it little break point or make your mother change the until style module from top margin top I'm going to write a 50 pixel okay such as just load again let's see this one now it will go move to the right see nice going to the right now I'm going to add some item just make a pizza for entities arrange for quantities and burger to add that for entity so we can see it's moving and one should make it thin solid it's a little bit okay let's go further okay now said so okay well in the next video avanti I'm going to click on save then each sort we save on that your database okay I hope see clear thanks for watching and don't forget to subscribe my channel if we have unique comment please write around in the comment sections fionna queries write down in the comment section
Info
Channel: Tek Tuition
Views: 100,262
Rating: undefined out of 5
Keywords: Restaurant Management in MVC C#, restaurant management system project in c# free download, restaurant billing system source code in c#, restaurant management system c# github, restaurant management system project in asp.net with source code, source code for restaurant management system, restaurant application in c#, restaurant management system project in sql, restaurant management system github, Restaurant, MVC, Tek Tuition
Id: avOtyK-wfOg
Channel Id: undefined
Length: 78min 17sec (4697 seconds)
Published: Mon Aug 26 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.