37 lines
888 B
C#
37 lines
888 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
namespace LCU.Library.Internal.FileOperationsModels.Models.ExcelModels.Requests;
|
|
|
|
public class SheetRequest
|
|
{
|
|
[Required(AllowEmptyStrings = false, ErrorMessage = "Sheet Name is required")]
|
|
public string SheetName { get; set; }
|
|
public List<string> Columns { get; set; } = null;
|
|
public List<int> Rows { get; set; } = null;
|
|
|
|
public bool SkipRowForExtraction(int rowIndex)
|
|
{
|
|
if (this is not null && Rows is not null && Rows.Any())
|
|
{
|
|
if (!Rows.Contains(rowIndex))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public bool SkipColumnForExtraction(string columnName)
|
|
{
|
|
if (this is not null && Columns is not null && Columns.Any())
|
|
{
|
|
if (!Columns.Contains(columnName, StringComparer.OrdinalIgnoreCase))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
} |