Beispiel #1
0
        private void SetCustomerLanguage(int languageId, int storeId)
        {
            var objAttribute = new Domain.Entities.Data.GenericAttribute
            {
                EntityId    = CurrentCustomer.Id,
                KeyGroup    = "Customer",
                Key         = "LanguageId",
                Value       = languageId.ToString(),
                StoreId     = storeId,
                CreatedDate = DateTime.Now,
                UpdatedDate = DateTime.Now
            };

            var attribute = _genericAttributeService.GetByKey(objAttribute.EntityId
                                                              , objAttribute.KeyGroup, objAttribute.Key);

            if (attribute == null)
            {
                _genericAttributeService.Create(objAttribute);
            }
            else
            {
                attribute.Value = languageId.ToString();
                _genericAttributeService.Update(attribute);
            }
        }
        public ActionResult GenericAttribute_Update(GenericAttribute model)
        {
            try
            {
                var genericAttribute = _genericAttributeService.GetAttributeById(model.Id);
                genericAttribute.Id          = model.Id;
                genericAttribute.EntityKey   = model.EntityKey;
                genericAttribute.EntityValue = model.EntityValue;

                _genericAttributeService.Update(genericAttribute);
                return(new NullJsonResult());
            }
            catch (Exception)
            {
                return(new NullJsonResult());
            }
        }
Beispiel #3
0
        private void SetCustomerLanguage(int languageId, int storeId)
        {
            App.Domain.Entities.Data.GenericAttribute objAttribute = new App.Domain.Entities.Data.GenericAttribute
            {
                EntityId = 1,
                KeyGroup = "Customer",
                Key      = "LanguageId",
                Value    = languageId.ToString(),
                StoreId  = storeId
            };

            var attribute = _genericAttributeService.GetGenericAttributeByKey(objAttribute.EntityId
                                                                              , objAttribute.KeyGroup, objAttribute.Key);

            if (attribute == null)
            {
                _genericAttributeService.Create(objAttribute);
            }
            else
            {
                attribute.Value = languageId.ToString();
                _genericAttributeService.Update(attribute);
            }
        }