/// <summary>
        /// Returns number of installment due.
        /// </summary>
        /// <param name="dateofCommencement">Starting date of the policy.</param>
        /// <param name="policyMode">The installment mode. e.g. Mly.</param>
        /// <param name="termInMonths">Tenure of a policy in terms of month.</param>
        /// <param name="installmentsPaid">Number of installments already paid.</param>
        /// <param name="dateofPayment">Date of payment.</param>
        /// <returns></returns>
        public static int NumberOfInstallmentsDue(DateTime dateofCommencement, string policyMode, int termInMonths, int installmentsPaid, DateTime dateofPayment)
        {
            int ReturnValue = 0;

            if (!policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.OneTime)))
            {
                int InstallmentsInterval   = (PolicyModeToNumber(policyMode, MicroEnums.PolicyModeConversionType.Intervals));
                int DateDifferenceInMonths = MicroGlobals.GetDateDifferenceInMonths(dateofPayment, dateofCommencement);
                int InstallmentsToBePaid   = 0;

                if (DateDifferenceInMonths >= termInMonths)
                {
                    InstallmentsToBePaid = (termInMonths / InstallmentsInterval);
                }
                else
                {
                    InstallmentsToBePaid = ((DateDifferenceInMonths - (DateDifferenceInMonths % InstallmentsInterval)) / InstallmentsInterval);
                }

                if (installmentsPaid < InstallmentsToBePaid)
                {
                    ReturnValue = InstallmentsToBePaid - installmentsPaid;
                }
                else
                {
                    ReturnValue = 0;
                }
            }

            return(ReturnValue);
        }
        private int InsertVoucherDetails(int voucherID)
        {
            int ReturnValue = 0;

            List <VoucherDetails> VoucherDetailsList = new List <VoucherDetails>();

            foreach (GridViewRow TheRow in gView_DebitVoucher.Rows)
            {
                VoucherDetails TheVoucherDetails = new VoucherDetails();
                {
                    TheVoucherDetails.VoucherID = voucherID;

                    if (TheRow.Cells[0].Text != "Cash")
                    {
                        TheVoucherDetails.VoucherAmount    = decimal.Parse(TheRow.Cells[1].Text);
                        TheVoucherDetails.VoucherEntryType = MicroEnums.GetStringValue(MicroEnums.VoucherEntryType.DebitSide);
                    }
                    else
                    {
                        TheVoucherDetails.VoucherAmount    = PageVariables.TotalDebitAmount;
                        TheVoucherDetails.VoucherEntryType = MicroEnums.GetStringValue(MicroEnums.VoucherEntryType.CreditSide);
                    }
                    TheVoucherDetails.AccountLedgerDescription = TheRow.Cells[0].Text;
                }

                VoucherDetailsList.Add(TheVoucherDetails);
            }
            ReturnValue = VoucherManagement.GetInstance.InsertVoucherDetails(VoucherDetailsList);
            return(ReturnValue);
        }
        /// <summary>
        /// Returns total number of installments to be paid.
        /// </summary>
        /// <param name="policyMode">The installment mode. e.g. Mly.</param>
        /// <param name="termInMonths">Tenure of a policy in terms of month.</param>
        /// <returns></returns>
        public static int InstallmentsToBePaid(string policyMode, int termInMonths)
        {
            int ReturnValue = 1;

            if (!policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.OneTime)))
            {
                int Intervals = PolicyModeToNumber(policyMode, MicroEnums.PolicyModeConversionType.Intervals);
                ReturnValue = termInMonths / Intervals;
            }

            return(ReturnValue);
        }
        /// <summary>
        /// Returns due date of last installment to be paid.
        /// </summary>
        /// <param name="dateofCommencement">Starting date of the policy.</param>
        /// <param name="policyMode">The installment mode. e.g. Mly.</param>
        /// <param name="termInMonths">Tenure of a policy in terms of month.</param>
        /// <returns></returns>
        public static DateTime DueDateofLastPayment(DateTime dateofCommencement, string policyMode, int termInMonths)
        {
            DateTime ReturnValue = dateofCommencement;

            if (!policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.OneTime)))
            {
                int Intervals = PolicyModeToNumber(policyMode, MicroEnums.PolicyModeConversionType.Intervals);
                ReturnValue = DueDateofMaturity(dateofCommencement, termInMonths).AddMonths(-Intervals);
            }

            return(ReturnValue);
        }
        /// <summary>
        /// Returns number of installments to be paid on each intervals of mode.
        /// </summary>
        /// <param name="policyMode">The installment mode. e.g. Mly.</param>
        /// <param name="conversionType">Return type. May be Installments or Intervals.</param>
        /// <returns></returns>
        public static int PolicyModeToNumber(string policyMode, MicroEnums.PolicyModeConversionType conversionType)
        {
            int ReturnValue = 1;

            if (conversionType.Equals(MicroEnums.PolicyModeConversionType.Installments))
            {
                if (policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.Mly)))
                {
                    ReturnValue = 12;
                }

                else if (policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.Qly)))
                {
                    ReturnValue = 4;
                }

                else if (policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.Hly)))
                {
                    ReturnValue = 2;
                }

                else
                {
                    ReturnValue = 1;
                }
            }

            else if (conversionType.Equals(MicroEnums.PolicyModeConversionType.Intervals))
            {
                if (policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.Mly)))
                {
                    ReturnValue = 1;
                }

                else if (policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.Qly)))
                {
                    ReturnValue = 3;
                }

                else if (policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.Hly)))
                {
                    ReturnValue = 6;
                }

                else
                {
                    ReturnValue = 12;
                }
            }

            return(ReturnValue);
        }
        /// <summary>
        /// Returns due date of an installment for Recurring Deposits.
        /// </summary>
        /// <param name="dateofCommencement">Starting date of the policy.</param>
        /// <param name="policyMode">The installment mode. e.g. Mly.</param>
        /// <param name="installmentNumber">An integer value specifing installment number.</param>
        /// <returns></returns>
        public static DateTime DueDateofInstallment(DateTime dateofCommencement, string policyMode, int installmentNumber)
        {
            DateTime ReturnValue = dateofCommencement;

            if (!policyMode.Equals(MicroEnums.GetStringValue(MicroEnums.PolicyMode.OneTime)))
            {
                int Intervals    = PolicyModeToNumber(policyMode, MicroEnums.PolicyModeConversionType.Intervals);
                int DuesInMonths = Intervals * (installmentNumber - 1);

                ReturnValue = dateofCommencement.AddMonths(DuesInMonths);
            }

            return(ReturnValue);
        }
