Пример #1
0
        public ListpartersResponse GetPartnerByUserID(long UserID)
        {
            ListpartersResponse response = new ListpartersResponse();

            try
            {
                using (IDbConnection conn = GetConnection())
                {
                    response.partners = conn.Query <LoanPartners>(" SELECT * FROM hdldb.LoanPartners where UserID= ?UserID ", new { UserID }).ToList();
                    if (response.partners.Count > 0)
                    {
                        response.Status      = true;
                        response.Description = "Successful";
                    }
                    else
                    {
                        response.Status      = false;
                        response.Description = "No data";
                    }
                }
            }
            catch (Exception ex)
            {
                response.Status      = false;
                response.Description = ex.Message;
            }
            return(response);
        }
Пример #2
0
        public ListpartersResponse GetLoanByEmail(string email)
        {
            ListpartersResponse response = new ListpartersResponse();

            try
            {
                using (IDbConnection conn = GetConnection())
                {
                    response.partners = conn.Query <LoanPartners>(" SELECT * FROM hdldb.MortgageLoanApplication where Email= ?Email ", new { email }).ToList();
                    if (response.partners.Count > 0)
                    {
                        response.Status      = true;
                        response.Description = "Successful";
                    }
                    else
                    {
                        response.Status      = false;
                        response.Description = "No data";
                    }
                }
            }
            catch (Exception ex)
            {
                response.Status      = false;
                response.Description = ex.Message;
            }
            return(response);
        }
Пример #3
0
        //DateTime? StartDate, DateTime? EndDate
        public ListpartersResponse List()
        {
            ListpartersResponse response = new ListpartersResponse();

            try
            {
                using (IDbConnection conn = GetConnection())
                {
                    response.partners = conn.GetList <LoanPartners>().ToList();
                    //if (StartDate.HasValue && EndDate.HasValue)
                    //{
                    //    response.mortgageapplications = conn.GetList<MortgageApplication>("where convert(loandate, date) between convert(?StartDate, date) and convert(?EndDate, date)", new { StartDate, EndDate }).ToList();
                    //}
                    //else
                    //{

                    //}
                    if (response.partners.Count > 0)
                    {
                        response.Status      = true;
                        response.Description = "Successful";
                    }
                    else
                    {
                        response.Status      = false;
                        response.Description = "No data";
                    }
                }
            }
            catch (Exception ex)
            {
                response.Status      = false;
                response.Description = ex.Message;
            }
            return(response);
        }