public ActionResult Create(Product product) { if (ModelState.IsValid) { try { _productService.CreateProduct(product); this.ShowMessage("Land created successfully", MessageType.Success); return RedirectToAction("Index"); } catch (Exception ex) { this.ShowMessage("Error on data generation with the following details " + ex.Message, MessageType.Error); } } ViewBag.CategoryId = new SelectList(_categoryService.GetCategorys(), "CategoryId", "Name"); ViewBag.ProjectId = new SelectList(_projectService.GetProjects(), "ProjectId", "Name"); return View(product); }
public void UpdateProduct(Product product) { _productRepository.Update(product); Save(); }
public void CreateProduct(Product product) { _productRepository.Add(product); Save(); }