public ActionResult OnSubmit() { string length = Request.Query["length"]; string width = Request.Query["width"]; string height = Request.Query["height"]; string weight = Request.Query["weight"]; int num2; bool validLength = int.TryParse(length, out num2); bool validWidth = int.TryParse(width, out num2); bool validHeight = int.TryParse(height, out num2); bool validWeight = int.TryParse(weight, out num2); if (validLength == true && validWidth == true && validHeight == true && validWeight == true) { ParcelVariable myParcelVariable = new ParcelVariable(); myParcelVariable.SetLength(Request.Query["length"]); myParcelVariable.SetWidth(Request.Query["width"]); myParcelVariable.SetHeight(Request.Query["height"]); myParcelVariable.SetWeight(Request.Query["weight"]); return(View("Hello", myParcelVariable)); } else { Console.WriteLine("SORRY THIS DOESNT WORK"); return(View("Form")); } }
public ActionResult Output() { // string myHeightString = Request.Query["height"]; // int myHeight = int.Parse(myHeightString); // string myWeightString = Request.Query["weight"]; // int myWeight = int.Parse(myWeightString); // string myWidthString = Request.Query["width"]; // int myWidth = int.Parse(myWidthString); // string myLengthString = Request.Query["length"]; // int myLength = int.Parse(myLengthString); ParcelVariable newParcel = new ParcelVariable(); Console.WriteLine(Request.Query["height"]); if (Request.Query["height"] != "" && Request.Query["weight"] != "" && Request.Query["width"] != "" && Request.Query["length"] != "") { newParcel.SetHeight(int.Parse(Request.Query["height"])); newParcel.SetWeight(int.Parse(Request.Query["weight"])); newParcel.SetWidth(int.Parse(Request.Query["width"])); newParcel.SetLength(int.Parse(Request.Query["length"])); // Console.WriteLine(newParcel.GetHeight()); // Console.WriteLine(newParcel.GetWidth()); // Console.WriteLine(newParcel.GetLength()); // Console.WriteLine(newParcel.GetWeight()); return(View(newParcel)); } else { // MessageBox.Show("Please fill out all the boxes.", "Error message", MessageBoxButtons.OK, MessageBoxIcon.Error); string error = "Please fill out all the boxes."; return(View("Form", error)); } }
public ActionResult ParcelGroup() { ParcelVariable myParcelVariable = new ParcelVariable(); myParcelVariable.SetLength(int.Parse(Request.Query["length"])); myParcelVariable.SetHeight(int.Parse(Request.Query["height"])); myParcelVariable.SetWeight(int.Parse(Request.Query["weight"])); myParcelVariable.SetWidth(int.Parse(Request.Query["width"])); return(View("Parcel_Info", myParcelVariable)); }
public ActionResult Results() { ParcelVariable myParcelVariable = new ParcelVariable(); myParcelVariable.SetWidth(Request.Query["width"]); myParcelVariable.SetLength(Request.Query["length"]); myParcelVariable.SetHeight(Request.Query["height"]); myParcelVariable.SetWeight(Request.Query["weight"]); return(View(myParcelVariable)); }
public ActionResult Parcels() { ParcelVariable newParcelVariable = new ParcelVariable(); newParcelVariable.SetWidth(int.Parse(Request.Query["parcel-width"])); newParcelVariable.SetLength(int.Parse(Request.Query["parcel-length"])); newParcelVariable.SetHeight(int.Parse(Request.Query["parcel-height"])); //newParcelVariable.GetVolume(int.Parse(Request.Query["parcel-height"])); return(View(newParcelVariable)); }
public ActionResult Parcels() { ParcelVariable myParcelVariable = new ParcelVariable(); myParcelVariable.SetHeight(int.Parse(Request.Query["height"])); myParcelVariable.SetWidth(int.Parse(Request.Query["width"])); myParcelVariable.SetLength(int.Parse(Request.Query["length"])); myParcelVariable.SetWeight(int.Parse(Request.Query["weight"])); myParcelVariable.SetDistance(int.Parse(Request.Query["distance"])); return(View(myParcelVariable)); }