public void InvokeILModifyProposal(AIA.Life.Models.Policy.Policy objPolicy) { AIA.Life.Business.Policy.PolicyBusiness objPolicyBusiness = new AIA.Life.Business.Policy.PolicyBusiness(); objPolicyBusiness.InvokeILModifyProposal(objPolicy); }
public AIA.Life.Models.Policy.Policy SaveProposal(AIA.Life.Models.Policy.Policy objpolicy) { TpServiceLog tpServiceLog = new TpServiceLog(); tpServiceLog.ServiceRequest = Newtonsoft.Json.JsonConvert.SerializeObject(objpolicy); TransactLog transactLog = new TransactLog(); transactLog.SerivceTraceID = tpServiceLog.ServiceTraceID = objpolicy.ServiceTraceID; transactLog.UserName = objpolicy.UserName; string Message = ValidateUserAuth(transactLog); if (Message != "" && Message != null) { objpolicy.Message = Message; return(objpolicy); } AIA.Life.Business.Policy.PolicyBusiness objPolicyBusiness = new AIA.Life.Business.Policy.PolicyBusiness(); if (objpolicy.MainLifeSign != null) { objpolicy.ProposerSignatureFile = Convert.FromBase64String(objpolicy.MainLifeSign); } if (objpolicy.SpouseLifeSign != null) { objpolicy.SpouseSignatureFile = Convert.FromBase64String(objpolicy.SpouseLifeSign); } if (objpolicy.WPSign != null) { objpolicy.WPSignatureFile = Convert.FromBase64String(objpolicy.WPSign); } objpolicy = objPolicyBusiness.SaveProposal(objpolicy); objpolicy = objPolicyBusiness.InvokeILModifyProposal(objpolicy); string QuoteFilePath = ConfigurationManager.AppSettings["QuoteFilePath"]; if (objpolicy.Message == "Success") { try { AVOAIALifeEntities Context = new AVOAIALifeEntities(); var prdID = Context.tblMasProductPlans.Where(a => a.PlanCode == objpolicy.PlanCode).Select(a => a.ProductId).FirstOrDefault(); var ProductCode = Context.tblProducts.Where(a => a.ProductId == prdID).Select(a => a.ProductCode).FirstOrDefault(); byte[] byteArray = null; ReportsController objReportController = new ReportsController(); try { byteArray = objReportController.ProposalReport(objpolicy.QuoteNo, ProductCode, objpolicy.PreferredLanguage); } catch (Exception) { objpolicy.ByteArray = null; } try { objpolicy.ProposalFilePath = QuoteFilePath + objpolicy.QuoteNo + "_Proposal.pdf"; System.IO.File.WriteAllBytes(objpolicy.ProposalFilePath, byteArray); } catch (Exception ex) { objpolicy.ProposalFilePath = null; } } catch (Exception e) { log4net.GlobalContext.Properties["ErrorCode"] = objpolicy.Error.ErrorCode = Codes.GetErrorCode(); Logger.Error(e); objpolicy.Error.ErrorMessage = "Please inform the IT HelpDesk on this application issue. Error Code is " + objpolicy.Error.ErrorCode + ". Sorry for the inconvenience caused"; } } tpServiceLog.ServiceResponse = Newtonsoft.Json.JsonConvert.SerializeObject(objpolicy); commonBusiness.CreateServiceLog(tpServiceLog); return(objpolicy); }