Ejemplo n.º 1
0
        public ActionResult ExportRepaymentManagement(SearchPaymentModel input)
        {
            using (XLWorkbook wb = new XLWorkbook())
            {
                var result = new ResultSearchListPayment();
                result = _paymentservice.searchRepayment(input);

                if (result.resultList.Any())
                {
                    wb.Worksheets.Add(MapModelToTable(result.resultList), "QUẢN LÝ THANH TOÁN");

                    Response.Clear();
                    Response.Buffer      = true;
                    Response.Charset     = "";
                    Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                    Response.AddHeader("content-disposition", $"attachment;filename={DateTime.Now:yyyyMMdd}_RepaymentManagement.xlsx");
                    using (MemoryStream myMemoryStream = new MemoryStream())
                    {
                        wb.SaveAs(myMemoryStream);
                        myMemoryStream.WriteTo(Response.OutputStream);
                        Response.End();
                        return(Content("Thành công"));
                    }
                }
                return(Content("Không có dữ liệu"));
            }
        }
Ejemplo n.º 2
0
        public JsonResult SearchList(SearchPaymentModel input)
        {
            var result = new ResultSearchListPayment();

            input.userId = RDAuthorize.UserId;
            if (input._processStatusList != null)
            {
                input.processStatusList = JsonConvert.SerializeObject(input._processStatusList);
            }
            else
            {
                input.processStatusList = "";
            }
            result = _paymentservice.searchRepayment(input);
            return(Json(new
            {
                data = result.resultList,
                recordsTotal = result.TotalRecord,
                recordsFiltered = result.TotalRecord,
            }));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Màn hình Quản lý danh sách phiếu thu
        /// dutp
        /// 21/7
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public ResultSearchListPayment searchRepayment(SearchPaymentModel input)
        {
            try
            {
                SqlParameter[] prms = new SqlParameter[]
                {
                    new SqlParameter {
                        ParameterName = "isInau", DbType = DbType.Int32, Value = input.isInau, Size = Int32.MaxValue
                    },
                    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 = "ftttNo", DbType = DbType.String, Value = string.IsNullOrEmpty(input.ftttNo) ? (object)DBNull.Value : input.ftttNo, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "userUpdated", DbType = DbType.String, Value = string.IsNullOrEmpty(input.userUpdated) ? (object)DBNull.Value : input.userUpdated, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "externalRepayment", DbType = DbType.Int32, Value = input.externalRepayment, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "processStatusList", DbType = DbType.String, Value = string.IsNullOrEmpty(input.processStatusList) ? (object)DBNull.Value : input.processStatusList, 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 ResultSearchListPayment();
                var result       = _Repository.ExecWithStoreProcedureCommand(Store_searchRepayment, prms);
                if (result.errorCode == 0)
                {
                    resultObject = JsonConvert.DeserializeObject <ResultSearchListPayment>(result.errorMessage);
                }
                return(resultObject);
            }
            catch (Exception ex)
            {
                HDBH.Log.WriteLog.Error("PaymentService => searchRepayment", ex);
                return(new ResultSearchListPayment());
            }
        }