Exemplo n.º 7
0
        public static void ChangeMartialStatus(DropDownList theSalutation, DropDownList theGender, DropDownList theMaritalStatus, TextBox theHusbandName)
        {
            string TheSalutation = theSalutation.SelectedItem.Text;

            //if (TheSalutation.Equals(MicroEnums.GetStringValue(MicroEnums.Salutations.Mr)))
            //{
            //    theHusbandName.ReadOnly = true;
            //    theHusbandName.Text = string.Empty;
            //}
            //else if (TheSalutation.Equals(MicroEnums.GetStringValue(MicroEnums.Salutations.Miss)))
            //{
            //    theMaritalStatus.Text = MicroEnums.GetStringValue(MicroEnums.MaritalStatus.Unmarried);
            //    theHusbandName.ReadOnly = true;
            //    theHusbandName.Text = string.Empty;
            //}
            //else if (TheSalutation.Equals(MicroEnums.GetStringValue(MicroEnums.Salutations.Mrs)))
            //{
            //    theMaritalStatus.Text = MicroEnums.GetStringValue(MicroEnums.MaritalStatus.Married);
            //    theHusbandName.ReadOnly = false;
            //}
            //else if (TheSalutation.Equals(MicroEnums.GetStringValue(MicroEnums.Salutations.Dr)))
            //{
            //    string TheGender = theGender.SelectedItem.Text;
            //    string TheMaritalStatus = theMaritalStatus.SelectedItem.Text;

            //    if (TheGender.Equals(MicroEnums.Gender.Female.GetStringValue()) && TheMaritalStatus.Equals(MicroEnums.MaritalStatus.Married.GetStringValue()))
            //    {
            //        theHusbandName.ReadOnly = false;
            //    }
            //    else
            //    {
            //        theHusbandName.ReadOnly = true;
            //        theHusbandName.Text = string.Empty;
            //    }
            //}

            theHusbandName.ReadOnly = !(theMaritalStatus.Text.ToString().Equals(MicroEnums.GetStringValue(MicroEnums.MaritalStatus.Married)));
            if (theHusbandName.ReadOnly)
            {
                theHusbandName.BackColor = Color.LightGray;
                theHusbandName.Text      = string.Empty;
            }
            else
            {
                theHusbandName.BackColor = Color.White;
            }
        }
Exemplo n.º 8
0
        public decimal GetSettingValue(string settingKeyName, int moduleID)
        {
            decimal ReturnValue = 0;

            MicroSetting TheSetting = GetSettingByName(settingKeyName, moduleID);

            if (TheSetting.SettingID > 0)
            {
                if (TheSetting.SettingDataType == MicroEnums.GetStringValue(MicroEnums.SettingDataType.Decimal))
                {
                    ReturnValue = decimal.Parse(TheSetting.SettingValue);
                }

                else if (TheSetting.SettingDataType == MicroEnums.GetStringValue(MicroEnums.SettingDataType.Percentage))
                {
                    ReturnValue = (decimal.Parse(TheSetting.SettingValue) / 100);
                }
            }

            return(ReturnValue);
        }
Exemplo n.º 9
0
        public static PreMaturityApplication GetLastPreMaturtiyApplicationByCustomerAccountID(int customerAccountID)
        {
            PreMaturityApplication ThePreMaturityApplication = null;

            List <PreMaturityApplication> PreMaturityApplicationList = GetPreMaturityApplicationListByCustomerAccountID(customerAccountID);

            if (PreMaturityApplicationList.Count > 0)
            {
                var LastPreMaturityApplication = (from TheApplicationList in PreMaturityApplicationList
                                                  where TheApplicationList.PreMaturityApprovalStatus != MicroEnums.GetStringValue(MicroEnums.ApprovalStatus.Rejected)
                                                  orderby DateTime.Parse(TheApplicationList.PreMaturityApplicationDate)
                                                  select TheApplicationList).LastOrDefault();

                ThePreMaturityApplication = (PreMaturityApplication)LastPreMaturityApplication;
            }

            return(ThePreMaturityApplication);
        }