Пример #1
0
 public HomeModule()
 {
     Get["/form"] = _ => {
         return(View["form.cshtml"]);
     };
     Get["/story"] = _ => {
         ParcelVariables myParcelVariables = new ParcelVariables();
         myParcelVariables.SetHeight(Request.Query["height"]);
         myParcelVariables.SetLength(Request.Query["length"]);
         myParcelVariables.SetWidth(Request.Query["width"]);
         myParcelVariables.SetWeight(Request.Query["weight"]);
         return(View["output.cshtml", myParcelVariables]);
     };
 }
Пример #2
0
 public HomeModule()
 {
     Get["/calculate"] = _ => {
         ParcelVariables myParcelVariables = new ParcelVariables();
         myParcelVariables.SetWidth(Request.Query["width"]);
         myParcelVariables.SetLength(Request.Query["length"]);
         myParcelVariables.SetHeight(Request.Query["height"]);
         myParcelVariables.SetWeight(Request.Query["weight"]);
         return(View["index.cshtml", myParcelVariables]);
     };
     Get["/favorite_photos"] = _ => View["favorite_photos.cshtml"];
     Get["/form"]            = _ => {
         return(View["form.cshtml"]);
     };
 }
Пример #3
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]);
            };
        }