Esempio n. 1
0
        public void Should_Success_GarmentLeftoverWarehouseProductProfile()
        {
            var mapper = new MapperConfiguration(configuration => configuration.AddProfile <GarmentLeftoverWarehouseProductProfile>()).CreateMapper();
            var model  = new GarmentLeftoverWarehouseProductModel();
            var vm     = mapper.Map <GarmentLeftoverWarehouseProductViewModel>(model);

            Assert.NotNull(vm);
        }
        public async Task <int> CreateAsync(GarmentLeftoverWarehouseProductModel model)
        {
            model.FlagForCreate(_IdentityService.Username, _UserAgent);
            model._LastModifiedAgent = model._CreatedAgent;
            model._LastModifiedBy    = model._CreatedBy;
            model._LastModifiedUtc   = model._CreatedUtc;

            _DbSet.Add(model);
            return(await _DbContext.SaveChangesAsync());
        }
        public GarmentLeftoverWarehouseProductModel GetNewData()
        {
            Guid guid = Guid.NewGuid();

            GarmentLeftoverWarehouseProductModel model = new GarmentLeftoverWarehouseProductModel
            {
                Code            = $"Code{guid}",
                Name            = $"Name{guid}",
                UomId           = 1,
                UomUnit         = $"UomUnit{guid}",
                ProductTypeId   = 1,
                ProductTypeCode = $"ProducTypeCode{guid}",
                ProductTypeName = $"ProducTypeName{guid}",
            };

            return(model);
        }
 public async Task <int> UpdateAsync(int id, GarmentLeftoverWarehouseProductModel model)
 {
     model.FlagForUpdate(_IdentityService.Username, _UserAgent);
     _DbSet.Update(model);
     return(await _DbContext.SaveChangesAsync());
 }