Ejemplo n.º 1
0
        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"));
            }
        }
Ejemplo n.º 2
0
        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));
            }
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 6
0
        public ActionResult Parcels()
        {
            ParcelVariable myParcelVariable = new ParcelVariable();

            myParcelVariable.SetRecipient(Request.Query["recip"]);
            string stringWeight = Request.Query["weight"];

            myParcelVariable.SetWeight(int.Parse(stringWeight));
            string stringDimX = Request.Query["dimX"];

            myParcelVariable.SetDimX(int.Parse(stringDimX));
            string stringDimY = Request.Query["dimY"];

            myParcelVariable.SetDimY(int.Parse(stringDimY));
            string stringDimZ = Request.Query["dimZ"];

            myParcelVariable.SetDimZ(int.Parse(stringDimZ));
            return(View("Parcels", myParcelVariable));
        }