v1.2.11.3
This commit is contained in:
@@ -36,7 +36,9 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// Organisation data files - only one allowed per request.
|
||||
public List<IFormFile> OrganisationDataFile { get; set; }
|
||||
// Data file properties.
|
||||
public String SheetNameOrNumber { get; set; }
|
||||
public String SheetNameOrNumber { get; set; } = "1";
|
||||
public String HeaderRow { get; set; } = "1";
|
||||
public String FirstDataRow { get; set; } = "2";
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validation.
|
||||
@@ -63,6 +65,24 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
responseData.SetControlError(controlName, Localiser["msg.error.sheet.name.invalid"]);
|
||||
}
|
||||
|
||||
// Header row position (from 1).
|
||||
{
|
||||
String controlName = nameof(HeaderRow);
|
||||
if (StringUtil.IsBlank(HeaderRow))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!StringUtil.IsNumeric(HeaderRow) || StringUtil.ToInt(HeaderRow) < 1)
|
||||
responseData.SetControlError(controlName, Localiser["msg.error.spreadsheet.row.invalid"]);
|
||||
}
|
||||
|
||||
// First data row position (from 1).
|
||||
{
|
||||
String controlName = nameof(FirstDataRow);
|
||||
if (StringUtil.IsBlank(FirstDataRow))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!StringUtil.IsNumeric(FirstDataRow) || StringUtil.ToInt(FirstDataRow) < 1)
|
||||
responseData.SetControlError(controlName, Localiser["msg.error.spreadsheet.row.invalid"]);
|
||||
}
|
||||
|
||||
return !responseData.HasControlErrors();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user