Exemple #1
0
 private static void PrintPremiumDetail(PremiumModel actualPremium, bool isActualpreium = true)
 {
     if (isActualpreium)
     {
         Console.WriteLine("Actual Premium (Before Update)");
     }
     else
     {
         Console.WriteLine("Expected Premium (After Update)");
     }
     Console.WriteLine(
         "\tBefore Fee = {0}\n" +
         "\tDuty = {1}\n" +
         "\tAfter Fee = {2}\n", actualPremium.PremiumBeforeFee, actualPremium.Duty, actualPremium.PremiumAfterFee);
 }
Exemple #2
0
        private static void UpdateInAppItem(DbConnection visConn, PremiumModel premium, string inAppItemId)
        {
            PrintPremiumDetail(premium, false);
            var updateQuery = "UPDATE InsuranceApplicationItem " +
                              "SET TotalBeforeFee = " + premium.PremiumBeforeFee +
                              " ,TotalDuty = " + premium.Duty +
                              " ,TotalAfterFee = " + premium.PremiumAfterFee +
                              " ,ModifiedUsername = '******'" +
                              " WHERE Id = '" + inAppItemId + "'";

            var reader = visConn.ExecutrQueryReader(updateQuery);

            visConn.CloseConnection();
            //var result = reader.Read();
        }
Exemple #3
0
        private static void UpdatePremiumSchedule(DbConnection visConn, EndorseModel objEndModel)
        {
            Console.WriteLine("\n========================");
            Console.WriteLine("4.1 Update PremiumSchedule of Endorsement");
            Console.WriteLine("========================\n");
            var query = "SELECT p.TotalBeforefee,p.totalDuty ,p.TotalAfterFee  " +
                        " from Agreement a " +
                        " inner join PremiumSchedule ps on ps.InsuranceApplication_Id=a.InsuranceApplication_Id " +
                        " inner join PaymentApplication pa on pa.PremiumSchedule_Id=ps.Id " +
                        " inner join Payment p on p.Id = pa.Payment_Id " +
                        " where a.ReferenceNumber = '" + objEndModel.APENumber + "'";
            var reader = visConn.ExecutrQueryReader(query);

            if (reader.Read())
            {
                var premiumTemp = new PremiumModel()
                {
                    PremiumBeforeFee = reader["TotalBeforefee"].ToString(),
                    Duty             = reader["totalDuty"].ToString(),
                    PremiumAfterFee  = reader["TotalAfterFee"].ToString()
                };

                PrintPremiumDetail(premiumTemp);
            }
            visConn.CloseConnection();
            if (objEndModel.IsAdding)
            {
                var updateQuery = "UPDATE p " +
                                  "SET p.TotalBeforefee = " + objEndModel.ExpectedPremiumForEndorsement.PremiumBeforeFee +
                                  " ,p.totalDuty = " + objEndModel.ExpectedPremiumForEndorsement.Duty +
                                  " ,p.TotalAfterFee = " + objEndModel.ExpectedPremiumForEndorsement.PremiumAfterFee +
                                  " from Agreement a " +
                                  " inner join PremiumSchedule ps on ps.InsuranceApplication_Id=a.InsuranceApplication_Id " +
                                  " inner join PaymentApplication pa on pa.PremiumSchedule_Id=ps.Id " +
                                  " inner join Payment p on p.Id = pa.Payment_Id " +
                                  " where a.ReferenceNumber = '" + objEndModel.APENumber + "'";
                PrintPremiumDetail(objEndModel.ExpectedPremiumForEndorsement, false);
                reader = visConn.ExecutrQueryReader(updateQuery);
                visConn.CloseConnection();
            }
            //var result = reader.Read();
        }
Exemple #4
0
 public void InitialPremium(PremiumModel premium, string premiumBeforeFee, string duty, string premiumAfterFee)
 {
     premium.PremiumBeforeFee = premiumBeforeFee;
     premium.PremiumAfterFee  = premiumAfterFee;
     premium.Duty             = duty;
 }