public IHttpActionResult UploadDoc(dynamic data) { string value = token_gen.Authorize_aesdecrpty(data); try { //string value = JsonConvert.SerializeObject(data); DocCls rootobj = JsonConvert.DeserializeObject <DocCls>(value); bool IsPDF = true; if (!string.IsNullOrEmpty(rootobj.data)) { byte[] PdfBytes = Convert.FromBase64String(rootobj.data); if (!Utils.IsValidPDF(PdfBytes) && !Utils.IsValidImage(PdfBytes)) { IsPDF = false; } } if (IsPDF) { return(Ok(cthel.UploadDoc_Helper(rootobj))); } else { CatchData.Status = 102; CatchData.Reason = "Invalid File Format"; return(Ok(CatchData)); } } catch (Exception ex) { CatchData.Status = 102; CatchData.Reason = CommercialTaxHelper.ThirdpartyMessage; return(Ok(CatchData)); } }
public dynamic GetRCData_Helper(DocCls root) { dynamic obj = new ExpandoObject(); try { var result = true; if (!string.IsNullOrEmpty(root.tin)) { result = gswsBackendAPI.DL.CommonHel.Utils.IsAlphaNumeric(root.tin); } if (result) { var val = PostData("https://apct.gov.in/pspt/api/registration/get_rc", root); var data = GetSerialzedData <dynamic>(val); obj.Status = 100; obj.Details = data; } else { obj.Status = 102; obj.Reason = "Special Characters Are Not Allowed"; } return(obj); } catch (Exception ex) { obj.Status = 102; obj.Reason = ThirdpartyMessage; Common_CommercialTax_Error(ex.Message.ToString(), "https://apct.gov.in/pspt/api/registration/get_rc", "2"); return(obj); } }
public IHttpActionResult GetRCData(dynamic data) { string value = token_gen.Authorize_aesdecrpty(data); try { //string value = JsonConvert.SerializeObject(data); DocCls rootobj = JsonConvert.DeserializeObject <DocCls>(value); return(Ok(cthel.GetRCData_Helper(rootobj))); } catch (Exception ex) { CatchData.Status = 102; CatchData.Reason = CommercialTaxHelper.ThirdpartyMessage; return(Ok(CatchData)); } }
public dynamic UploadDoc_Helper(DocCls root) { dynamic obj = new ExpandoObject(); try { var val = PostData("https://apct.gov.in/pspt/api/Doc/docupld", root); var data = GetSerialzedData <dynamic>(val); obj.Status = 100; obj.Details = data; return(obj); } catch (Exception ex) { obj.Status = 102; obj.Reason = ThirdpartyMessage; Common_CommercialTax_Error(ex.Message.ToString(), "https://apct.gov.in/pspt/api/Doc/docupld", "2"); return(obj); } }