Ejemplo n.º 1
0
        public object Save([FromBody] INS_UWD_POLICY_HEAD liability)
        {
            try
            {
                var result = PolicyLiabilityMdl.save_policy(liability);

                return(new
                {
                    state = true,
                    message = "Liability 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 });
            }
        }
Ejemplo n.º 2
0
 public object Search(string q)
 {
     try
     {
         return(PolicyLiabilityMdl.search_policys(q));
     }
     catch (Exception e)
     {
         return(new { state = false, message = "Server Error", exception = e });
     }
 }
Ejemplo n.º 3
0
        public object ConfirmLiability(int polId)
        {
            var db = new SibaModel();

            try
            {
                var polHead = PolicyLiabilityMdl.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_LIABILITY where u.LIA_POLH_SYS_ID == polId select u).ToList();
                        var wkscomp     = (from u in db.INS_UDW_LIABILITY_WKS_COMP where u.LIAWOC_POLH_SYS_ID == polId select u).ToList();
                        var acntMod     = new PolicyLiabilityApprovalMdl();
                        var result      = acntMod.ForwardTransaction(polHead, prodrisk, wkscomp, 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 });
            }
        }
Ejemplo n.º 4
0
        public object EndDeletionData(int polSysId, int endNo)
        {
            try
            {
                var risk = PolicyHistoryMdl.GetHPolicyHead(polSysId, endNo);
                risk.POLH_TXN_STATE = "P";
                var result = PolicyLiabilityMdl.SaveEndsmntCancl(risk);

                return(new
                {
                    state = true,
                    message = "Endorsement Successfully canceled",
                    //data = motor
                });
            }
            catch (Exception e)
            {
                return(new { state = false, message = "Server Error", exception = e });
            }
        }