Example #1
0
        // GET: ShipOuts/Edit/5
        public ActionResult Edit(int?id)
        {
            var shipouts = db.ShipOuts.SingleOrDefault(c => c.ShipOutId == id);

            var customers         = db.Customers.ToList();
            var customerdivisions = db.CustomerDivisions.ToList();
            var freighttypes      = db.FreightTypes.ToList();
            var fpaymentmethods   = db.FPaymentMethods.ToList();

            var viewModel = new SaveShipOutViewModel()
            {
                ShipOut           = shipouts,
                Customers         = customers,
                CustomerDivisions = customerdivisions,
                FreightTypes      = freighttypes,
                FPaymentMetods    = fpaymentmethods
            };

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ShipOut shipOut = db.ShipOuts.Find(id);

            if (shipOut == null)
            {
                return(HttpNotFound());
            }
            return(View("Edit", viewModel));
        }
Example #2
0
        // GET: ShipOuts/Create
        public ActionResult Create()
        {
            var customers         = db.Customers.ToList();
            var customerdivisions = db.CustomerDivisions.ToList();
            var freighttypes      = db.FreightTypes.ToList();
            var fpaymentmethods   = db.FPaymentMethods.ToList();

            var viewModel = new SaveShipOutViewModel()
            {
                Customers         = customers,
                CustomerDivisions = customerdivisions,
                FreightTypes      = freighttypes,
                FPaymentMetods    = fpaymentmethods
            };

            return(View("Create", viewModel));

            //return View();
        }