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);
        }
Exemple #3
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #8
0
 public FpRegradingResultDetailsDataUtil(HttpClientTestService client)
 {
     this.client = client;
 }
Exemple #9
0
 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;
 }
Exemple #11
0
 public MaterialRequestNoteItemDataUtil(HttpClientTestService client)
 {
     this.client = client;
 }
Exemple #12
0
 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;
 }