private async Task InitializePrintingRequirementsAsync() { //Set the default printer name as BarcodePrinter BarcodePrinterName = "BarcodePrinter"; //Fetch the workstation name var workstationName = GetWorkStationName(); //call datalayer to get all the printers with their types (Barcode printer, document printer... etc) var workStationPrinters = await _staticData.GetWorkStationPrintersAsync(workstationName); var barcodePrinter = workStationPrinters.Find((x) => x.PrinterType == 1); if (barcodePrinter != null) { BarcodePrinterName = barcodePrinter.PrinterName; } }
public async Task <List <WorkStationPrintersInfoModel> > GetApplicationWideStaticData() { //Get the workstation name var workstation = GetWorkStationName(); try { //request for data var output = await staticDataDataAccess.GetWorkStationPrintersAsync(workstation); //map the output to local model and return return(mapper.Map <List <WorkStationPrintersInfoModel> >(output)); } catch (Exception) { throw; } }