- Modifica descrizione impianto quando creato da cliente.
- Filtro ricerca cliente in index chiamate + controller - modifica index rapp_new per mandare a capo descrizione se troppo lunga
This commit is contained in:
parent
7d74b1f1d0
commit
b4acde18d0
@ -182,7 +182,7 @@ namespace VirtualTask.Controllers
|
||||
var codcli = model.ancodice.Substring(model.ancodice.Length - 6, 6);
|
||||
anagCommImp.imp = impianto;
|
||||
anagCommImp.imp.imcodimp = "IMP_" + codcli;
|
||||
anagCommImp.imp.imdescri = "IMP_GEN_" + codcli;
|
||||
anagCommImp.imp.imdescri = "IMP_" + model.andescri.Trim() + "_" + codcli;
|
||||
anagCommImp.imp.imultcli = model.ancodice;
|
||||
anagCommImp.imp.imindiri2 = model.anindiri;
|
||||
|
||||
@ -192,7 +192,7 @@ namespace VirtualTask.Controllers
|
||||
anagCommImp.comm = commessa;
|
||||
anagCommImp.comm.laserial = GetNewSerialeComm();
|
||||
anagCommImp.comm.lacodcom = "COM_" + model.ancodice.Substring(model.ancodice.Length - 6, 6);
|
||||
anagCommImp.comm.ladeslav = "COMM_GEN_" + model.ancodice;
|
||||
anagCommImp.comm.ladeslav = "COMM_" + model.andescri + "_" + model.ancodice;
|
||||
anagCommImp.comm.lacodcli = model.ancodice;
|
||||
anagCommImp.comm.lacodimp = anagCommImp.imp.imcodimp;
|
||||
anagCommImp.comm.lacomgen = "S";
|
||||
|
||||
@ -35,7 +35,7 @@ namespace VirtualTask.Controllers
|
||||
|
||||
#region INDEX
|
||||
|
||||
public IActionResult Index(string impianto, string tecnico, DateTime dataIni, DateTime dataFin, string stato, string indirizzo, int? page = 1)
|
||||
public IActionResult Index(string impianto, string tecnico, string cliente, DateTime dataIni, DateTime dataFin, string stato, string indirizzo, int? page = 1)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
@ -63,6 +63,16 @@ namespace VirtualTask.Controllers
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Chiamate>>(data);
|
||||
|
||||
if (!string.IsNullOrEmpty(cliente))
|
||||
{
|
||||
modelList = modelList.Where(s => s.ancodice != null && s.ancodice.Contains(cliente)).ToList();
|
||||
|
||||
ViewData["CurrentFilter"] = cliente;
|
||||
|
||||
ViewBag.Clienti = cliente;
|
||||
}
|
||||
else
|
||||
ViewData["CurrentFilter"] = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(impianto))
|
||||
{
|
||||
@ -142,7 +152,7 @@ namespace VirtualTask.Controllers
|
||||
.OrderByDescending(s => s.chnumero)
|
||||
.ToPagedList(page ?? 1, pageSize);
|
||||
|
||||
|
||||
ViewBag.Clienti = getClienti(cliente);
|
||||
ViewBag.Impianti = getImpianti(impianto);
|
||||
ViewBag.Tecnici = getTecnici(tecnico);
|
||||
ViewBag.StatiChiamata = getStatiChiamata(stato);
|
||||
@ -496,6 +506,45 @@ namespace VirtualTask.Controllers
|
||||
return img;
|
||||
}
|
||||
|
||||
private List<SelectListItem> getClienti(string cliente)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
urlBase = apiUrl + "anagraficheList";
|
||||
urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
List<SelectListItem> selectItems = new List<SelectListItem>();
|
||||
List<Anag> modelList = new List<Anag>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Anag>>(data);
|
||||
modelList = modelList.Where(x => x.andtobso == null).ToList();
|
||||
//per gestire primo elemento tendina (deve essere vuoto)
|
||||
SelectListItem listItemFirst = new SelectListItem();
|
||||
|
||||
listItemFirst.Value = string.Empty;
|
||||
listItemFirst.Text = " - Cliente";
|
||||
selectItems.Add(listItemFirst);
|
||||
|
||||
foreach (var item in modelList)
|
||||
{
|
||||
SelectListItem listItem = new SelectListItem();
|
||||
|
||||
string s = item.ancodice + " - " + item.andescri;
|
||||
listItem.Value = item.ancodice;
|
||||
listItem.Text = s;
|
||||
selectItems.Add(listItem);
|
||||
}
|
||||
}
|
||||
|
||||
return selectItems;
|
||||
}
|
||||
|
||||
private List<SelectListItem> getImpianti(string impianto)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<i class="bx bxl-angular bx-sm text-black me-3">Cliente</i>
|
||||
<span class="fw-medium">@Html.DropDownList("tecnico", ViewBag.Tecnici, null, new { @class = "agy-form-field require" })</span>
|
||||
<span class="fw-medium">@Html.DropDownList("cliente", ViewBag.Clienti, null, new { @class = "agy-form-field require" })</span>
|
||||
</td>
|
||||
<td>
|
||||
<i class="bx bxl-angular bx-sm text-black me-3">Tecnico</i>
|
||||
|
||||
@ -206,9 +206,10 @@
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.codice_impianto)
|
||||
</td>
|
||||
<td>
|
||||
<td style="width: 30%; word-wrap: break-word; white-space: normal;" title="@item.descrizione_intervento">
|
||||
@Html.DisplayFor(modelItem => item.descrizione_intervento)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.codice_tecnico)
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user