public JsonResult DeleteProperty(long id)
 {
     try
     {
         CatalogPropertiesBusiness catalogPropertiesBusiness = new CatalogPropertiesBusiness();
         catalogPropertiesBusiness.Remove(id);
         return(Json(1));
     }
     catch
     {
         return(Json(0));
     }
 }
 public JsonResult UpdateProperty(long id, string cataproname, string cataprokey, int typeproperty, int typedesignproperty)
 {
     try
     {
         CatalogPropertiesBusiness catalogPropertiesBusiness = new CatalogPropertiesBusiness();
         CatalogProperty           catalogProperty           = new CatalogProperty();
         catalogProperty            = catalogPropertiesBusiness.GetById(id);
         catalogProperty.Key        = cataprokey;
         catalogProperty.Type       = typeproperty;
         catalogProperty.TypeDesign = typedesignproperty;
         catalogProperty.Name       = cataproname;
         catalogPropertiesBusiness.Edit(catalogProperty);
         return(Json(1));
     }
     catch
     {
         return(Json(0));
     }
 }
        public JsonResult AddPropertyUpdate(long id, string propertyvalue)
        {
            try
            {
                CatalogPropertiesBusiness catalogPropertiesBusiness = new CatalogPropertiesBusiness();
                CatalogProperty           catalogProperty           = new CatalogProperty();
                catalogProperty = catalogPropertiesBusiness.GetById(id);

                CatalogPropertiesValue objCatalogPropertiesValue = new CatalogPropertiesValue();
                objCatalogPropertiesValue.Value = propertyvalue;
                objCatalogPropertiesValue.CatalogPropertieId = id;
                catalogProperty.CatalogPropertiesValues.Add(objCatalogPropertiesValue);
                catalogPropertiesBusiness.Edit(catalogProperty);

                return(Json(1));//Cập nhật thành công
            }
            catch (Exception)
            {
                return(Json(0));

                //write log
                throw;
            }
        }