/// <summary> /// Sign by the first user /// </summary> /// <param name="docsToSignPathFileName"></param> /// <param name="user"></param> /// <param name="idDictao"></param> /// <param name="businessId"></param> /// <param name="backUrl"></param> /// <param name="IHM_Url"></param> /// <returns></returns> private static string SignByFirstUser(List<DocumentToSign> documentsToSign, Upsilab.Data.Model.User user, bool isCustomer, string idDictao, string businessId, string backUrl, out string IHM_Url) { DTPClient dtpClient = new DTPClient(); //If idDictao has value, cancel this transaction and create a new one if (!string.IsNullOrEmpty(idDictao)) { dtpClient.TransactionId = idDictao; try { dtpClient.CancelTransaction(); } catch { } } //#1 : Init transaction dtpClient.InitTransaction(businessId); //#2 : Provide document dtpClient.ProvideDocuments(documentsToSign); //#3 : create access user //string termAndConditionsFileName = "termsAndConditions_fr.pdf"; string termAndConditionsFileName = "convention_preuve.pdf"; string termAndConditionsUrl = string.Format("{0}/Client/Documents/{1}", Upsilab.Business.Utility.UrlHelper.GetHost(), termAndConditionsFileName); string accessId = dtpClient.CreateUserAccess(string.Empty, user.UserName, user.UserFirstName, user.UserMobilePhone, backUrl, true, termAndConditionsUrl, isCustomer); //#4 : send OTP by sms to user dtpClient.SendOtp(accessId); //#5 : build urlIhm IHM_Url = dtpClient.BuildUserInterfaceUrl(accessId); idDictao = dtpClient.TransactionId; return dtpClient.TransactionId; }