added available flag to shift serch
This commit is contained in:
Родитель
8e80fdf7dc
Коммит
811d791e31
|
@ -61,7 +61,9 @@ namespace Project.Zap.Controllers
|
|||
SearchShiftViewModel viewModel = new SearchShiftViewModel
|
||||
{
|
||||
StoreNames = await this.GetStoreNames(),
|
||||
Result = shifts.Where(x => x.Start.DayOfYear == search.NewShift.Start.DayOfYear).Map()
|
||||
Result = shifts.Where(x => x.Start.DayOfYear == search.NewShift.Start.DayOfYear)
|
||||
.Map()
|
||||
.Where(x => search.Available ? x.Available > 0 : true)
|
||||
};
|
||||
|
||||
return View("Index", viewModel);
|
||||
|
|
|
@ -12,5 +12,9 @@ namespace Project.Zap.Models
|
|||
public ShiftViewModel NewShift { get; set; }
|
||||
|
||||
public IEnumerable<ShiftViewModel> Result { get; set; }
|
||||
|
||||
[Display(Name = "Available")]
|
||||
public bool Available { get; set; } = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,6 +117,9 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Available" xml:space="preserve">
|
||||
<value>Available</value>
|
||||
</data>
|
||||
<data name="StoreNames" xml:space="preserve">
|
||||
<value>Store Names</value>
|
||||
</data>
|
||||
|
|
|
@ -117,6 +117,9 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Available" xml:space="preserve">
|
||||
<value>Disponible</value>
|
||||
</data>
|
||||
<data name="StoreNames" xml:space="preserve">
|
||||
<value>Noms des magasins</value>
|
||||
</data>
|
||||
|
|
|
@ -19,7 +19,14 @@
|
|||
<div class="form-group">
|
||||
<label asp-for="@Model.NewShift.Start"></label>
|
||||
<input type="datetime-local" asp-for="@Model.NewShift.Start" />
|
||||
<span asp-validation-for="@Model.NewShift.Start"></span>
|
||||
</div>
|
||||
<span asp-validation-for="@Model.NewShift.Start"></span>
|
||||
|
||||
<div class="form-group">
|
||||
<label asp-for="@Model.Available"></label>
|
||||
<input type="checkbox" asp-for="@Model.Available" />
|
||||
<span asp-validation-for="@Model.Available"></span>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary mb-2">@Localizer["SearchButton"]</button>
|
||||
</form>
|
Загрузка…
Ссылка в новой задаче