public void InsertManagerProductTaxEdit(ProductTaxEditViewModel model) { var item = Mapper.Map <Tax_Products>(model); m_ContentContext.Tax_Products.Add(item); m_ContentContext.SaveChanges(); }
//GET: Admin/TaxManager/Create public ActionResult Create() { this.StatusList(1); var model = new ProductTaxEditViewModel { Status = 1 }; return(View(model)); }
public void UpdateManagerProductTaxEdit(ProductTaxEditViewModel model) { var query = from t in m_ContentContext.Tax_Products where t.Id == model.Id select t; var item = query.FirstOrDefault(); Mapper.Map(model, item); m_ContentContext.SaveChanges(); }
public ActionResult Edit(ProductTaxEditViewModel model) { if (ModelState.IsValid) { try { m_taxWorker.UpdateManagerProductTaxEdit(model); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError("Generic", ex.Message); } } this.StatusList(model.Status); return(View(model)); }