public static StorageViewModel GetPrintingGreigeStorage(HttpClientTestService client) { Dictionary <string, object> filter = new Dictionary <string, object> { { "name", "Gudang Greige Printing" } }; var response = client.GetAsync($@"{APIEndpoint.Core}master/storages?filter=" + JsonConvert.SerializeObject(filter)).Result.Content.ReadAsStringAsync(); Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(response.Result); List <StorageViewModel> list = JsonConvert.DeserializeObject <List <StorageViewModel> >(result["data"].ToString()); StorageViewModel storage = list.First(); return(storage); }
public static UnitViewModel GetFinishingUnit(HttpClientTestService client) { var response = client.GetAsync($"{APIEndpoint.Core}master/units").Result; response.EnsureSuccessStatusCode(); var data = response.Content.ReadAsStringAsync(); Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(data.Result.ToString()); List <UnitViewModel> list = JsonConvert.DeserializeObject <List <UnitViewModel> >(result["data"].ToString()); UnitViewModel fp = list.First(p => p.name.Equals("FINISHING")); return(fp); }
public static SupplierViewModel GetSupplier(HttpClientTestService client) { var response = client.GetAsync($"{APIEndpoint.Core}/master/suppliers?page=1&size=1").Result; response.EnsureSuccessStatusCode(); var data = response.Content.ReadAsStringAsync(); Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(data.Result.ToString()); List <SupplierViewModel> list = JsonConvert.DeserializeObject <List <SupplierViewModel> >(result["data"].ToString()); SupplierViewModel supplier = list.First(); return(supplier); }
public static ProductViewModel GetProduct(HttpClientTestService client) { var responseProduct = client.GetAsync($"{APIEndpoint.Core}/master/products?page=1&size=1").Result; responseProduct.EnsureSuccessStatusCode(); var dataProduct = responseProduct.Content.ReadAsStringAsync(); Dictionary <string, object> resultProduct = JsonConvert.DeserializeObject <Dictionary <string, object> >(dataProduct.Result.ToString()); List <ProductViewModel> listProduct = JsonConvert.DeserializeObject <List <ProductViewModel> >(resultProduct["data"].ToString()); ProductViewModel product = listProduct.First(); return(product); }
public static ProductionOrderViewModel GetProductionOrder(HttpClientTestService client) { var responseSPP = client.GetAsync($"{APIEndpoint.Production}sales/production-orders?page=1&size=1").Result; responseSPP.EnsureSuccessStatusCode(); var dataSPP = responseSPP.Content.ReadAsStringAsync(); Dictionary <string, object> resultSPP = JsonConvert.DeserializeObject <Dictionary <string, object> >(dataSPP.Result.ToString()); List <ProductionOrderViewModel> listSPP = JsonConvert.DeserializeObject <List <ProductionOrderViewModel> >(resultSPP["data"].ToString()); ProductionOrderViewModel productionOrder = listSPP.First(); return(productionOrder); }
public static InventorySummaryViewModel GetInventorySummary(HttpClientTestService client) { var response = client.GetAsync($"{APIEndpoint.Inventory}/inventory/inventory-summary?page=1&size=1").Result; response.EnsureSuccessStatusCode(); var data = response.Content.ReadAsStringAsync(); Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(data.Result.ToString()); List <InventorySummaryViewModel> list = JsonConvert.DeserializeObject <List <InventorySummaryViewModel> >(result["data"].ToString()); InventorySummaryViewModel inventorySummary = list.First(); return(inventorySummary); }
public static UnitReceiptNoteViewModel GetUnitReceiptNote(HttpClientTestService client) { var response = client.GetAsync($"{APIEndpoint.Purchasing}/unit-receipt-notes-basic?page=1&size=1").Result; response.EnsureSuccessStatusCode(); var data = response.Content.ReadAsStringAsync(); Dictionary <string, object> result = JsonConvert.DeserializeObject <Dictionary <string, object> >(data.Result.ToString()); List <UnitReceiptNoteViewModel> list = JsonConvert.DeserializeObject <List <UnitReceiptNoteViewModel> >(result["data"].ToString()); //List<UnitReceiptNoteViewModel.Item> item = UnitReceiptNoteViewModel UnitReceiptNote = list.First(); return(UnitReceiptNote); }
public FpRegradingResultDetailsDataUtil(HttpClientTestService client) { this.client = client; }
public FpRegradingResultDataUtil(InventoryDbContext dbContext, FpRegradingResultDocsService service, HttpClientTestService client, FpRegradingResultDetailsDataUtil fpRegradingResultDetailsDataUtil) : base(dbContext, service) { this.client = client; this.fpRegradingResultDetailsDataUtil = fpRegradingResultDetailsDataUtil; }
public MaterialRequestNoteDataUtil(InventoryDbContext dbContext, MaterialsRequestNoteService service, HttpClientTestService client, MaterialRequestNoteItemDataUtil materialRequestNoteItemDataUtil) : base(dbContext, service) { this.client = client; this.materialRequestNoteItemDataUtil = materialRequestNoteItemDataUtil; }
public MaterialRequestNoteItemDataUtil(HttpClientTestService client) { this.client = client; }
public StockTransferNoteDataUtil(InventoryDbContext dbContext, StockTransferNoteService service, HttpClientTestService client, StockTransferNoteItemDataUtil stockTransferNoteItemDataUtil) : base(dbContext, service) { this.client = client; this.stockTransferNoteItemDataUtil = stockTransferNoteItemDataUtil; }
public MaterialDistributionNoteDetailDataUtil(HttpClientTestService client) { this.client = client; }