public static GuarantorLoanApproval GetAllApproveLoanDetailByID(int GuarantorLoanApprovalID)
        {
            DataRow GetApprovalLoanDetailsTable = GuarantorLoanApprovalDataAccess.GetInstance.GetAllApproveLoanDetailByID(GuarantorLoanApprovalID);

            GuarantorLoanApproval TheLoanApplicationDetails = DataRowToObject(GetApprovalLoanDetailsTable);

            return(TheLoanApplicationDetails);
        }
        public static List <GuarantorLoanApproval> GetAllUnpaidApproveLoanList(bool allOffices = true)
        {
            List <GuarantorLoanApproval> GuarantorApprovedLoanList = new List <GuarantorLoanApproval>();

            DataTable GetGuarantorApprovedLoanTable = GuarantorLoanApprovalDataAccess.GetInstance.GetAllUnpaidApproveLoanList(allOffices);

            foreach (DataRow dr in GetGuarantorApprovedLoanTable.Rows)
            {
                GuarantorLoanApproval TheGuarantorApprovedLoan = DataRowToObject(dr);

                GuarantorApprovedLoanList.Add(TheGuarantorApprovedLoan);
            }
            return(GuarantorApprovedLoanList);
        }
        public static GuarantorLoanApproval DataRowToObject(DataRow dr)
        {
            GuarantorLoanApproval TheGuarantorLoanApproval = new GuarantorLoanApproval();

            TheGuarantorLoanApproval.GuarantorLoanApprovalID    = int.Parse(dr["GuarantorLoanApprovalID"].ToString());
            TheGuarantorLoanApproval.GuarantorLoanApplicationID = int.Parse(dr["GuarantorLoanApplicationID"].ToString());
            TheGuarantorLoanApproval.LoanApplicationNumber      = dr["LoanApplicationNumber"].ToString();
            TheGuarantorLoanApproval.LoanApprovalDate           = DateTime.Parse(dr["LoanApprovalDate"].ToString()).ToString(MicroConstants.DateFormat);
            TheGuarantorLoanApproval.LoanApprovalAmount         = decimal.Parse(dr["LoanApprovalAmount"].ToString());
            TheGuarantorLoanApproval.LoanApprovedTenureInMonths = int.Parse(dr["LoanApprovedTenureInMonths"].ToString());
            TheGuarantorLoanApproval.LoanApprovedRateOfInterest = decimal.Parse(dr["LoanApprovedRateOfInterest"].ToString());
            TheGuarantorLoanApproval.LoanApplicantName          = dr["LoanApplicantName"].ToString();

            return(TheGuarantorLoanApproval);
        }
        public int InsertGuarantorLoanApproval(GuarantorLoanApproval theLoanApproval)
        {
            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("@GuarantorLoanApplicationID", SqlDbType.Int, theLoanApproval.GuarantorLoanApplicationID));
            InsertCommand.Parameters.Add(GetParameter("@LoanApplicationNumber", SqlDbType.VarChar, theLoanApproval.LoanApplicationNumber));
            InsertCommand.Parameters.Add(GetParameter("@LoanApprovalDate", SqlDbType.VarChar, theLoanApproval.LoanApprovalDate));
            InsertCommand.Parameters.Add(GetParameter("@LoanApprovalAmount", SqlDbType.Decimal, theLoanApproval.LoanApprovalAmount));
            InsertCommand.Parameters.Add(GetParameter("@LoanApprovedTenureInMonths", SqlDbType.Int, theLoanApproval.LoanApprovedTenureInMonths));
            InsertCommand.Parameters.Add(GetParameter("@LoanApprovedRateOfInterest", SqlDbType.Decimal, theLoanApproval.LoanApprovedRateOfInterest));
            InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));

            InsertCommand.CommandText = "pCRM_GuarantorLoanApprovals_Insert";

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

            return(ReturnValue);
        }
 public static int InsertGuarantorLoanApproval(GuarantorLoanApproval theLoanApproval)
 {
     return(GuarantorLoanApprovalDataAccess.GetInstance.InsertGuarantorLoanApproval(theLoanApproval));
 }
 public int InsertGuarantorLoanApproval(GuarantorLoanApproval theLoanApproval)
 {
     return(GuarantorLoanApprovalIntegration.InsertGuarantorLoanApproval(theLoanApproval));
 }