public HomeModule()
 {
   Get["/form"] = _ => {
     return View["form.html"];
   };
   Get["/parcels"] = _ => {
     ParcelVariables myParcelVariables = new ParcelVariables
     {
       Height = Request.Query["height"],
       Width = Request.Query["width"],
       Depth = Request.Query["depth"],
       Weight = Request.Query["weight"]
     };
     myParcelVariables.SetVolume();
     myParcelVariables.SetPrice();
     return View["parcels.html", myParcelVariables];
   };
 }
Example #2
0
 public HomeModule()
 {
   Get["/form"] = _ => {
     return View["form.html"];
   };
   Get["/shipping"] = _ => {
     Parcel myParcel = new Parcel(Request.Query["Width"],Request.Query["Height"],Request.Query["Length"],Request.Query["Weight"]);
     ParcelVariables parcelVariables = new ParcelVariables
     {
       Width = myParcel.GetWidth(),
       Height = myParcel.GetHeight(),
       Length = myParcel.GetLength(),
       Weight = myParcel.GetWeight(),
       Volume = myParcel.Volume(),
       CostToShip = myParcel.CostToShip()
     };
     return View["shipping.html", parcelVariables];
   };
 }