public void Save(ReOrderLevelViewModel rolvm)
 {
     ReOrderLevel rol = new ReOrderLevel(rolvm.Id) 
     {
      ProductReOrderLevel=rolvm.ProductReOrderLevel,
      DistributorId=_costCentreRepository.GetById(rolvm.DistributorId),
      ProductId=_productRepository.GetById(rolvm.ProductId)
     };
     _reOrderLevelRepository.Save(rol);
 }
Exemplo n.º 2
0
 public ReorderLevelDTO Map(ReOrderLevel reorderLevel)
 {
     if (reorderLevel == null) return null;
     return Mapper.Map<ReOrderLevel, ReorderLevelDTO>(reorderLevel);
 }
 protected ReOrderLevelViewModel Map(ReOrderLevel rlevel)
  {
      return new ReOrderLevelViewModel
                 {
                     DistributorId       = rlevel.DistributorId.Id,
                     DistributorName     = rlevel.DistributorId.Name,
                     ProductId           = rlevel.ProductId.Id,
                     ProductName         = rlevel.ProductId.Description,
                     ProductReOrderLevel = rlevel.ProductReOrderLevel,
                     Id                  = rlevel.Id,
                     isActive = rlevel._Status == EntityStatus.Active ? true : false
                 };
  }
Exemplo n.º 4
0
        protected Guid AddReorderLevel(Guid DistributorId, Guid ProductId, decimal ProductReorderLevel)
        {
            ReOrderLevel reorderLevel = new ReOrderLevel(Guid.NewGuid())
            {
                DistributorId = _costCentreRepository.GetById(DistributorId),
                ProductId = _productRepository.GetById(ProductId),
                ProductReOrderLevel = ProductReorderLevel

            };
            reorderLevel._SetStatus(EntityStatus.Active);
            return _reorderLevelRepository.Save(reorderLevel);
        }