public PickerCollectionItemVM(ProductParameterValue value)
        {
            Id = value.Id;

            Value     = value.Value;
            ValueName = value.ValueName;
        }
Beispiel #2
0
        public CollectionItemVM(ProductDataType dataType, ProductParameterValue value)
        {
            DataType = dataType;
            Id       = value.Id;

            ValueName = !value.ValueName.IsNullOrEmtpy() ? value.ValueName : value.Value;
            Value     = value.Value;
        }
Beispiel #3
0
 public bool Add(ProductParameterValue _ProductParameterValue)
 {
     try
     {
         contaxt.ProductParsmeterValues.Add(_ProductParameterValue);
         contaxt.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Beispiel #4
0
 public bool Update(ProductParameterValue _ProductParameterValue)
 {
     try
     {
         var _contaxt = contaxt.ProductParsmeterValues.Where(p => p.ProductId == _ProductParameterValue.ProductId & p.ProductParameterId == _ProductParameterValue.ProductParameterId).FirstOrDefault();
         _contaxt.ProductId          = _ProductParameterValue.ProductId;
         _contaxt.ProductParameterId = _ProductParameterValue.ProductParameterId;
         _contaxt.Value = _ProductParameterValue.Value;
         contaxt.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 protected override void OnModelCreating(DbModelBuilder modelBuilder)
 {
     modelBuilder.Configurations.Add(User.Map());
     modelBuilder.Configurations.Add(Role.Map());
     modelBuilder.Configurations.Add(Corporation.Map());
     modelBuilder.Configurations.Add(Product.Map());
     modelBuilder.Configurations.Add(Entities.ProductUnit.Map());
     modelBuilder.Configurations.Add(ProductCategory.Map());
     modelBuilder.Configurations.Add(InventoryInsType.Map());
     modelBuilder.Configurations.Add(InventoryInsHeader.Map());
     modelBuilder.Configurations.Add(InventoryInsDeatil.Map());
     modelBuilder.Configurations.Add(InventoryOutsType.Map());
     modelBuilder.Configurations.Add(InventoryOutsHeader.Map());
     modelBuilder.Configurations.Add(InventoryOutsDeatil.Map());
     modelBuilder.Configurations.Add(ProductParameterValue.Map());
     modelBuilder.Configurations.Add(ProductParameter.Map());
     base.OnModelCreating(modelBuilder);
 }
Beispiel #6
0
 protected virtual ISelectionItemVM SetupItem(ProductParameterValue value, bool selected)
 {
     return(new SelectionItemVM(value.Id, value.ValueName, selected));
 }
 protected virtual PickerCollectionItemVM SetupItem(ProductParameterValue value)
 {
     return(new PickerCollectionItemVM(value));
 }