tenant in sessione e hidden su create impianti
This commit is contained in:
parent
859956602c
commit
6cedbc18a3
@ -14,6 +14,7 @@ namespace VirtualTask.Controllers
|
|||||||
string apiUrl = string.Empty;
|
string apiUrl = string.Empty;
|
||||||
string urlBase = string.Empty;
|
string urlBase = string.Empty;
|
||||||
string token = string.Empty;
|
string token = string.Empty;
|
||||||
|
string tenant = string.Empty;
|
||||||
|
|
||||||
HttpClient client;
|
HttpClient client;
|
||||||
public ImpiantiController()
|
public ImpiantiController()
|
||||||
@ -25,6 +26,7 @@ namespace VirtualTask.Controllers
|
|||||||
{
|
{
|
||||||
SessionHelper helper = new SessionHelper(this);
|
SessionHelper helper = new SessionHelper(this);
|
||||||
token = helper.GetStringValue("tok");
|
token = helper.GetStringValue("tok");
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(token))
|
if (string.IsNullOrEmpty(token))
|
||||||
return RedirectToAction("Index", "Login");
|
return RedirectToAction("Index", "Login");
|
||||||
|
|
||||||
@ -77,9 +79,10 @@ namespace VirtualTask.Controllers
|
|||||||
{
|
{
|
||||||
SessionHelper helper = new SessionHelper(this);
|
SessionHelper helper = new SessionHelper(this);
|
||||||
token = helper.GetStringValue("tok");
|
token = helper.GetStringValue("tok");
|
||||||
|
tenant = helper.GetStringValue("tenant");
|
||||||
if (string.IsNullOrEmpty(token))
|
if (string.IsNullOrEmpty(token))
|
||||||
return RedirectToAction("Index", "Login");
|
return RedirectToAction("Index", "Login");
|
||||||
|
model.imcodazi = tenant;
|
||||||
apiUrl = helper.GetStringValue("apiUrl");
|
apiUrl = helper.GetStringValue("apiUrl");
|
||||||
urlBase = apiUrl + "impianti/add";
|
urlBase = apiUrl + "impianti/add";
|
||||||
urlBase = urlBase + "?token=" + token;
|
urlBase = urlBase + "?token=" + token;
|
||||||
|
|||||||
@ -49,6 +49,7 @@ namespace VirtualTask.Controllers
|
|||||||
//ViewBag.Token = loginOut.Tok;
|
//ViewBag.Token = loginOut.Tok;
|
||||||
helper.SetStringValue("tok", loginOut.Tok);
|
helper.SetStringValue("tok", loginOut.Tok);
|
||||||
helper.SetStringValue("apiUrl", apiUrl);
|
helper.SetStringValue("apiUrl", apiUrl);
|
||||||
|
helper.SetStringValue("tenant", model.Tenant);
|
||||||
return RedirectToAction("Index","Home");
|
return RedirectToAction("Index","Home");
|
||||||
}
|
}
|
||||||
return View();
|
return View();
|
||||||
|
|||||||
@ -18,30 +18,39 @@ namespace VirtualTask.Models
|
|||||||
public string? imdescri { get; set; }
|
public string? imdescri { get; set; }
|
||||||
|
|
||||||
/// <summary>Tipo indirizzo (Via, piazza..)</summary>
|
/// <summary>Tipo indirizzo (Via, piazza..)</summary>
|
||||||
|
[Display(Name = "Via,piazza,..")]
|
||||||
public string? imindiri1 { get; set; }
|
public string? imindiri1 { get; set; }
|
||||||
|
|
||||||
/// <summary> indirizzo </summary>
|
/// <summary> indirizzo </summary>
|
||||||
|
[Display(Name = "Indirizzo")]
|
||||||
public string? imindiri2 { get; set; }
|
public string? imindiri2 { get; set; }
|
||||||
|
|
||||||
/// <summary> numero civico </summary>
|
/// <summary> numero civico </summary>
|
||||||
|
[Display(Name = "Num civico")]
|
||||||
public int? imindiri3 { get; set; }
|
public int? imindiri3 { get; set; }
|
||||||
|
|
||||||
/// <summary> sottonumero </summary>
|
/// <summary> sottonumero </summary>
|
||||||
|
[Display(Name = "Interno")]
|
||||||
public string? imindiri4 { get; set; }
|
public string? imindiri4 { get; set; }
|
||||||
|
|
||||||
/// <summary>scala</summary>
|
/// <summary>scala</summary>
|
||||||
|
[Display(Name = "Scala")]
|
||||||
public string? imindiri5 { get; set; }
|
public string? imindiri5 { get; set; }
|
||||||
|
|
||||||
/// <summary> localita </summary>
|
/// <summary> localita </summary>
|
||||||
|
[Display(Name = "Località")]
|
||||||
public string? imlocali { get; set; }
|
public string? imlocali { get; set; }
|
||||||
|
|
||||||
/// <summary> Cap </summary>
|
/// <summary> Cap </summary>
|
||||||
|
[Display(Name = "Cap")]
|
||||||
public string? imcodcap { get; set; }
|
public string? imcodcap { get; set; }
|
||||||
|
|
||||||
/// <summary> Comune </summary>
|
/// <summary> Comune </summary>
|
||||||
|
[Display(Name = "Comune")]
|
||||||
public string? imcomune { get; set; }
|
public string? imcomune { get; set; }
|
||||||
|
|
||||||
/// <summary> Provincia </summary>
|
/// <summary> Provincia </summary>
|
||||||
|
[Display(Name = "Provincia")]
|
||||||
public string? improvin { get; set; }
|
public string? improvin { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Cliente")]
|
[Display(Name = "Cliente")]
|
||||||
|
|||||||
@ -17,11 +17,12 @@
|
|||||||
<input asp-for="imcodimp" class="form-control" />
|
<input asp-for="imcodimp" class="form-control" />
|
||||||
<span asp-validation-for="imcodimp" class="text-danger"></span>
|
<span asp-validation-for="imcodimp" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
@* <div class="form-group">
|
||||||
<label asp-for="imcodazi" class="control-label"></label>
|
<label asp-for="imcodazi" class="control-label"></label>
|
||||||
<input asp-for="imcodazi" class="form-control" />
|
<input asp-for="imcodazi" class="form-control" />
|
||||||
<span asp-validation-for="imcodazi" class="text-danger"></span>
|
<span asp-validation-for="imcodazi" class="text-danger"></span>
|
||||||
</div>
|
</div>*@
|
||||||
|
@Html.HiddenFor(m => m.imcodazi)
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="imdescri" class="control-label"></label>
|
<label asp-for="imdescri" class="control-label"></label>
|
||||||
<input asp-for="imdescri" class="form-control" />
|
<input asp-for="imdescri" class="form-control" />
|
||||||
@ -74,19 +75,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="imultcli" class="control-label"></label>
|
<label asp-for="imultcli" class="control-label"></label>
|
||||||
@Html.DropDownListFor(x =>x.imultcli,
|
@Html.DropDownListFor(x =>x.imultcli,(IEnumerable<SelectListItem>)ViewBag.AllStockList,new {@class = "form-control"})
|
||||||
(IEnumerable<SelectListItem>)ViewBag.AllStockList)
|
|
||||||
|
|
||||||
|
|
||||||
<span asp-validation-for="imultcli" class="text-danger"></span>
|
<span asp-validation-for="imultcli" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
@Html.LabelFor(model => model.imultcli, htmlAttributes: new { @class = "control-label col-md-2" })
|
|
||||||
<div class="row-fluid col-md-10">
|
|
||||||
@Html.DropDownListFor(c => c.imultcli, (IEnumerable<SelectListItem>)ViewBag.AllStockList, null, new { @class = "selectpicker", data_live_search = "true" })
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="submit" value="Create" class="btn btn-primary" />
|
<input type="submit" value="Create" class="btn btn-primary" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user