public ActionResult SignNewDocument() { try { //DTPClient dtpClient = new DTPClient(); DTPClient dtpClient = new DTPClient("b2b7267f-0766-452b-8b0f-557987d08a27"); //#1 : Init transaction dtpClient.InitTransaction("0002"); //#2 : Provide document dtpClient.ProvideDocument("Contrat upsirecueil", "Contrat upsirecueil", @"E:\Contrats\Contrat.pdf", DTPClient.DocumentTypes.CONTRACT); //#3 : User0 : create access user for End user string accessId = dtpClient.CreateUserAccess("M.", "RAFALINANTENAINA", "Odon", null, "http://www.wylog.com",true, "", true); //USER0 string urlIHM = dtpClient.BuildUserInterfaceUrl(accessId); return Redirect(urlIHM); } catch (Exception ex) { //Log } return View(); }
public string GetDocumentByType() { try { string transactionId = "df07e2dd-4260-4d5d-93fa-2042db218bdd"; // ???? get from DB ?? DTPClient dtpClient = new DTPClient(transactionId); Document doc = dtpClient.GetDocumentByType(DTPClient.DocumentTypes.CONTRACT); dtpClient.SaveDocumentToFile(doc, @"E:\Contrats\" + dtpClient.TransactionId); return "OK"; } catch { //LOG return "KO"; } }
public ActionResult SignProvidedDocument() { try { string transactionId = "df07e2dd-4260-4d5d-93fa-2042db218bdd"; // ???? get from DB DTPClient dtpClient = new DTPClient(transactionId); //User1 : create access user for "Conseiller" string accessId = dtpClient.CreateUserAccess("Mme", "RANDIMBISONA", "Luciana", null, "http://www.wylog.com", true,"", false); //USER1 string urlIHM = dtpClient.BuildUserInterfaceUrl(accessId); return Redirect(urlIHM); } catch (Exception ex) { //Log } return View(); }
public string GetDocumentsByType() { try { string transactionId = "df07e2dd-4260-4d5d-93fa-2042db218bdd"; // ???? get from DB ?? DTPClient dtpClient = new DTPClient(transactionId); byte[] zip = dtpClient.GetDocumentsByType(new List<string>() { DTPClient.DocumentTypes.CONTRACT.ToString() }.ToArray()); dtpClient.SaveDocumentToFile(zip, @"E:\Contrats\" + dtpClient.TransactionId, "Contrat.zip"); return "OK"; } catch { //LOG return "KO"; } }
public string SealAndArchiveTransaction() { try { string transactionId = "df07e2dd-4260-4d5d-93fa-2042db218bdd"; // ???? get from DB ?? DTPClient dtpClient = new DTPClient(transactionId); IList<string> documentTypesToSeal_ToArchive = new List<string>() { DTPClient.DocumentTypes.CONTRACT.ToString() }; dtpClient.SealTransaction(documentTypesToSeal_ToArchive); dtpClient.ArchiveTransaction(documentTypesToSeal_ToArchive); //dtpClient.FinishTransaction(); //On ne peut plus faire finish si bien sealed return "OK"; } catch { //LOG return "KO"; } }