Beispiel #1
0
        public async System.Threading.Tasks.Task <ActionResult> RefreshStatuses(long ProspectId)
        {
            try
            {
                string          esignatureid = "";
                ShomaRMEntities db           = new ShomaRMEntities();
                var             applyNow     = db.tbl_ApplyNow.Where(p => p.ID == ProspectId).FirstOrDefault();
                if (applyNow != null)
                {
                    esignatureid = !string.IsNullOrWhiteSpace(applyNow.EsignatureID) ? applyNow.EsignatureID : "";
                    if (esignatureid != "")
                    {
                        var bmservice = new BluemoonService();
                        LeaseResponseModel authenticateData = await bmservice.CreateSession();

                        LeaseResponseModel leaseKeys = await bmservice.GetEsignnatureDetails(SessionId : authenticateData.SessionId, EsignatureId : esignatureid);


                        foreach (var lks in leaseKeys.EsigneResidents)
                        {
                            var esignData = db.tbl_ESignatureKeys.Where(p => p.Key == lks.Key).FirstOrDefault();
                            if (esignData != null)
                            {
                                esignData.DateSigned = lks.DateSigned;
                                db.SaveChanges();
                            }
                        }
                    }
                }
                db.Dispose();
                return(Json(new { result = "1" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { result = "0" }, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #2
0
        public async System.Threading.Tasks.Task <LeaseResponseModel> GetLeaseDocBlumoonAsyncAdm(string LeaseId, string EsignatureId)
        {
            var bmservice = new BluemoonService();
            LeaseResponseModel authenticateData = await bmservice.CreateSession();

            if (!string.IsNullOrWhiteSpace(EsignatureId))
            {
                LeaseResponseModel leaseDocumentWithEsignature = await bmservice.GetLeaseDocumentWithEsignature(SessionId : authenticateData.SessionId, EsignatureId : EsignatureId);

                await bmservice.CloseSession(sessionId : authenticateData.SessionId);

                leaseDocumentWithEsignature.LeaseId = LeaseId;
                return(leaseDocumentWithEsignature);
            }
            else
            {
                LeaseResponseModel leasePdfResponse = await bmservice.GenerateLeasePdf(sessionId : authenticateData.SessionId, leaseId : LeaseId);

                await bmservice.CloseSession(sessionId : authenticateData.SessionId);

                leasePdfResponse.LeaseId = LeaseId;
                return(leasePdfResponse);
            }
        }