public static GuarantorLoan DataRowToObject(DataRow dr) { GuarantorLoan TheGuarantorLoan = new GuarantorLoan(); TheGuarantorLoan.GuarantorLoanID = int.Parse(dr["GuarantorLoanID"].ToString()); //TheGuarantorLoan.GuarantorLoanCode=dr["GuarantorLoanCode"].ToString(); TheGuarantorLoan.GuarantorLoanApplicationID = int.Parse(dr["GuarantorLoanApplicationID"].ToString()); TheGuarantorLoan.LoanIssueDate = DateTime.Parse(dr["LoanIssueDate"].ToString()).ToString(MicroConstants.DateFormat); TheGuarantorLoan.LoanAppliedBy = dr["LoanAppliedBy"].ToString(); TheGuarantorLoan.LoanApplicantID = int.Parse(dr["LoanApplicantID"].ToString()); TheGuarantorLoan.LoanApplicantName = dr["LoanApplicantName"].ToString(); TheGuarantorLoan.LoanApplicationNumber = dr["LoanApplicationNumber"].ToString(); TheGuarantorLoan.LoanApplicationDate = DateTime.Parse(dr["LoanApplicationDate"].ToString()).ToString(MicroConstants.DateFormat); TheGuarantorLoan.LoanApplicationFee = decimal.Parse(dr["LoanApplicationFee"].ToString()); TheGuarantorLoan.RequiredFor = dr["RequiredFor"].ToString(); TheGuarantorLoan.LoanAmountApplied = decimal.Parse(dr["LoanAmountApplied"].ToString()); TheGuarantorLoan.LoanAmount = decimal.Parse(dr["LoanAmount"].ToString()); TheGuarantorLoan.RateOfInterest = decimal.Parse(dr["RateOfInterest"].ToString()); TheGuarantorLoan.InstallmentType = dr["InstallmentType"].ToString(); TheGuarantorLoan.TenureInMonths = int.Parse(dr["TenureInMonths"].ToString()); TheGuarantorLoan.EMIStartsFromDate = DateTime.Parse(dr["EMIStartsFromDate"].ToString()).ToString(MicroConstants.DateFormat); TheGuarantorLoan.IsClosed = bool.Parse(dr["IsClosed"].ToString()); if (TheGuarantorLoan.IsClosed) { TheGuarantorLoan.ClosureDate = DateTime.Parse(dr["ClosureDate"].ToString()).ToString(MicroConstants.DateFormat); } return(TheGuarantorLoan); }
public int UpdateGuarantorLoan(GuarantorLoan theGuarantorLoan) { int ReturnValue = 0; SqlCommand UpdateCommand = new SqlCommand(); UpdateCommand.CommandType = CommandType.StoredProcedure; UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output; UpdateCommand.Parameters.Add(GetParameter("@GuarantorLoanID", SqlDbType.Int, theGuarantorLoan.GuarantorLoanID)); UpdateCommand.Parameters.Add(GetParameter("@GuarantorLoanApplicationID", SqlDbType.Int, theGuarantorLoan.GuarantorLoanApplicationID)); UpdateCommand.Parameters.Add(GetParameter("@LoanIssueDate", SqlDbType.VarChar, theGuarantorLoan.LoanIssueDate)); UpdateCommand.Parameters.Add(GetParameter("@LoanAmount", SqlDbType.Decimal, theGuarantorLoan.LoanAmount)); UpdateCommand.Parameters.Add(GetParameter("@RateOfInterest", SqlDbType.Decimal, theGuarantorLoan.RateOfInterest)); UpdateCommand.Parameters.Add(GetParameter("@InstallmentType", SqlDbType.VarChar, theGuarantorLoan.InstallmentType)); UpdateCommand.Parameters.Add(GetParameter("@TenureInMonths", SqlDbType.Int, theGuarantorLoan.TenureInMonths)); UpdateCommand.Parameters.Add(GetParameter("@EMIStartsFromDate", SqlDbType.VarChar, theGuarantorLoan.EMIStartsFromDate)); UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); UpdateCommand.CommandText = "pCRM_GuarantorLoans_Update"; ExecuteStoredProcedure(UpdateCommand); ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString()); return(ReturnValue); }
public static GuarantorLoan GetGuarantorLoansById(int GuarantorLoanID) { DataRow GuarantorLoanRow = GuarantorLoanDataAccess.GetInstance.GetGuarantorLoansById(GuarantorLoanID); GuarantorLoan TheGuarantorLoan = DataRowToObject(GuarantorLoanRow); return(TheGuarantorLoan); }
public static GuarantorLoan GetGuarantorLoanDetails(int GuarantorLoanID) { DataRow GetGuarantorLoanTable = GuarantorLoanDataAccess.GetInstance.GetGuarantorLoanDetails(GuarantorLoanID); GuarantorLoan TheLoanGuarantorLoanDetails = DataRowToObject(GetGuarantorLoanTable); return(TheLoanGuarantorLoanDetails); }
public static GuarantorLoan GetPreviousLoanDetails(int LoanApplicantID, string RecordValue) { DataRow GetPreviousLoanTable = GuarantorLoanDataAccess.GetInstance.GetPreviousLoanDetails(LoanApplicantID, RecordValue); GuarantorLoan ThePreviousLoanDetails = DataRowToObject(GetPreviousLoanTable); return(ThePreviousLoanDetails); }
public static GuarantorLoan GetEMIChartDetails(int LoanApplicantID) { DataRow GetLoanApplicationTable = GuarantorLoanDataAccess.GetInstance.GetEMIChartDetails(LoanApplicantID); GuarantorLoan TheLoanApplicationDetails = DataRowToObject(GetLoanApplicationTable); return(TheLoanApplicationDetails); }
//public static List<GuarantorLoan> GetGuarantorLoans(string loanAppliedBy, string officeIds) //{ // var GuarantorLoans = (from TheLoans in GetGuarantorLoanList() // where TheLoans.LoanAppliedBy == loanAppliedBy // && officeIds.Contains((TheLoans.OfficeID).ToString()) // select TheLoans).ToList(); // List<GuarantorLoan> GuarantorLoanList = new List<GuarantorLoan>(); // foreach(GuarantorLoan TheLoan in GuarantorLoans) // { // GuarantorLoan TheGuarantorLoan = new GuarantorLoan(); // TheGuarantorLoan.GuarantorLoanID = TheLoan.GuarantorLoanID; // TheGuarantorLoan.GuarantorLoanApplicationID = TheLoan.GuarantorLoanApplicationID; // TheGuarantorLoan.LoanAppliedBy = TheLoan.LoanAppliedBy; // TheGuarantorLoan.LoanApplicantID = TheLoan.LoanApplicantID; // TheGuarantorLoan.LoanApplicantName = TheLoan.LoanApplicantName; // TheGuarantorLoan.LoanApplicationNumber = TheLoan.LoanApplicationNumber; // TheGuarantorLoan.LoanApplicationDate = TheLoan.LoanApplicationDate; // TheGuarantorLoan.LoanApplicationFee = TheLoan.LoanApplicationFee; // TheGuarantorLoan.RequiredFor = TheLoan.RequiredFor; // TheGuarantorLoan.LoanAmountApplied = TheLoan.LoanAmountApplied; // TheGuarantorLoan.LoanIssueDate = TheLoan.LoanIssueDate; // TheGuarantorLoan.LoanAmount = TheLoan.LoanAmount; // TheGuarantorLoan.RateOfInterest = TheLoan.RateOfInterest; // TheGuarantorLoan.InstallmentType =TheLoan.InstallmentType; // TheGuarantorLoan.TenureInMonths = TheLoan.TenureInMonths; // TheGuarantorLoan.EMIStartsFromDate =TheLoan.EMIStartsFromDate; // TheGuarantorLoan.IsClosed = TheLoan.IsClosed; // if(TheGuarantorLoan.IsClosed) // TheGuarantorLoan.ClosureDate = TheLoan.ClosureDate; // GuarantorLoanList.Add(TheGuarantorLoan); // } // return GuarantorLoanList; //} public static List <GuarantorLoan> GetAllPreviousLoanDetailByID(int LoanApplicantID, string LoanAppliedBy) { List <GuarantorLoan> GuarantorPreviousLoanDetailsList = new List <GuarantorLoan>(); DataTable GetGuarantorPreviousLoanDetails = GuarantorLoanDataAccess.GetInstance.GetAllPreviousLoanDetailByID(LoanApplicantID, LoanAppliedBy); foreach (DataRow dr in GetGuarantorPreviousLoanDetails.Rows) { GuarantorLoan TheGuarantorPreviousLoanDetails = DataRowToObject(dr); GuarantorPreviousLoanDetailsList.Add(TheGuarantorPreviousLoanDetails); } return(GuarantorPreviousLoanDetailsList); }
public static List <GuarantorLoan> GetGuarantorLoanList(bool allOffices = true, bool showDeleted = false, bool showClosed = false) { List <GuarantorLoan> GuarantorLoanList = new List <GuarantorLoan>(); DataTable GetGuarantorLoanTable = GuarantorLoanDataAccess.GetInstance.GetGuarantorLoanList(allOffices, showDeleted, showClosed); foreach (DataRow dr in GetGuarantorLoanTable.Rows) { GuarantorLoan TheGuarantorLoan = DataRowToObject(dr); GuarantorLoanList.Add(TheGuarantorLoan); } return(GuarantorLoanList); }
public static List <GuarantorLoan> GetGuarantorLoansByLoanAppliedBy(string loanAppliedBy, bool allOffices, string officeIds) { List <GuarantorLoan> GuarantorLoanList = new List <GuarantorLoan>(); DataTable GetGuarantorLoanTable = GuarantorLoanDataAccess.GetInstance.GetGuarantorLoansByLoanAppliedBy(loanAppliedBy, allOffices, officeIds); foreach (DataRow dr in GetGuarantorLoanTable.Rows) { GuarantorLoan TheGuarantorLoan = DataRowToObject(dr); GuarantorLoanList.Add(TheGuarantorLoan); } return(GuarantorLoanList); }
public int DeleteGuarantorLoan(GuarantorLoan theGuarantorLoan) { 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("@GuarantorLoanID", SqlDbType.Int, theGuarantorLoan.GuarantorLoanID)); DeleteCommand.CommandText = "pCRM_GuarantorLoans_Delete"; ExecuteStoredProcedure(DeleteCommand); ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString()); return(ReturnValue); }
public static List <GuarantorLoan> EMITable(double RateOfInterest, double Tenure, double PrincipalAmount, double Emiamount) { List <GuarantorLoan> EMITableList = new List <GuarantorLoan>(); DataTable GetEMITable = new DataTable(); GetEMITable = GuarantorLoanDataAccess.GetInstance.EMITable(RateOfInterest, Tenure, PrincipalAmount, Emiamount); foreach (DataRow dr in GetEMITable.Rows) { GuarantorLoan TheGuarantorLoan = new GuarantorLoan(); TheGuarantorLoan.Interestrate = double.Parse(dr["RateOfInterest"].ToString()); TheGuarantorLoan.Tenure = double.Parse(dr["Tenure"].ToString()); TheGuarantorLoan.PrincipalAmount = double.Parse(dr["PrincipalAmount"].ToString()); TheGuarantorLoan.Emiamount = double.Parse(dr["Emiamount"].ToString()); EMITableList.Add(TheGuarantorLoan); } return(EMITableList); }
public static int DeleteGuarantorLoan(GuarantorLoan theGuarantorLoan) { return(GuarantorLoanDataAccess.GetInstance.DeleteGuarantorLoan(theGuarantorLoan)); }
public static int InsertGuarantorLoan(GuarantorLoan theGuarantorLoan) { return(GuarantorLoanDataAccess.GetInstance.InsertGuarantorLoan(theGuarantorLoan)); }
public int DeleteGuarantorLoan(GuarantorLoan theGuarantorLoan) { return(GuarantorLoanIntegration.DeleteGuarantorLoan(theGuarantorLoan)); }
public int UpdateGuarantorLoan(GuarantorLoan theGuarantorLoan) { return(GuarantorLoanIntegration.UpdateGuarantorLoan(theGuarantorLoan)); }
public int InsertGuarantorLoan(GuarantorLoan theGuarantorLoan) { return(GuarantorLoanIntegration.InsertGuarantorLoan(theGuarantorLoan)); }