public IActionResult SendFormSubmit(SendRequestModel sendRequest) //(string email, string fileName) { if (s_username != "" && s_password != "") { DocuSignDemo.DocuSignDemo demo = new DocuSignDemo.DocuSignDemo(); sendRequest.SenderAccountId = s_accountId; ViewData["Message"] = demo.SendSignDocumentRequest(s_tmpFilenames, ref sendRequest); s_envelopeId = sendRequest.EnvelopeId; s_recipientName = sendRequest.RecipientName; s_recipientEmail = sendRequest.RecipientEmailAddress; //clean out array of file names for (int i = 0; i < 10; i++) { s_tmpFilenames[0, i] = null; s_tmpFilenames[1, i] = null; } } else { ViewData["Message"] = "You need to sign in before you can send documents."; } return(View("Index")); }
public IActionResult DocuSign() { if (s_accountId == "") { ViewData["Message"] = "You need to sign in before signing documents."; return(View("Login")); } if (s_envelopeId == "") { ViewData["Message"] = "No Documents to sign"; return(View("Index")); } DocuSignDemo.DocuSignDemo demo = new DocuSignDemo.DocuSignDemo(); SignRequestModel signRequest = new SignRequestModel(); signRequest.Username = s_username; signRequest.Password = s_password; signRequest.RecipientName = s_recipientName; signRequest.RecipientEmail = s_recipientEmail; signRequest.EnvelopeId = s_envelopeId; signRequest.AccountId = s_accountId; ViewUrl recipientView = demo.SignDocument(ref signRequest); //Test Working Console Code //ViewUrl recipientView = demo.SignDocument(s_envelopeId); if (recipientView != null) { //return recipientView; return(Redirect(recipientView.Url)); //return View(); } else { ViewData["Message"] = signRequest.Message; return(View("Sign")); } }
public IActionResult LoginFormSubmit(LoginRequestModel loginRequest) { DocuSignDemo.DocuSignDemo demo = new DocuSignDemo.DocuSignDemo(); string accountId = demo.Login(loginRequest); if (accountId.Substring(0, 5) == "Error") { //Error Condition ViewData["Message"] = accountId; //accountId contains error message in failing case return(View("About")); } else {// Working Condition ViewData["Message"] = "User " + loginRequest.Username + " is signed on."; s_accountId = accountId; s_username = loginRequest.Username; s_password = loginRequest.Password; return(View("Index")); } }