public string FinalizeMonthSignature(int caseID, int year, int month) { var firstDayOfMonth = new DateTime(year, month, 1); var finalizationID = homeRepository.BeginFinalize(caseID, firstDayOfMonth, Provider.ID.Value); var reqUrl = Request.Url.OriginalString; var returnURL = reqUrl.Substring(0, reqUrl.IndexOf(Request.Url.AbsolutePath)); returnURL = returnURL + "/Signing/Complete/" + finalizationID.ToString(); var envelope = _service.FinalizeMonthSignature(caseID, firstDayOfMonth, returnURL); homeRepository.UpdateFinalizeWithEnvelopeID(finalizationID, envelope.EnvelopeID); return(envelope.RedirectURL); }