Example #1
0
 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.cshtml"]);
            };

            Get["/parcel"] = _ =>
            {
                ParcelVariables newParcel = new ParcelVariables();
                newParcel.SetLength(Request.Query["length"]);
                newParcel.SetWidth(Request.Query["width"]);
                newParcel.SetHeight(Request.Query["height"]);
                newParcel.SetWeight(Request.Query["weight"]);
                newParcel.SetVolume();
                return(View["parcel.cshtml", newParcel]);
            };
        }