UPdate x gestione SecScreen
This commit is contained in:
@@ -400,6 +400,7 @@
|
||||
<Content Include="WebUserControls\cmp_devUtils.ascx" />
|
||||
<Content Include="WebUserControls\cmp_ErrorsLog.ascx" />
|
||||
<Content Include="WebUserControls\cmp_fileUpload.ascx" />
|
||||
<Content Include="WebUserControls\cmp_ItemDet.ascx" />
|
||||
<Content Include="WebUserControls\cmp_kitImpCheck.ascx" />
|
||||
<Content Include="WebUserControls\cmp_kitList.ascx" />
|
||||
<Content Include="WebUserControls\cmp_kitReqRunning.ascx" />
|
||||
@@ -923,6 +924,13 @@
|
||||
<Compile Include="WebUserControls\cmp_homeButtons.ascx.designer.cs">
|
||||
<DependentUpon>cmp_homeButtons.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_ItemDet.ascx.cs">
|
||||
<DependentUpon>cmp_ItemDet.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_ItemDet.ascx.designer.cs">
|
||||
<DependentUpon>cmp_ItemDet.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_kitImpCheck.ascx.cs">
|
||||
<DependentUpon>cmp_kitImpCheck.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ItemDet.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_ItemDet" %>
|
||||
|
||||
|
||||
<asp:HiddenField ID="hfItemId" runat="server" Value="0" />
|
||||
<asp:FormView ID="frmView" runat="server" DataKeyNames="ItemID" DataSourceID="ods">
|
||||
<ItemTemplate>
|
||||
<div class="row">
|
||||
<div class="col-6 text-left">
|
||||
<asp:Label ID="ItemDtmxLabel" runat="server" Text='<%# Eval("ItemDtmx") %>' />
|
||||
</div>
|
||||
<div class="col-6 text-right font-weight-bold">
|
||||
<asp:Label ID="ItemExtCodeLabel" runat="server" Text='<%# Eval("ItemExtCode") %>' />
|
||||
</div>
|
||||
<div class="col-12 text-center small">
|
||||
<asp:Label ID="ItemDescLabel" runat="server" Text='<%# Eval("ItemDesc") %>' />
|
||||
</div>
|
||||
<div class="col-12 text-center small">
|
||||
<asp:Label ID="PdfFilePathLabel" runat="server" Text='<%# Eval("PdfFilePath") %>' />
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:FormView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByKey" TypeName="AppData.DS_AppTableAdapters.ItemListTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfItemId" DefaultValue="0" Name="ItemID" PropertyName="Value" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.WebUserControls
|
||||
{
|
||||
public partial class cmp_ItemDet : BaseUserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
public int ItemId
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(hfItemId.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfItemId.Value = value.ToString();
|
||||
frmView.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class cmp_ItemDet
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfItemId.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfItemId;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo frmView.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.FormView frmView;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_secScreen.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_secScreen" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_ItemDet.ascx" TagPrefix="uc1" TagName="cmp_ItemDet" %>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +8,10 @@
|
||||
<asp:HiddenField runat="server" ID="hfNum" />
|
||||
<asp:HiddenField ID="hfBatchId" runat="server" Value="0" />
|
||||
<asp:HiddenField ID="hfSheetId" runat="server" Value="0" />
|
||||
<asp:HiddenField ID="hfItemPdf" runat="server" Value="0" />
|
||||
<asp:HiddenField ID="hfItemDtmx" runat="server" Value="0" />
|
||||
<asp:HiddenField ID="hfItemCode" runat="server" Value="0" />
|
||||
<asp:Timer ID="timerRefresh" runat="server" Interval="1000" OnTick="timerRefresh_Tick" ></asp:Timer>
|
||||
<div class="card-header bg-primary text-light">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
@@ -13,9 +19,10 @@
|
||||
<asp:HyperLink runat="server" ID="hlShowCurrSheet" Target="_blank" CssClass="btn btn-warning btn-block"><i class="fa fa-object-group fa-2x" aria-hidden="true"></i><br /><%: traduci("ShowCurrSheet") %></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h3 class="text-uppercase"><%: traduci("SecScreen") %> -
|
||||
<asp:Label runat="server" ID="lblNum"><%: hfNum.Value %></asp:Label></h3>
|
||||
<h3 class="text-uppercase"><%: traduci("SecScreen") %>
|
||||
<asp:Label runat="server" ID="lblNum" CssClass="small">(<%: hfNum.Value %>)</asp:Label></h3>
|
||||
<asp:Label runat="server" ID="lblPdf"></asp:Label>
|
||||
<uc1:cmp_ItemDet runat="server" id="cmp_ItemDet" />
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<asp:HyperLink runat="server" ID="hlPdfOpener" Target="_blank" CssClass="btn btn-success btn-block"><i class="fa fa-file-pdf-o fa-2x" aria-hidden="true"></i>
|
||||
@@ -26,7 +33,7 @@
|
||||
<div class="card-body py-1">
|
||||
<div class="row">
|
||||
<div runat="server" id="divImg" class="col-12">
|
||||
<asp:Image runat="server" ID="imgQrMain" CssClass="img-fluid" />
|
||||
<asp:Image runat="server" ID="imgQrMain" CssClass="img-fluid" />
|
||||
</div>
|
||||
<%--<div class="col-12">
|
||||
<script src="//mozilla.github.io/pdf.js/build/pdf.js"></script>
|
||||
|
||||
@@ -14,6 +14,11 @@ namespace NKC_WF.WebUserControls
|
||||
{
|
||||
public partial class cmp_secScreen : BaseUserControl
|
||||
{
|
||||
|
||||
protected void timerRefresh_Tick(object sender, EventArgs e)
|
||||
{
|
||||
doUpdate();
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
@@ -21,8 +26,9 @@ namespace NKC_WF.WebUserControls
|
||||
// recupero numero
|
||||
currNum = ComLib.getSecScreenCode();
|
||||
doUpdate();
|
||||
pdfPath = "../temp/none.pdf";
|
||||
//pdfPath = "../temp/none.pdf";
|
||||
SheetId = 999999999;
|
||||
itemDtmx = "IT00014788";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +59,36 @@ namespace NKC_WF.WebUserControls
|
||||
hlShowCurrSheet.NavigateUrl = $"~/site/SvgFull?sheetId={value}";
|
||||
}
|
||||
}
|
||||
public string itemDtmx
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfItemDtmx.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfItemDtmx.Value = value;
|
||||
// cerco e salvo!
|
||||
var tabItem = DataLayer.man.taIL.getBySearch(0, value, 0, 9999);
|
||||
if (tabItem != null && tabItem.Count > 0)
|
||||
{
|
||||
int ItemId = tabItem[0].ItemID;
|
||||
itemCode = tabItem[0].ItemExtCode;
|
||||
pdfPath = tabItem[0].PdfFilePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
public string itemCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfItemCode.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfItemCode.Value = value;
|
||||
}
|
||||
}
|
||||
public string pdfPath
|
||||
{
|
||||
get
|
||||
@@ -61,11 +97,30 @@ namespace NKC_WF.WebUserControls
|
||||
}
|
||||
set
|
||||
{
|
||||
string nameOnly = $"~/temp/{itemCode}.pdf";
|
||||
// FIXME TODO necessario copiare in locale il pdf?
|
||||
lblPdf.Text = value.Trim();
|
||||
hlPdfOpener.NavigateUrl = value.Trim();
|
||||
lblPdf.Text = nameOnly;
|
||||
// svuoto files vecchi...
|
||||
removeOldTemp();
|
||||
// copio in locale file...
|
||||
File.Copy(value.Trim(), nameOnly);
|
||||
// update...
|
||||
hlPdfOpener.NavigateUrl = nameOnly;
|
||||
}
|
||||
}
|
||||
|
||||
private void removeOldTemp()
|
||||
{
|
||||
var fileList = fileMover.obj.elencoFilesDir(Server.MapPath("~/temp"));
|
||||
foreach (var item in fileList)
|
||||
{
|
||||
if (item.dataMod < DateTime.Now.AddHours(-1))
|
||||
{
|
||||
fileMover.deleteFile(Server.MapPath($"~/temp/{item.Nome}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected string codSSC
|
||||
{
|
||||
get
|
||||
@@ -92,14 +147,20 @@ namespace NKC_WF.WebUserControls
|
||||
{
|
||||
// valutato ma non usato pdf.js:
|
||||
// https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples
|
||||
string newPath = ComLib.getSecScreenRequest(codSSC);
|
||||
pdfPath = string.IsNullOrEmpty(newPath) ? "../temp/none.pdf" : newPath;
|
||||
string newDtmx = ComLib.getSecScreenRequest(codSSC);
|
||||
// se è variato da current...
|
||||
if (newDtmx != itemDtmx)
|
||||
{
|
||||
itemDtmx = newDtmx;
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshCodPost()
|
||||
{
|
||||
// genero nuovo QR
|
||||
string qrUrl = getImageUrl();
|
||||
imgQrMain.ImageUrl = qrUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,42 @@ namespace NKC_WF.WebUserControls
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfSheetId;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfItemPdf.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfItemPdf;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfItemDtmx.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfItemDtmx;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfItemCode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo timerRefresh.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.Timer timerRefresh;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hlShowCurrSheet.
|
||||
/// </summary>
|
||||
@@ -68,6 +104,15 @@ namespace NKC_WF.WebUserControls
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPdf;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo cmp_ItemDet.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_ItemDet cmp_ItemDet;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hlPdfOpener.
|
||||
/// </summary>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
|
||||
<asp:Timer ID="timerSecScreen" runat="server" Interval="120000" OnTick="timerSecScreen_Tick"></asp:Timer>
|
||||
<asp:Timer ID="timerSecScreen" runat="server" Interval="300000" OnTick="timerSecScreen_Tick"></asp:Timer>
|
||||
<asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<uc1:cmp_secScreen runat="server" ID="cmp_secScreen" />
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace NKC_WF
|
||||
|
||||
protected void timerSecScreen_Tick(object sender, EventArgs e)
|
||||
{
|
||||
cmp_secScreen.doUpdate();
|
||||
cmp_secScreen.refreshCodPost();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user