Exemple #1
0
 private async Task GeneratePdfDocument()
 {
     if (!string.IsNullOrEmpty(contactId) || !string.IsNullOrEmpty(tenAgreementRef) || !string.IsNullOrEmpty(startdate))
     {
         BuildDoc bdoc     = new BuildDoc();
         Document document = bdoc.GeneratePdfDocument(contactId, tenAgreementRef, startdate);
         if (document != null)
         {
             document.DrawToWeb();
         }
     }
 }
 private async Task GeneratePdfDocument()
 {
     if (!string.IsNullOrEmpty(contactId) || !string.IsNullOrEmpty(startdate))
     {
         BuildDoc bdoc     = new BuildDoc();
         Document document = bdoc.GeneratePdfDocument(contactId, tenAgreementRef, startdate);
         if (document != null)
         {
             byte[] docbytes       = document.Draw();
             string parameters     = string.Format("EmailTo={0}&TemplateId={1}&TemplateData={'rent balance':'30', 'link_to_document':'{2}','Rent amount':'55.6'}", emailId, templateId, docbytes);
             var    jsonciresponse = bdoc.ExecuteAPI(GovNotifyAPIURL, parameters);
             if (jsonciresponse != null)
             {
             }
         }
     }
 }
        public byte[] GetDocumentBytes(string contactId, string startdate, string enddate)
        {
            try
            {
                BuildDoc bdoc = new BuildDoc();

                /*Document document = bdoc.GeneratePdfDocument(contactId, startdate, enddate);
                 * if (document != null)
                 * {
                 *  return document.Draw();
                 * }
                 * else*/
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }