apertura immagine buono da chiamate
This commit is contained in:
parent
539f1918a3
commit
72e4a6b4ca
@ -360,6 +360,49 @@ namespace VirtualTask.Controllers
|
||||
|
||||
#endregion DELETE
|
||||
|
||||
#region IMMAGINE
|
||||
|
||||
public IActionResult Immagine(string id)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
id = "V000000135";
|
||||
|
||||
token = helper.GetStringValue("tok");
|
||||
|
||||
apiUrl = helper.GetStringValue("apiUrl");
|
||||
admin = helper.GetStringValue("admin");
|
||||
ViewBag.Admin = admin;
|
||||
urlBase = apiUrl + "rappnewList";
|
||||
urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
Rapp_New rapp = new Rapp_New();
|
||||
|
||||
List<Rapp_New> modelList = new List<Rapp_New>();
|
||||
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Rapp_New>>(data);
|
||||
rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First();
|
||||
}
|
||||
else
|
||||
{
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
return View(rapp);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//metodo per riempire combobox con la tabella tecnici
|
||||
private List<SelectListItem> GetTecnici()
|
||||
{
|
||||
|
||||
@ -228,7 +228,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
function openNewWindow() {
|
||||
window.open("/Rapp_New/Details", "New Window", "top=250,left=2000,height=800,width=800");
|
||||
window.open("/Rapp_New/Immagine", "New Window", "top=0,left=0,height=1020,width=1020");
|
||||
}
|
||||
</script>
|
||||
}
|
||||
|
||||
31
Views/Rapp_New/Immagine.cshtml
Normal file
31
Views/Rapp_New/Immagine.cshtml
Normal file
@ -0,0 +1,31 @@
|
||||
@model VirtualTask.Models.Rapp_New
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Dettaglio";
|
||||
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
||||
}
|
||||
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="row" style="float:left;width:80%;">
|
||||
@{
|
||||
var imgSrc = "";
|
||||
|
||||
if (Model.img2 != null)
|
||||
{
|
||||
//byte[] appo = Model.img2;
|
||||
var base64 = Convert.ToBase64String(Model.img2);
|
||||
imgSrc = String.Format("data:image/gif;base64,{0}", base64);
|
||||
<img src="@imgSrc" style="align-content:center" height="800" width="800" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<img src="~/assets/images/No_image.png" height="512" width="512" />
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -9,7 +9,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ClosedXML" Version="0.102.1" />
|
||||
<PackageReference Include="Microsoft.Office.Interop.Excel" Version="15.0.4795.1001" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.17" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.18" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||
<PackageReference Include="X.PagedList.Mvc.Core" Version="8.4.7" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user