Ejemplo n.º 1
0
        /// <summary>
        /// Truy vấn tình hình thu phí của hợp đồng
        /// dutp
        /// 22/7/20
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public ResultSearchListRepaymentSchedule searchRepaymentSchedule(SearchRepaymentSchedule input)
        {
            try
            {
                SqlParameter[] prms = new SqlParameter[]
                {
                    new SqlParameter {
                        ParameterName = "fromDate", DbType = DbType.Date, Value = input.fromDate == null ? (object)DBNull.Value: input.fromDate, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "toDate", DbType = DbType.Date, Value = input.toDate == null ? (object)DBNull.Value: input.toDate, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "insuranceContractNo", DbType = DbType.String, Value = string.IsNullOrEmpty(input.insuranceContractNo) ? (object)DBNull.Value : input.insuranceContractNo, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "customerCif", DbType = DbType.String, Value = string.IsNullOrEmpty(input.customerCif) ? (object)DBNull.Value : input.customerCif, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "paymentStatus", DbType = DbType.String, Value = string.IsNullOrEmpty(input.paymentStatus) ? (object)DBNull.Value : input.paymentStatus, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "branchCode", DbType = DbType.String, Value = string.IsNullOrEmpty(input.branchCode) ? (object)DBNull.Value : input.branchCode, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "userId", DbType = DbType.String, Value = string.IsNullOrEmpty(input.userId) ? (object)DBNull.Value : input.userId, Size = Int32.MaxValue
                    },

                    new SqlParameter {
                        ParameterName = "pageNumber", DbType = DbType.Int32, Value = input.pageNumber, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "pageSize", DbType = DbType.Int32, Value = input.pageSize, Size = Int32.MaxValue
                    },


                    new SqlParameter {
                        ParameterName = "resultMessage", DbType = DbType.String, Direction = ParameterDirection.Output, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "resultCode", DbType = DbType.Int32, Direction = ParameterDirection.Output, Size = Int32.MaxValue
                    }
                };
                var resultObject = new ResultSearchListRepaymentSchedule();
                var result       = _Repository.ExecWithStoreProcedureCommand(Store_searchRepaymentSchedule, prms);
                if (result.errorCode == 0)
                {
                    resultObject = JsonConvert.DeserializeObject <ResultSearchListRepaymentSchedule>(result.errorMessage);
                }
                return(resultObject);
            }
            catch (Exception ex)
            {
                HDBH.Log.WriteLog.Error("PaymentService => searchRepaymentSchedule", ex);
                return(new ResultSearchListRepaymentSchedule());
            }
        }
Ejemplo n.º 2
0
        public JsonResult searchRepaymentSchedule(SearchRepaymentSchedule input)
        {
            var result = new ResultSearchListRepaymentSchedule();

            input.userId     = RDAuthorize.UserId;
            input.branchCode = RDAuthorize.BranchCode;
            if (input._paymentStatus != null)
            {
                input.paymentStatus = JsonConvert.SerializeObject(input._paymentStatus);
            }
            else
            {
                input.paymentStatus = "";
            }

            result = _paymentservice.searchRepaymentSchedule(input);

            return(Json(new
            {
                data = result.resultList,
                recordsTotal = result.TotalRecord,
                recordsFiltered = result.TotalRecord,
            }));
        }