public int InsertGuarantorLoanRecovery(GuarantorLoanRecoveries theGuarantorLoanRecovery)
        {
            int ReturnValue = 0;

            SqlCommand InsertCommand = new SqlCommand();

            InsertCommand.CommandType = CommandType.StoredProcedure;

            InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
            InsertCommand.Parameters.Add(GetParameter("@GuarantorLoanID", SqlDbType.Int, theGuarantorLoanRecovery.GuarantorLoanID));
            InsertCommand.Parameters.Add(GetParameter("@ReceiptSeries", SqlDbType.VarChar, theGuarantorLoanRecovery.ReceiptSeries));
            InsertCommand.Parameters.Add(GetParameter("@DateOfRecovery", SqlDbType.VarChar, theGuarantorLoanRecovery.DateOfRecovery));
            InsertCommand.Parameters.Add(GetParameter("@InstallmentNumber", SqlDbType.Int, theGuarantorLoanRecovery.InstallmentNumber));
            InsertCommand.Parameters.Add(GetParameter("@AmountPaid", SqlDbType.Decimal, theGuarantorLoanRecovery.AmountPaid));
            InsertCommand.Parameters.Add(GetParameter("@AmountPaidAsPrincipal", SqlDbType.Decimal, theGuarantorLoanRecovery.AmountPaidAsPrincipal));
            InsertCommand.Parameters.Add(GetParameter("@AmountPaidAsInterest", SqlDbType.Decimal, theGuarantorLoanRecovery.AmountPaidAsInterest));
            InsertCommand.Parameters.Add(GetParameter("@PaymentMode", SqlDbType.VarChar, theGuarantorLoanRecovery.PaymentMode));
            InsertCommand.Parameters.Add(GetParameter("@PaymentReference", SqlDbType.VarChar, theGuarantorLoanRecovery.PaymentReference));
            InsertCommand.Parameters.Add(GetParameter("@Remark", SqlDbType.VarChar, theGuarantorLoanRecovery.Remark));
            InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));

            InsertCommand.CommandText = "pCRM_GuarantorLoanReceipts_Insert";

            ExecuteStoredProcedure(InsertCommand);
            ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
Esempio n. 2
0
        public static List <GuarantorLoanRecoveries> GetActiveLoanDetails(int loanApplicantId, string loanAppliedBy)
        {
            List <GuarantorLoanRecoveries> GuarantorLoanRecoveriesList = new List <GuarantorLoanRecoveries>();

            DataTable GuarantorLoanRecoveryTable = GuarantorLoanRecoveryDataAccess.GetInstance.GetActiveLoanDetails(loanApplicantId, loanAppliedBy);

            foreach (DataRow dr in GuarantorLoanRecoveryTable.Rows)
            {
                GuarantorLoanRecoveries TheGuarantorLoanRecoveries = new GuarantorLoanRecoveries();

                TheGuarantorLoanRecoveries.GuarantorLoanID = int.Parse(MicroGlobals.ReturnZeroIfNull(dr["GuarantorLoanID"].ToString()));
                if (TheGuarantorLoanRecoveries.GuarantorLoanID != 0)
                {
                    TheGuarantorLoanRecoveries.GuarantorLoanCode   = dr["GuarantorLoanCode"].ToString();
                    TheGuarantorLoanRecoveries.LoanApplicationDate = DateTime.Parse(dr["LoanApplicationDate"].ToString()).ToString(MicroConstants.DateFormat);
                    TheGuarantorLoanRecoveries.LoanIssueDate       = DateTime.Parse(dr["LoanIssueDate"].ToString()).ToString(MicroConstants.DateFormat);
                    if (TheGuarantorLoanRecoveries.LastRecoveryDate != null)
                    {
                        TheGuarantorLoanRecoveries.LastRecoveryDate = DateTime.Parse(dr["LastRecoveryDate"].ToString()).ToString(MicroConstants.DateFormat);
                    }
                    TheGuarantorLoanRecoveries.LoanAmount               = decimal.Parse(MicroGlobals.ReturnZeroIfNull(dr["LoanAmount"].ToString()));
                    TheGuarantorLoanRecoveries.DuePrincipalAmount       = decimal.Parse(MicroGlobals.ReturnZeroIfNull(dr["DuePrincipalAmount"].ToString()));
                    TheGuarantorLoanRecoveries.DueInterestAmount        = decimal.Parse(MicroGlobals.ReturnZeroIfNull(dr["DueInterestAmount"].ToString()));
                    TheGuarantorLoanRecoveries.InterestPaid             = decimal.Parse(MicroGlobals.ReturnZeroIfNull(dr["InterestPaid"].ToString()));
                    TheGuarantorLoanRecoveries.LoanAmountRecovered      = decimal.Parse(MicroGlobals.ReturnZeroIfNull(dr["LoanAmountRecovered"].ToString()));
                    TheGuarantorLoanRecoveries.NumberOfInstallmentsPaid = int.Parse(MicroGlobals.ReturnZeroIfNull(dr["NumberOfInstallmentsPaid"].ToString()));

                    GuarantorLoanRecoveriesList.Add(TheGuarantorLoanRecoveries);
                }
            }
            return(GuarantorLoanRecoveriesList);
        }
