Beispiel #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 void CreateProductAttribute(ProductAttribute productAttribute)
 {
     productAttributeRepository.Add(productAttribute);
     SaveProductAttribute();
 }
Beispiel #3
0
 public async Task AddToDb(ProductAttribute productAttribute)
 {
     await _repository.Add(productAttribute);
 }