Esempio n. 1
0
        private MaterialConstructionViewModel MapToViewModel(MaterialConstructionModel model)
        {
            var vm = new MaterialConstructionViewModel()
            {
                LastModifiedUtc = model.LastModifiedUtc,
                Type            = model.Type,
                Code            = model.Code,
                Id                = model.Id,
                Active            = model.Active,
                CreatedAgent      = model.CreatedAgent,
                CreatedBy         = model.CreatedBy,
                CreatedUtc        = model.CreatedUtc,
                DeletedAgent      = model.DeletedAgent,
                DeletedBy         = model.DeletedBy,
                DeletedUtc        = model.DeletedUtc,
                IsDeleted         = model.IsDeleted,
                LastModifiedAgent = model.LastModifiedAgent,
                LastModifiedBy    = model.LastModifiedBy
            };

            return(vm);
        }
Esempio n. 2
0
        public Task <int> Create(MaterialConstructionViewModel viewModel)
        {
            var model = new MaterialConstructionModel(viewModel.Type, viewModel.Code);

            return(_repository.InsertAsync(model));
        }
Esempio n. 3
0
        public Task <int> Update(int id, MaterialConstructionViewModel viewModel)
        {
            var model = new MaterialConstructionModel(viewModel.Type, viewModel.Code);

            return(_repository.UpdateAsync(id, model));
        }