Update x export excel dettaglio BUNK
This commit is contained in:
Vendored
+1
-1
@@ -17,7 +17,7 @@ pipeline {
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=249']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=251']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.versionNumberBeta = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
|
||||
+5
-1
@@ -484,10 +484,14 @@ namespace NKC_SDK
|
||||
public string MaterialDescription { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Dati delal lavorazione
|
||||
/// Dati della lavorazione
|
||||
/// </summary>
|
||||
public class WorkData
|
||||
{
|
||||
/// <summary>
|
||||
/// Indica che la lavorazione è stata eseguita con successo (default = true)
|
||||
/// </summary>
|
||||
public bool Success { get; set; }
|
||||
/// <summary>
|
||||
/// Percorso del programma da eseguire
|
||||
/// </summary>
|
||||
|
||||
@@ -90,10 +90,14 @@ namespace NKC_WF.Controllers
|
||||
foreach (var item in currBunk.SheetList)
|
||||
{
|
||||
DataLayer.man.taSHL.updateDate(item.SheetId, item.Printing.DtStart, item.Printing.DtEnd, item.Machining.DtStart, item.Machining.DtEnd, item.Unloading.DtStart, item.Unloading.DtEnd);
|
||||
// SE machining completato --> status a LAVORATO!
|
||||
if (item.Machining.DtEnd != null)
|
||||
// verifico SE SIA AVVENUTO CON SUCCESSO lo step di lavorazione...
|
||||
if (item.Machining.Success)
|
||||
{
|
||||
DataLayer.man.taIL.updateSheetStatus(item.SheetId, 1, "PROD");
|
||||
// SE machining completato --> status a LAVORATO!
|
||||
if (item.Machining.DtEnd != null)
|
||||
{
|
||||
DataLayer.man.taIL.updateSheetStatus(item.SheetId, 1, "PROD");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,6 +255,7 @@
|
||||
</Content>
|
||||
<Content Include="Default.aspx" />
|
||||
<Content Include="ErrorPages\Oops.aspx" />
|
||||
<Content Include="export\BunkDetail.aspx" />
|
||||
<Content Include="Home.aspx" />
|
||||
<Content Include="Images\test.svg" />
|
||||
<Content Include="Images\test_1.svg" />
|
||||
@@ -524,6 +525,13 @@
|
||||
<Compile Include="ErrorPages\Oops.aspx.designer.cs">
|
||||
<DependentUpon>Oops.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="export\BunkDetail.aspx.cs">
|
||||
<DependentUpon>BunkDetail.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="export\BunkDetail.aspx.designer.cs">
|
||||
<DependentUpon>BunkDetail.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Home.aspx.cs">
|
||||
<DependentUpon>Home.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<add key="_SqlImportDir" value="c:\Share\NKC\"/>
|
||||
<!--Area file x scambio CAD / NESTING-->
|
||||
<add key="userVirtDir" value="false"/>
|
||||
<add key="fileBasePath" value="C:/Users/Dell/Dropbox/SVG/"/>
|
||||
<add key="drawBaseBath" value="C:/Users/Dell/Dropbox/SVG/SVG/"/>
|
||||
<add key="srvDrawBaseBath" value="\\W10-DataStore\Dropbox\SVG\SVG\"/>
|
||||
<add key="cadBaseBath" value="C:\Users\Dell\Dropbox\SVG\DXF\"/>
|
||||
|
||||
@@ -34,8 +34,12 @@
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<ItemStyle CssClass="text-right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="File">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink runat="server" ID="hlFileExp" Target="_blank" NavigateUrl='<%# $"~/export/BunkDetail?BunkId={Eval("StackID")}" %>' CssClass="btn btn-sm btn-success" ToolTip="Excel Export"><i class="fa fa-file-excel-o" aria-hidden="true"></i></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="hfBatchID" runat="server" />
|
||||
|
||||
@@ -208,6 +208,7 @@ namespace NKC_WF.WebUserControls
|
||||
DataLayer.man.taSHL.advanceInStack(stackIdCurr);
|
||||
}
|
||||
doUpdate();
|
||||
raiseEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BunkDetail.aspx.cs" Inherits="NKC_WF.export.BunkDetail" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<asp:HiddenField ID="hfStackID" runat="server" />
|
||||
<asp:GridView runat="server" ID="grView" AutoGenerateColumns="False" DataKeyNames="SheetID" DataSourceID="ods" AllowSorting="false">
|
||||
<EmptyDataTemplate>
|
||||
No Record
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:BoundField DataField="StackId" HeaderText="Bunk" ReadOnly="True" />
|
||||
<asp:BoundField DataField="SheetIndex" HeaderText="Num" ReadOnly="True" />
|
||||
<asp:BoundField DataField="MatExtCode" HeaderText="MatExtCode" ReadOnly="True" />
|
||||
<asp:BoundField DataField="MatDesc" HeaderText="MatDesc" ReadOnly="True" />
|
||||
<asp:TemplateField HeaderText="Estim (min:sec)" SortExpression="WrkTimeEst">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblWrkTimeEst" runat="server" Text='<%# formatMinSec(Eval("WrkTimeEst", "{0:N0}")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="CNC File" SortExpression="WrkTimeEst">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCncFilePath" runat="server" Text='<%# fixFilePath(Eval("CncFilePath")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Draw File" SortExpression="WrkTimeEst">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblDrawFilePath" runat="server" Text='<%# fixFilePath(Eval("DrawFilePath")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByStack" TypeName="AppData.DS_AppTableAdapters.SheetListTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfStackID" DefaultValue="0" Name="StackID" PropertyName="Value" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,85 @@
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace NKC_WF.export
|
||||
{
|
||||
public partial class BunkDetail : System.Web.UI.Page
|
||||
{
|
||||
|
||||
public override void VerifyRenderingInServerForm(Control control)
|
||||
{
|
||||
// Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time.
|
||||
}
|
||||
|
||||
protected string BunkID
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "0";
|
||||
answ = memLayer.ML.QSS("BunkID");
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private void doExport()
|
||||
{
|
||||
Response.Clear();
|
||||
string content = $"attachment; filename=Bunk_{BunkID}.xls";
|
||||
Response.AddHeader("content-disposition",content);
|
||||
Response.Charset = "";
|
||||
// If you want the option to open the Excel file without saving than
|
||||
// comment out the line below
|
||||
Response.Cache.SetCacheability(HttpCacheability.NoCache);
|
||||
Response.ContentType = "application/vnd.xls";
|
||||
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
|
||||
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
|
||||
grView.RenderControl(htmlWrite);
|
||||
Response.Write(stringWrite.ToString());
|
||||
Response.End();
|
||||
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
aggiornamento();
|
||||
doExport();
|
||||
}
|
||||
}
|
||||
public void aggiornamento()
|
||||
{
|
||||
hfStackID.Value = BunkID;
|
||||
grView.AllowPaging = false;
|
||||
ods.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// Formatta in min/sec il tempo in sec decimale
|
||||
/// </summary>
|
||||
/// <param name="_timeSec"></param>
|
||||
/// <returns></returns>
|
||||
public string formatMinSec(object _timeSec)
|
||||
{
|
||||
int totSec = 0;
|
||||
string answ = "";
|
||||
int.TryParse(_timeSec.ToString().Replace(".", ""), out totSec);
|
||||
int numMin = totSec / 60;
|
||||
int numSec = totSec - (60 * numMin);
|
||||
answ = $"00:{numMin:00}:{numSec:00}";
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Restitusice path bnonificato
|
||||
/// </summary>
|
||||
/// <param name="_rawPath"></param>
|
||||
/// <returns></returns>
|
||||
public string fixFilePath(object _rawPath)
|
||||
{
|
||||
string answ = _rawPath.ToString().ToLower();
|
||||
string fileBasePath = memLayer.ML.CRS("fileBasePath").ToLower();
|
||||
answ = answ.Replace(fileBasePath, "").Replace("svg", "SVG").Replace("cnc", "CNC");
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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.export
|
||||
{
|
||||
|
||||
|
||||
public partial class BunkDetail
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo form1.
|
||||
/// </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.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hfStackID.
|
||||
/// </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 hfStackID;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo grView.
|
||||
/// </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.GridView grView;
|
||||
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
@@ -9,18 +9,16 @@
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<asp:HiddenField ID="hfBatchID" runat="server" />
|
||||
<div class="row text-center small">
|
||||
<div class="col-1 pr-0 small">
|
||||
<div class="col-2 pr-0 small">
|
||||
<uc1:cmp_BP_bunkList runat="server" ID="cmp_BP_bunkList" />
|
||||
</div>
|
||||
<div class="col-9 px-0">
|
||||
<div class="col-8 px-0">
|
||||
<h3>Batch preview</h3>
|
||||
<uc1:cmp_slider runat="server" ID="cmp_slider" />
|
||||
<uc1:cmp_MU_svgViewer runat="server" ID="cmp_MU_svgViewer" />
|
||||
</div>
|
||||
<div class="col-2 pl-0 small">
|
||||
<asp:Panel runat="server" ID="pnlSheets" Height="80em" ScrollBars="Auto">
|
||||
<uc1:cmp_BP_sheetList runat="server" ID="cmp_BP_sheetList" />
|
||||
</asp:Panel>
|
||||
<uc1:cmp_BP_sheetList runat="server" ID="cmp_BP_sheetList" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
-9
@@ -50,15 +50,6 @@ namespace NKC_WF.site
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_MU_svgViewer cmp_MU_svgViewer;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo pnlSheets.
|
||||
/// </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.Panel pnlSheets;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo cmp_BP_sheetList.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user