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")); } }
/// <summary> /// Màn hình Quản lý danh sách phiếu thu chờ duyệt /// dutp /// 21/7/20 /// </summary> /// <param name="input"></param> /// <returns></returns> public ResultSearchListPayment searchRepaymentInau(SearchPaymentModel 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 = "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 = "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 result = _Repository.ExecWithStoreProcedureCommand(Store_searchRepaymentInau, prms); var resultObject = JsonConvert.DeserializeObject <ResultSearchListPayment>(result.errorMessage); return(resultObject); } catch (Exception ex) { HDBH.Log.WriteLog.Error("PaymentService => searchRepaymentInau", ex); return(new ResultSearchListPayment()); } }
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, })); }