public GarmentBuyerBrandViewModel MapToViewModel(GarmentBuyerBrand garmentBuyer) { GarmentBuyerBrandViewModel garmentBuyerVM = new GarmentBuyerBrandViewModel(); garmentBuyerVM.Id = garmentBuyer.Id; garmentBuyerVM.UId = garmentBuyer.UId; garmentBuyerVM._IsDeleted = garmentBuyer._IsDeleted; garmentBuyerVM.Active = garmentBuyer.Active; garmentBuyerVM._CreatedUtc = garmentBuyer._CreatedUtc; garmentBuyerVM._CreatedBy = garmentBuyer._CreatedBy; garmentBuyerVM._CreatedAgent = garmentBuyer._CreatedAgent; garmentBuyerVM._LastModifiedUtc = garmentBuyer._LastModifiedUtc; garmentBuyerVM._LastModifiedBy = garmentBuyer._LastModifiedBy; garmentBuyerVM._LastModifiedAgent = garmentBuyer._LastModifiedAgent; garmentBuyerVM.Code = garmentBuyer.Code; garmentBuyerVM.Name = garmentBuyer.Name; garmentBuyerVM.BuyerName = garmentBuyer.BuyerName; garmentBuyerVM.Buyers = new GarmentBuyerViewModel { Id = garmentBuyer.BuyerId, Code = garmentBuyer.BuyerCode, Name = garmentBuyer.BuyerName }; return(garmentBuyerVM); }
public GarmentBuyerBrand MapToModel(GarmentBuyerBrandViewModel garmentBuyerVM) { GarmentBuyerBrand garmentBuyer = new GarmentBuyerBrand(); garmentBuyer.Id = garmentBuyerVM.Id; garmentBuyer.UId = garmentBuyerVM.UId; garmentBuyer._IsDeleted = garmentBuyerVM._IsDeleted; garmentBuyer.Active = garmentBuyerVM.Active; garmentBuyer._CreatedUtc = garmentBuyerVM._CreatedUtc; garmentBuyer._CreatedBy = garmentBuyerVM._CreatedBy; garmentBuyer._CreatedAgent = garmentBuyerVM._CreatedAgent; garmentBuyer._LastModifiedUtc = garmentBuyerVM._LastModifiedUtc; garmentBuyer._LastModifiedBy = garmentBuyerVM._LastModifiedBy; garmentBuyer._LastModifiedAgent = garmentBuyerVM._LastModifiedAgent; garmentBuyer.Code = garmentBuyerVM.Code; garmentBuyer.Name = garmentBuyerVM.Name; if (garmentBuyerVM.Buyers != null) { garmentBuyer.BuyerId = garmentBuyerVM.Buyers.Id; garmentBuyer.BuyerCode = garmentBuyerVM.Buyers.Code; garmentBuyer.BuyerName = garmentBuyerVM.Buyers.Name; } else { garmentBuyer.BuyerId = 0; garmentBuyer.BuyerCode = ""; garmentBuyer.BuyerName = ""; } return(garmentBuyer); }
public async void Upload() { GarmentBuyerBrandViewModel model = DataUtil.GetUploadData(); List <GarmentBuyerBrandViewModel> viewModel = new List <GarmentBuyerBrandViewModel>(); viewModel.Add(model); var Response = Services.UploadValidate(viewModel, null); Assert.Equal(Response.Item1, false); }
public GarmentBuyerBrandViewModel GetEmptyData() { GarmentBuyerBrandViewModel viewModel = new GarmentBuyerBrandViewModel(); viewModel.Buyers = new GarmentBuyerViewModel { Id = 0, Code = "", Name = "" }; return(viewModel); }
public GarmentBuyerBrandViewModel GetUploadData() { GarmentBuyerBrandViewModel viewModel = new GarmentBuyerBrandViewModel(); viewModel.Code = "brandCode"; viewModel.Name = "brandName"; viewModel.Buyers = new GarmentBuyerViewModel { Id = 0, Code = "codeBYR", Name = "" }; return(viewModel); }
public async void UploadDouble() { Com.DanLiris.Service.Core.Lib.Models.GarmentBuyer garmentBuyer = await BuyerDataUtil.GetTestDataAsync(); GarmentBuyerBrand models = await DataUtil.GetTestDataAsync(); GarmentBuyerBrandViewModel model = DataUtil.GetUploadData(); model.Code = models.Code; model.Buyers.Code = garmentBuyer.Code; List <GarmentBuyerBrandViewModel> viewModel = new List <GarmentBuyerBrandViewModel>(); viewModel.Add(model); var Response = Services.UploadValidate(viewModel, null); Assert.Equal(Response.Item1, false); }