Example #1
0
        public void Should_Success_GarmentInsuranceProfile()
        {
            var mapper = new MapperConfiguration(configuration => configuration.AddProfile <GarmentInsuranceProfile>()).CreateMapper();
            var model  = new GarmentInsuranceModel();
            var vm     = mapper.Map <GarmentInsuranceViewModel>(model);

            Assert.NotNull(vm);
        }
Example #2
0
        public async Task <int> CreateAsync(GarmentInsuranceModel 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());
        }
Example #3
0
        public GarmentInsuranceModel GetNewData()
        {
            Guid guid = Guid.NewGuid();

            GarmentInsuranceModel model = new GarmentInsuranceModel
            {
                Code          = $"Code{guid}",
                Name          = $"Name{guid}",
                Address       = $"Address{guid}",
                Attention     = $"Attention{guid}",
                PhoneNumber   = $"PhoneNumber{guid}",
                BankName      = $"BankName{guid}",
                AccountNumber = $"AccountNumber{guid}",
                NPWP          = $"NPWP{guid}",
            };

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