chiamate filtro per stato
This commit is contained in:
parent
08e300b577
commit
0da7a2e98f
@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using VirtualTask.Models;
|
using VirtualTask.Models;
|
||||||
using X.PagedList;
|
using X.PagedList;
|
||||||
@ -132,10 +133,32 @@ namespace VirtualTask.Controllers
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(stato))
|
if (!string.IsNullOrEmpty(stato))
|
||||||
{
|
{
|
||||||
modelList = modelList.Where(x => x.chstato.Contains(stato)).ToList();
|
switch (stato)
|
||||||
|
{
|
||||||
|
case "Z":
|
||||||
|
// Chiusa: devo andare a vedere se ser_buono_chiu è valorizzato
|
||||||
|
modelList = modelList.Where(x => !string.IsNullOrEmpty(x.ser_buono_chiu)).ToList();
|
||||||
|
break;
|
||||||
|
case "R":
|
||||||
|
// rifiutata: devo anadre a vedere se rif è valorizzato e uguale a S
|
||||||
|
modelList = modelList.Where(x => !string.IsNullOrEmpty(x.rif) && x.rif.Equals("S")).ToList();
|
||||||
|
break;
|
||||||
|
case "B":
|
||||||
|
// da assegnare: devo anadre a vedere che il tecnico NON SIA valorizzato
|
||||||
|
modelList = modelList.Where(x => string.IsNullOrEmpty(x.chtchiam)).ToList();
|
||||||
|
break;
|
||||||
|
case "C":
|
||||||
|
// assegnato: devo anadre a vedere CHE il tecnico SIA valorizzato
|
||||||
|
modelList = modelList.Where(x => !string.IsNullOrEmpty(x.chtchiam)).ToList();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// S=sospese
|
||||||
|
// in questi casi vado ad cercare nel campo stato della chiamata
|
||||||
|
modelList = modelList.Where(x => !string.IsNullOrEmpty(x.chstato) && x.chstato.Contains(stato)).ToList();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
ViewData["CurrentFilterStato"] = stato;
|
ViewData["CurrentFilterStato"] = stato;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ViewData["CurrentFilterStato"] = null;
|
ViewData["CurrentFilterStato"] = null;
|
||||||
@ -633,6 +656,13 @@ namespace VirtualTask.Controllers
|
|||||||
listItem.Selected = true;
|
listItem.Selected = true;
|
||||||
selectItems.Add(listItem);
|
selectItems.Add(listItem);
|
||||||
|
|
||||||
|
listItem = new SelectListItem();
|
||||||
|
listItem.Value = "R";
|
||||||
|
listItem.Text = "Rifiutata";
|
||||||
|
if (!string.IsNullOrEmpty(stato) && stato.Equals("R"))
|
||||||
|
listItem.Selected = true;
|
||||||
|
selectItems.Add(listItem);
|
||||||
|
|
||||||
return selectItems;
|
return selectItems;
|
||||||
}
|
}
|
||||||
private List<SelectListItem> getTipiChiamata()
|
private List<SelectListItem> getTipiChiamata()
|
||||||
|
|||||||
@ -6,7 +6,47 @@
|
|||||||
int numChia = -1;
|
int numChia = -1;
|
||||||
numChia = Convert.ToInt32(Model.chnumero);
|
numChia = Convert.ToInt32(Model.chnumero);
|
||||||
}
|
}
|
||||||
|
<style>
|
||||||
|
.dotGray {
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
background-color: #bbb;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dotYellow {
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
background-color: yellow;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dotGreen {
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
background-color: green;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dotOrange {
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
background-color: orange;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dotBlack {
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
background-color: black;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -40,10 +80,65 @@
|
|||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<b>@Html.DisplayNameFor(model => model.chtchiam)</b> @Html.DisplayFor(model => model.chtchiam)
|
<b>@Html.DisplayNameFor(model => model.chtchiam)</b> @Html.DisplayFor(model => model.chtchiam)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<b>@Html.DisplayNameFor(model => model.chstato)</b> @Html.DisplayFor(model => model.chstato)
|
<b>@Html.DisplayNameFor(model => model.chstato)</b> @Html.DisplayFor(model => model.chstato)
|
||||||
</div>
|
</div>
|
||||||
|
@* <div class="col-md-10" style="background-color:aqua;">
|
||||||
|
<div style="float:left;"><b>@Html.DisplayNameFor(model => model.chstato)</b></div>
|
||||||
|
<div style="float:left;"> </div>
|
||||||
|
|
||||||
|
@{
|
||||||
|
//Unico caso in cui vado a vedere lo stato è il caso S=sospesa (grigio)
|
||||||
|
if (!string.IsNullOrEmpty(Model.chstato) && Model.chstato.Equals("S"))
|
||||||
|
{
|
||||||
|
<span class="dotGray"></span>
|
||||||
|
<span class="">@Html.DisplayFor(model => model.chstato) - SOSPESA</span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Caso rifiutato (nero): devo andare a valutare se il valore di rif è valorizzato e vale S
|
||||||
|
if (!string.IsNullOrEmpty(Model.rif) && Model.rif.Equals("S"))
|
||||||
|
{
|
||||||
|
//rifiutato
|
||||||
|
<span class="dotBlack"></span>
|
||||||
|
<span class="">@Html.DisplayFor(model => model.chstato) - RIFIUTATA</span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//caso chiuso: devo andare a valutare che ser_buono_chiu sia valorizzato
|
||||||
|
if (!string.IsNullOrEmpty(Model.ser_buono_chiu))
|
||||||
|
{
|
||||||
|
//seriale buono presente: chiusa-verde
|
||||||
|
<span class="dotGreen"></span> <span class="">@Html.DisplayFor(model => model.chstato) - CHIUSA</span>
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//assegnata(arancio)/non assegnata(giallo) : devo vedere se il tecnico è valorizzato o no
|
||||||
|
if (!string.IsNullOrEmpty(Model.chtchiam))
|
||||||
|
{
|
||||||
|
<div style="float:left;">
|
||||||
|
<span class="dotOrange"></span>
|
||||||
|
</div>
|
||||||
|
<div style="float:left;">
|
||||||
|
<span class="">@Html.DisplayFor(model => model.chstato) - ASSEGNATA</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<span class="dotYellow"></span>
|
||||||
|
<span class="">@Html.DisplayFor(model => model.chstato) - NON ASSEGNATA</span>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>*@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -173,39 +173,77 @@
|
|||||||
@* @Html.DisplayFor(modelItem => item.chstato) - @Html.DisplayFor(modelItem => item.descStato)*@
|
@* @Html.DisplayFor(modelItem => item.chstato) - @Html.DisplayFor(modelItem => item.descStato)*@
|
||||||
@{
|
@{
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(item.rif) && item.rif.Equals("S") )
|
//Unico caso in cui vado a vedere lo stato è il caso S=sospesa (grigio)
|
||||||
|
if (!string.IsNullOrEmpty(item.chstato) && item.chstato.Equals("S"))
|
||||||
{
|
{
|
||||||
//rifiutato
|
<span class="dotGray"></span>
|
||||||
<span class="dotBlack"></span>
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !string.IsNullOrEmpty(item.ser_buono_chiu))
|
//Caso rifiutato (nero): devo andare a valutare se il valore di rif è valorizzato e vale S
|
||||||
|
if (!string.IsNullOrEmpty(item.rif) && item.rif.Equals("S") )
|
||||||
{
|
{
|
||||||
//seriale buono presente: chiusa
|
//rifiutato
|
||||||
<span class="dotGreen"></span>
|
<span class="dotBlack"></span>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(item.chstato) && item.chstato.Equals("B"))
|
//caso chiuso: devo andare a valutare che ser_buono_chiu sia valorizzato
|
||||||
|
if ( !string.IsNullOrEmpty(item.ser_buono_chiu))
|
||||||
{
|
{
|
||||||
<span class="dotYellow"></span>
|
//seriale buono presente: chiusa-verde
|
||||||
|
<span class="dotGreen"></span>
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(item.chstato) && item.chstato.Equals("C"))
|
else
|
||||||
{
|
{
|
||||||
<span class="dotOrange"></span>
|
//assegnata(arancio)/non assegnata(giallo) : devo vedere se il tecnico è valorizzato o no
|
||||||
|
if (!string.IsNullOrEmpty(item.chtchiam))
|
||||||
}
|
{
|
||||||
|
<span class="dotOrange"></span>
|
||||||
if (!string.IsNullOrEmpty(item.chstato) && item.chstato.Equals("S"))
|
|
||||||
{
|
}
|
||||||
<span class="dotGray"></span>
|
else
|
||||||
|
{
|
||||||
|
<span class="dotYellow"></span>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//if (!string.IsNullOrEmpty(item.rif) && item.rif.Equals("S") )
|
||||||
|
//{
|
||||||
|
// //rifiutato
|
||||||
|
// <span class="dotBlack"></span>
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// if ( !string.IsNullOrEmpty(item.ser_buono_chiu))
|
||||||
|
// {
|
||||||
|
// //seriale buono presente: chiusa
|
||||||
|
// <span class="dotGreen"></span>
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if (!string.IsNullOrEmpty(item.chstato) && item.chstato.Equals("B"))
|
||||||
|
// {
|
||||||
|
// <span class="dotYellow"></span>
|
||||||
|
// }
|
||||||
|
// if (!string.IsNullOrEmpty(item.chstato) && item.chstato.Equals("C"))
|
||||||
|
// {
|
||||||
|
// <span class="dotOrange"></span>
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!string.IsNullOrEmpty(item.chstato) && item.chstato.Equals("S"))
|
||||||
|
// {
|
||||||
|
// <span class="dotGray"></span>
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
@* <td>@Html.DisplayFor(modelItem => item.rif)</td>
|
@* <td>@Html.DisplayFor(modelItem => item.rif)</td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user