Esempio n. 3
0
        public static GuarantorLoanRecoveries GetGuarantorLoanRecoveriesById(int recordId)
        {
            DataRow GuarantorLoanRecoveryRow = GuarantorLoanRecoveryDataAccess.GetInstance.GetGuarantorLoanRecoveriesById(recordId);

            GuarantorLoanRecoveries TheGuarantorLoanRecoveries = DataRowToObject(GuarantorLoanRecoveryRow);

            return(TheGuarantorLoanRecoveries);
        }
Esempio n. 4
0
        public static List <GuarantorLoanRecoveries> GetGuarantorLoanRecoveriesByGuarantorLoanId(int guarantorloanId)
        {
            List <GuarantorLoanRecoveries> GuarantorLoanRecoveriesList = new List <GuarantorLoanRecoveries>();
            DataTable GuarantorLoanRecoveryTable = GuarantorLoanRecoveryDataAccess.GetInstance.GetGuarantorLoanRecoveriesByGuarantorLoanId(guarantorloanId);

            foreach (DataRow dr in GuarantorLoanRecoveryTable.Rows)
            {
                GuarantorLoanRecoveries TheGuarantorLoanRecoveries = DataRowToObject(dr);

                GuarantorLoanRecoveriesList.Add(TheGuarantorLoanRecoveries);
            }
            return(GuarantorLoanRecoveriesList);
        }
Esempio n. 5
0
        public static List <GuarantorLoanRecoveries> GetLoanHistoryDetails(int RecordID)
        {
            List <GuarantorLoanRecoveries> GuarantorLoanHistoryDetailsList = new List <GuarantorLoanRecoveries>();

            DataTable GetLoanHistoryDetails = new DataTable();

            GetLoanHistoryDetails = GuarantorLoanRecoveryDataAccess.GetInstance.GetLoanHistoryDetails(RecordID);

            foreach (DataRow dr in GetLoanHistoryDetails.Rows)
            {
                GuarantorLoanRecoveries TheLoanHistoryDetails = DataRowToObject(dr);

                GuarantorLoanHistoryDetailsList.Add(TheLoanHistoryDetails);
            }
            return(GuarantorLoanHistoryDetailsList);
        }
        public int DeleteGuarantorLoanRecovery(GuarantorLoanRecoveries theGuarantorLoanRecovery)
        {
            int ReturnValue = 0;

            SqlCommand DeleteCommand = new SqlCommand();

            DeleteCommand.CommandType = CommandType.StoredProcedure;
            DeleteCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
            DeleteCommand.Parameters.Add(GetParameter("@GuarantorLoanReceiptID", SqlDbType.Int, theGuarantorLoanRecovery.GuarantorLoanReceiptID));
            DeleteCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
            DeleteCommand.CommandText = "pCRM_GuarantorLoanReceipts_Delete";

            ExecuteStoredProcedure(DeleteCommand);
            ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
Esempio n. 7
0
        public static GuarantorLoanRecoveries DataRowToObject(DataRow dr)
        {
            GuarantorLoanRecoveries TheGuarantorLoanRecoveries = new GuarantorLoanRecoveries();

            TheGuarantorLoanRecoveries.GuarantorLoanReceiptID     = int.Parse(dr["GuarantorLoanReceiptID"].ToString());
            TheGuarantorLoanRecoveries.ReceiptSeries              = dr["ReceiptSeries"].ToString();
            TheGuarantorLoanRecoveries.GuarantorLoanReceiptNumber = dr["GuarantorLoanReceiptNumber"].ToString();
            TheGuarantorLoanRecoveries.GuarantorLoanID            = int.Parse(dr["GuarantorLoanID"].ToString());
            TheGuarantorLoanRecoveries.DateOfRecovery             = DateTime.Parse(dr["DateOfRecovery"].ToString()).ToString(MicroConstants.DateFormat);
            TheGuarantorLoanRecoveries.AmountPaid            = Decimal.Parse(dr["AmountPaid"].ToString());
            TheGuarantorLoanRecoveries.AmountPaidAsPrincipal = Decimal.Parse(dr["AmountPaidAsPrincipal"].ToString());
            TheGuarantorLoanRecoveries.AmountPaidAsInterest  = Decimal.Parse(dr["AmountPaidAsInterest"].ToString());
            TheGuarantorLoanRecoveries.InstallmentNumber     = int.Parse(dr["InstallmentNumber"].ToString());
            TheGuarantorLoanRecoveries.Remark           = dr["Remark"].ToString();
            TheGuarantorLoanRecoveries.PaymentMode      = dr["PaymentMode"].ToString();
            TheGuarantorLoanRecoveries.PaymentReference = dr["PaymentReference"].ToString();

            return(TheGuarantorLoanRecoveries);
        }
Esempio n. 8
0
 public int DeleteGuarantorLoanRecovery(GuarantorLoanRecoveries theGuarantorLoanRecovery)
 {
     return(GuarantorLoanRecoveryIntegration.DeleteGuarantorLoanRecovery(theGuarantorLoanRecovery));
 }
Esempio n. 9
0
 public int InsertGuarantorLoanRecovery(GuarantorLoanRecoveries theGuarantorLoanRecovery)
 {
     return(GuarantorLoanRecoveryIntegration.InsertGuarantorLoanRecovery(theGuarantorLoanRecovery));
 }
Esempio n. 10
0
 public static int DeleteGuarantorLoanRecovery(GuarantorLoanRecoveries theGuarantorLoanRecovery)
 {
     return(GuarantorLoanRecoveryDataAccess.GetInstance.DeleteGuarantorLoanRecovery(theGuarantorLoanRecovery));
 }