Beispiel #1
0
        public void FromDto(ProductPropertyDTO dto)
        {
            if (dto == null)
            {
                return;
            }

            this.Choices.Clear();
            if (dto.Choices != null)
            {
                foreach (ProductPropertyChoiceDTO c in dto.Choices)
                {
                    ProductPropertyChoice pc = new ProductPropertyChoice();
                    pc.FromDto(c);
                    this.Choices.Add(pc);
                }
            }
            this.CultureCode          = dto.CultureCode;
            this.DefaultValue         = dto.DefaultValue;
            this.DisplayName          = dto.DisplayName;
            this.DisplayOnSite        = dto.DisplayOnSite;
            this.DisplayToDropShipper = dto.DisplayToDropShipper;
            this.Id             = dto.Id;
            this.PropertyName   = dto.PropertyName;
            this.StoreId        = dto.StoreId;
            this.TypeCode       = (ProductPropertyType)((int)dto.TypeCode);
            this.LastUpdatedUtc = dto.LastUpdatedUtc;
        }
        public void FromDto(ProductPropertyDTO dto)
        {
            if (dto == null) return;

            this.Choices.Clear();
            if (dto.Choices != null)
            {
                foreach (ProductPropertyChoiceDTO c in dto.Choices)
                {
                    ProductPropertyChoice pc = new ProductPropertyChoice();
                    pc.FromDto(c);
                    this.Choices.Add(pc);
                }
            }
            this.CultureCode = dto.CultureCode;
            this.DefaultValue = dto.DefaultValue;
            this.DisplayName = dto.DisplayName;
            this.DisplayOnSite = dto.DisplayOnSite;
            this.DisplayToDropShipper = dto.DisplayToDropShipper;
            this.Id = dto.Id;
            this.PropertyName = dto.PropertyName;
            this.StoreId = dto.StoreId;
            this.TypeCode = (ProductPropertyType)((int)dto.TypeCode);
            this.LastUpdatedUtc = dto.LastUpdatedUtc;
        }
Beispiel #3
0
 public bool ChoiceUpdate(ProductPropertyChoice item)
 {
     return(this.choiceRepository.Update(item));
 }
        protected void btnNewChoice_Click(System.Object sender, System.Web.UI.ImageClickEventArgs e)
        {
            msg.ClearMessage();

            ProductProperty prop = new ProductProperty();
            prop = MTApp.CatalogServices.ProductProperties.Find((long)ViewState["ID"]);
            if (prop != null)
            {
                ProductPropertyChoice ppc = new ProductPropertyChoice();
                ppc.ChoiceName = this.NewChoiceField.Text.Trim();
                ppc.PropertyId = (long)ViewState["ID"];
                prop.Choices.Add(ppc);
                if (MTApp.CatalogServices.ProductProperties.Update(prop))
                {                
                        PopulateMultipleChoice(prop);
                    }
                    else
                    {
                        msg.ShowError("Couldn't add choice!");
                    }
                    this.NewChoiceField.Text = string.Empty;                
            }            
        }