Ejemplo n.º 1
0
 public static PlantDetail BuildDTO(PlantDomain.Plant thisPlant)
 {
     return(new DTObjects.PlantDetail
     {
         Sku = thisPlant.SKU,
         Name = thisPlant.Name,
         FormSize = thisPlant.FormSize,
         Price = thisPlant.Price
     });
 }
Ejemplo n.º 2
0
 public ActionResult Edit(PlantDomain.Plant plant)
 {
     if (ModelState.IsValid)
     {
         repository.UpdatePlant(plant);
         repository.Save();
         return(RedirectToAction("Index"));
     }
     return(View(plant));
 }
Ejemplo n.º 3
0
 // GET: Stocks/Edit/5
 public ActionResult Edit(string sku)
 {
     if (sku == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     PlantDomain.Plant plant = repository.GetPlantBySku(sku);
     if (plant == null)
     {
         return(HttpNotFound());
     }
     return(View(plant));
 }
Ejemplo n.º 4
0
        public ActionResult Create(PlantDomain.Plant plant)
        {
            if (ModelState.IsValid)
            {
                if (repository.AddPlant(plant))
                {
                    repository.Save();
                }
                return(RedirectToAction("Index"));
            }

            return(View(plant));
        }