예제 #1
0
        public void InsertManagerProductTaxEdit(ProductTaxEditViewModel model)
        {
            var item = Mapper.Map <Tax_Products>(model);

            m_ContentContext.Tax_Products.Add(item);
            m_ContentContext.SaveChanges();
        }
예제 #2
0
        //GET: Admin/TaxManager/Create
        public ActionResult Create()
        {
            this.StatusList(1);
            var model = new ProductTaxEditViewModel {
                Status = 1
            };

            return(View(model));
        }
예제 #3
0
        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();
        }
예제 #4
0
 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));
 }