public object Save([FromBody] INS_UWD_POLICY_HEAD pa) { try { var result = PolicyPaMdl.save_policy(pa); return(new { state = true, message = "Personal Accident Policy successfully Saved", result = new { result.POLH_SYS_ID, result.POLH_END_NO, result.POLH_STATUS, result.POLH_TXN_STATE, result.POLH_POL_STATE, result.POLH_DISPLAY_NO, result.POLH_QUT_SER_NO, } }); } catch (Exception e) { return(new { state = false, message = e }); } }
public dynamic Get(int code) { try { return(PolicyPaMdl.get_policy(code)); } catch (Exception e) { return(new { state = false, message = "Server Error", exception = e }); } }
// GET: PolicyPa public object Get() { try { return(PolicyPaMdl.get_policys()); } catch (Exception e) { return(new { state = false, message = "Server Error", exception = e }); } }
public object Search(string q) { try { return(PolicyPaMdl.search_policys(q)); } catch (Exception e) { return(new { state = false, message = "Server Error", exception = e }); } }
public object ConfirmPa(int polId) { var db = new SibaModel(); try { var polHead = PolicyPaMdl.get_policy(polId); var premRegs = (from pr in db.INS_PREMIUM_REGISTER where pr.PR_POL_SYS_ID == polId select pr); if (premRegs.Any()) { var premReg = premRegs.Single(); var acntInts = (from a in db.MS_ACCTS_INTEGRATION where a.INT_PRODUCT == premReg.PR_COB && a.INT_TXN_SOURCE == premReg.PR_TXN_REF select a); if (acntInts.Any()) { var acntInt = acntInts.SingleOrDefault(); var polFees = (from f in db.INS_UDW_POL_FEES where f.POL_FEE_POL_SYS_ID == polId select f).ToList(); var commissions = (from c in db.INS_UWD_INTERMEDIARY_COMM where c.CMM_POL_SYS_ID == polId select c).ToList(); var prodrisk = (from u in db.INS_UDW_PERSONAL_ACCIDENT where u.PA_POLH_SYS_ID == polId select u).ToList(); var acntMod = new PolicyPaApprovalMdl(); var result = acntMod.ForwardTransaction(polHead, prodrisk, premReg, acntInt, polFees, commissions); return(result); } else { return new { state = false, message = "The Account is not properly setup" } }; } else { return new { state = false, message = "No record found in the premium register" } }; } catch (Exception e) { return(new { state = false, message = "Server Error", exception = e }); } }
public object EndDeletionData(int polSysId, int endNo) { try { var risk = PolicyHistoryMdl.GetHPolicyHead(polSysId, endNo); risk.POLH_TXN_STATE = "P"; var result = PolicyPaMdl.SaveEndsmntCancl(risk); return(new { state = true, message = "Endorsement Successfully canceled", //data = motor }); } catch (Exception e) { return(new { state = false, message = "Server Error", exception = e }); } }