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