/// <summary> /// /// </summary> /// <param name="content"></param> private void ValidateInputStream(Dictionary <string, string> content) { string number, barcode; if (content.TryGetValue("serialNumber", out number) && content.TryGetValue("barcode", out barcode)) { this._serialNumber = number; this._barcode = barcode; } else { this.Result = new DownloadResult("", ResponseSet.FieldsError); } }
private void StatusCheck(string statusCode) { if (statusCode == "InternalServerError") { this._downloadStatus = ResponseSet.InternalError; } else if (statusCode == "12") { this._downloadStatus = ResponseSet.PDFDownloadFailureError; } else { this._downloadStatus = ResponseSet.DownloadSuccess; } this.Result = new DownloadResult(this._serialNumber, this._downloadStatus); }
/// <summary> /// Spawn the connection to SKL Web Service. /// </summary> public async Task Launch() { if (this.Result == null) { if (String.IsNullOrEmpty(this._serialNumber)) { this.Result = new DownloadResult(_serialNumber, ResponseSet.SerialNumNotFoundError); } else if (String.IsNullOrEmpty(this._barcode) || String.IsNullOrEmpty(this._fileDir) || this._requestUri == null) { this.Result = new DownloadResult(this._serialNumber, ResponseSet.InternalError); } else { DownloadLaunch launcher = new DownloadLaunch(this._requestUri, this._fileName, "Y22L00", this._barcode); StatusCheck(await launcher.SendAsync()); } } }