Пример #1
0
        //get
        public ActionResult CreateWorkOrder(int iD)
        {
            var theListing = _repo.Listing.GetListing(iD);
            ListingWorkOrderViewModel theVm = new ListingWorkOrderViewModel();

            theVm.Listing            = theListing;
            theVm.ListingId          = theListing.ListingId;
            theVm.Listing.WorkOrders = theListing.WorkOrders;
            return(View(theVm));
        }
Пример #2
0
        public ActionResult CreateWorkOrder(ListingWorkOrderViewModel theVM) //somewhere the List<WorkOrder is becoming null. Workorder still tied to listing though
        {
            WorkOrder wo = new WorkOrder();

            theVM.Listing = _repo.Listing.GetListing(theVM.ListingId);
            _repo.WorkOrder.CreateWorkOrder(wo);
            wo.Name        = theVM.Name;
            wo.Description = theVM.Description;
            wo.IsCompleted = theVM.IsCompleted;
            wo.ListingId   = theVM.ListingId;
            _repo.Save();
            return(RedirectToAction("MyProperties"));
        }