Exemplo n.º 1
0
        public ActionResult Action(tblProductAttribute objSubmit)
        {
            if (objSubmit.ID == 0)
            {
                objSubmit.DateCreated = DateTime.Now;
                objSubmit.DateUpdated = DateTime.Now;
                objSubmit.IsDeleted   = false;
                objSubmit.IsShow      = true;
                productAttributeRepository.Add(objSubmit);
            }
            else
            {
                var obj = productAttributeRepository.GetById <tblProductAttribute>(objSubmit.ID);

                UpdateModel(obj);

                objSubmit.DateUpdated = DateTime.Now;

                productAttributeRepository.Update(obj);
            }

            return(Json(new
            {
                Error = false
            }, JsonRequestBehavior.AllowGet));
        }
        public ProductAttribute GetProductAttributeById(int productAttributeId)
        {
            var productAttribute = productAttributeRepository.GetById(productAttributeId);

            return(productAttribute);
        }