public JsonResult _SavePartyLicenceID(string scaleId, string licenseImageRefId) { try { bool result = false; if (!string.IsNullOrEmpty(licenseImageRefId)) { ScaleAttachmentsLibrary scaleAttOps = new ScaleAttachmentsLibrary(ConfigurationHelper.GetsmARTDBContextConnectionString()); ScaleAttachments scaleAttachment = scaleAttOps.GetScaleAttachmentByRefId(new Guid(licenseImageRefId)); if (scaleAttachment != null) { FilelHelper fileHelper = new FilelHelper(); string imagePath = fileHelper.GetFilePathByFileRefId(licenseImageRefId); byte[] imageBytes = fileHelper.GetBytesFromFile(imagePath); SaveScaleIDCardAttachment(Convert.ToInt32(scaleId), imageBytes); result = true; } } var data = new { Success = result }; return(Json(data, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { string message = ex.Message; Common.MessageLogger.Instance.LogMessage(ex, ex.Message, Common.Priority.High, 0, System.Diagnostics.TraceEventType.Critical, "Scanner Error", "Scanner"); throw ex; } }