inizio add ST preview (TAB)

This commit is contained in:
Samuele E. Locatelli
2021-01-04 16:51:48 +01:00
parent ec31963f00
commit 10bb217b67
14 changed files with 720 additions and 7 deletions
+8 -5
View File
@@ -1,7 +1,10 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ImageArchive.ascx.cs" Inherits="MP_ADM.WebUserControls.cmp_ImageArchive" %>
<div class="row">
<div class="col-12 col-md-8 col-lg-10">
<div class="col-3 col-md-1">
<%--<asp:HyperLink runat="server" Target="_blank" NavigateUrl="~/UploadFile"CssClass="btn btn-block btn-success form-control2">Carica <i class="fa fa-upload" aria-hidden="true"></i></asp:HyperLink>--%>
</div>
<div class="col-9 col-md-8">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Ricerca [ALT-T]</span>
@@ -12,7 +15,7 @@
</div>
</div>
</div>
<div class="col-6 col-md-2 col-lg-1">
<div class="col-6 col-md-1">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">col</span>
@@ -21,14 +24,14 @@
<asp:ListItem Text="12" Value="col-1"></asp:ListItem>
<asp:ListItem Text="6" Value="col-2" Selected="true"></asp:ListItem>
<asp:ListItem Text="4" Value="col-3"></asp:ListItem>
<asp:ListItem Text="2" Value="col-6"></asp:ListItem>
<asp:ListItem Text="3" Value="col-4"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="col-6 col-md-2 col-lg-1">
<div class="col-6 col-md-2">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">max</span>
<span class="input-group-text">show max</span>
</div>
<asp:DropDownList runat="server" ID="ddlMaxNum" AutoPostBack="true" CssClass="form-control" OnSelectedIndexChanged="ddlSize_SelectedIndexChanged">
<asp:ListItem Text="10" Value="10"></asp:ListItem>
@@ -72,7 +72,7 @@ namespace MP_ADM.WebUserControls
List<FileData> answ = new List<FileData>();
try
{
searchVal = string.IsNullOrEmpty(searchVal) ? "*" : searchVal;
searchVal = string.IsNullOrEmpty(searchVal) ? "*" : $"*{searchVal}*";
var tabFiles = Directory.GetFiles(dirPath, searchVal);
foreach (var item in tabFiles)
{
+26
View File
@@ -0,0 +1,26 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ST_detail.ascx.cs" Inherits="MP_ADM.WebUserControls.cmp_ST_detail" %>
<%@ Register Src="~/WebUserControls/cmp_ST_objView.ascx" TagPrefix="uc1" TagName="cmp_ST_objView" %>
<asp:Label runat="server" ID="lblWarning" Visible="false" CssClass="text-danger text-center" Font-Size="2em" />
<asp:Repeater ID="repDetail" runat="server" DataSourceID="ods">
<ItemTemplate>
<div class="border border-bottom-secondary">
<uc1:cmp_ST_objView runat="server" ID="cmp_ST_objView" dataType='<%# Eval("CodTipo") %>' dataLabel='<%# traduci(Eval("Label")) %>' dataValue='<%# Eval("Value") %>' extCode='<%# Eval("ExtCode") %>' required='<%# Eval("Required") %>' />
</div>
</ItemTemplate>
<AlternatingItemTemplate>
<div class="">
<uc1:cmp_ST_objView runat="server" ID="cmp_ST_objView" dataType='<%# Eval("CodTipo") %>' dataLabel='<%# traduci(Eval("Label")) %>' dataValue='<%# Eval("Value") %>' extCode='<%# Eval("ExtCode") %>' required='<%# Eval("Required") %>' />
</div>
</AlternatingItemTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByGrpOdl" TypeName="MapoDb.DS_SheetTechTableAdapters.ST_ActualRowTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hfCodGruppo" DefaultValue="ART" Name="CodGruppo" PropertyName="Value" Type="String" />
<asp:SessionParameter DefaultValue="0" Name="IdxODL" SessionField="idxODL" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfCodGruppo" Value="" />
<asp:HiddenField runat="server" ID="hfCodArticolo" Value="" />
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class cmp_ST_detail : BaseUserControl
{
#region Public Properties
public string CodArticolo
{
get
{
return hfCodArticolo.Value.Trim();
}
set
{
hfCodArticolo.Value = value.Trim();
}
}
public string CodGruppo
{
get
{
return hfCodGruppo.Value.Trim();
}
set
{
hfCodGruppo.Value = value.Trim();
}
}
#endregion Public Properties
#region Private Methods
/// <summary>
/// check ODL presente
/// </summary>
private void fixWarning()
{
if (idxMacchina == "")
{
lblWarning.Text = traduci("MancaMacchina");
lblWarning.Visible = true;
}
else if (idxOdl == 0)
{
lblWarning.Text = traduci("MancaOdl");
lblWarning.Visible = true;
}
else
{
lblWarning.Text = "";
lblWarning.Visible = false;
}
}
#endregion Private Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
fixWarning();
}
#endregion Protected Methods
}
}
+62
View File
@@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <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 MP_ADM.WebUserControls
{
public partial class cmp_ST_detail
{
/// <summary>
/// Controllo lblWarning.
/// </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.Label lblWarning;
/// <summary>
/// Controllo repDetail.
/// </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.Repeater repDetail;
/// <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;
/// <summary>
/// Controllo hfCodGruppo.
/// </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 hfCodGruppo;
/// <summary>
/// Controllo hfCodArticolo.
/// </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 hfCodArticolo;
}
}
@@ -0,0 +1,24 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ST_objView.ascx.cs" Inherits="MP_ADM.WebUserControls.cmp_ST_objView" %>
<asp:HiddenField runat="server" ID="hfType" />
<asp:HiddenField runat="server" ID="hfLabel" />
<asp:HiddenField runat="server" ID="hfValue" />
<asp:HiddenField runat="server" ID="hfRequired" />
<asp:HiddenField runat="server" ID="hfExtCode" />
<div runat="server" id="divTxt" class="row">
<div class="col-4 pr-0 text-left">
<%: hfLabel.Value %>
</div>
<div class='<%: "col-8 pl-0 text-right font-weight-bold" + dataCss %>'>
<%: hfValue.Value %>
<asp:Label runat="server" ID="lblError"><i class="fa fa-exclamation-triangle" aria-hidden="true" ></i></asp:Label>
<asp:Label runat="server" ID="lblChecked"><i class="fa fa-check-square-o" aria-hidden="true" ></i></asp:Label>
</div>
</div>
<div runat="server" id="divImg" class="row">
<div class="col-4 pr-0 text-left">
<%: hfLabel.Value %>
</div>
<div class="col-8 pl-0 text-right">
<asp:Image runat="server" ID="imgData" CssClass="img-fluid" ImageUrl='<%# imageUrl %>' Height="128px" />
</div>
</div>
@@ -0,0 +1,188 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class cmp_ST_objView : BaseUserControl
{
#region Public Properties
public string dataCss
{
get
{
string answ = "";
if (required)
{
if (dataValue != extCode)
{
answ = " text-danger";
}
else
{
answ = " text-success";
}
}
return answ;
}
}
public string dataLabel
{
get
{
return hfLabel.Value.Trim();
}
set
{
hfLabel.Value = value.Trim();
}
}
public string dataType
{
get
{
return hfType.Value.Trim();
}
set
{
hfType.Value = value.Trim();
fixDisplay();
}
}
public string dataValue
{
get
{
return hfValue.Value.Trim();
}
set
{
hfValue.Value = value.Trim();
}
}
public string extCode
{
get
{
return hfExtCode.Value.Trim();
}
set
{
hfExtCode.Value = value.Trim();
fixDisplay();
}
}
/// <summary>
/// Url immagine SE richiesta
/// </summary>
public string imageUrl
{
get
{
string imgPath = "";
string fullPath = "";
//check type...
if (dataType == "IMG")
{
imgPath = dataValue;
if (!Path.IsPathRooted(imgPath))
{
// aggiungo base path
imgPath = $"~\\images\\ST_img\\{imgPath}";
}
fullPath = Server.MapPath(imgPath);
// verifico esistenza file...
if (!File.Exists(fullPath))
{
// metto segnaposto empty
imgPath = "~\\images\\ST_img\\Steamware.png";
}
}
return imgPath;
}
}
public bool required
{
get
{
bool answ = false;
bool.TryParse(hfRequired.Value.Trim(), out answ);
return answ;
}
set
{
hfRequired.Value = value.ToString();
fixDisplay();
}
}
public bool showCheckedData
{
get
{
bool answ = false;
if (required && (dataValue == extCode))
{
answ = true;
}
return answ;
}
}
public bool showMissingData
{
get
{
bool answ = false;
if (required && (dataValue != extCode))
{
answ = true;
}
return answ;
}
}
#endregion Public Properties
#region Private Methods
private void fixDisplay()
{
divImg.Visible = false;
divTxt.Visible = false;
switch (dataType)
{
case "IMG":
divImg.Visible = true;
break;
case "TXT":
default:
divTxt.Visible = true;
break;
}
lblError.Visible = showMissingData;
lblChecked.Visible = showCheckedData;
}
#endregion Private Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
}
#endregion Protected Methods
}
}
+107
View File
@@ -0,0 +1,107 @@
//------------------------------------------------------------------------------
// <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 MP_ADM.WebUserControls
{
public partial class cmp_ST_objView
{
/// <summary>
/// Controllo hfType.
/// </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 hfType;
/// <summary>
/// Controllo hfLabel.
/// </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 hfLabel;
/// <summary>
/// Controllo hfValue.
/// </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 hfValue;
/// <summary>
/// Controllo hfRequired.
/// </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 hfRequired;
/// <summary>
/// Controllo hfExtCode.
/// </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 hfExtCode;
/// <summary>
/// Controllo divTxt.
/// </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.HtmlGenericControl divTxt;
/// <summary>
/// Controllo lblError.
/// </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.Label lblError;
/// <summary>
/// Controllo lblChecked.
/// </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.Label lblChecked;
/// <summary>
/// Controllo divImg.
/// </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.HtmlGenericControl divImg;
/// <summary>
/// Controllo imgData.
/// </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.Image imgData;
}
}
@@ -0,0 +1,36 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ST_preview.ascx.cs" Inherits="MP_ADM.WebUserControls.cmp_ST_preview" %>
<%@ Register Src="~/WebUserControls/cmp_ST_detail.ascx" TagPrefix="uc1" TagName="cmp_ST_detail" %>
<div class="card text-dark textCondens">
<div class="card-header bg-info text-light">
<div class="row">
<div class="col-9 col-md-10">
<h4>Scheda Tecnica</h4>
</div>
<div class="col-3 col-md-2">
<asp:LinkButton ID="lbtClearOdl" runat="server" CssClass="btn text-truncate btn-danger btn-lg btn-block text-uppercase" OnClick="lbtClearOdl_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaReset") %>'><i class="fa fa-trash"></i> reset</asp:LinkButton>
</div>
</div>
</div>
<div class="card-body py-1">
<div class="row">
<asp:Repeater ID="repGroup" runat="server" DataSourceID="odsGroup">
<ItemTemplate>
<div class="col-lg-6 col-12 p-1">
<div class="card">
<div class="card-header">
<b>
<asp:Label ID="DescGruppoLabel" runat="server" Text='<%# Eval("DescGruppo") %>' /></b>
</div>
<div class="card-body small p-0">
<uc1:cmp_ST_detail runat="server" ID="cmp_ST_detail" CodGruppo='<%# Eval("CodGruppo") %>' CodArticolo='<%# hfCodArticolo.Value %>' />
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
</div>
<asp:ObjectDataSource ID="odsGroup" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_SheetTechTableAdapters.ST_AnagGruppiTableAdapter"></asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfCodArticolo" Value="" />
</div>
</div>
@@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class cmp_ST_preview : BaseUserControl
{
#region Public Properties
public string CodArticolo
{
get
{
return hfCodArticolo.Value.Trim();
}
set
{
string newVal = value.Trim();
hfCodArticolo.Value = newVal;
cmp_ST_objCheck.CodArticolo = newVal;
// se ho articolo FIX DISPLAY!
if (!string.IsNullOrEmpty(newVal))
{
repGroup.DataBind();
}
}
}
#endregion Public Properties
#region Private Methods
/// <summary>
/// Verifica visibilità reset
/// </summary>
private void checkReset()
{
// condizioni booleane
bool inAttr = false;
// SOLO SE ho articolo sennò niente reset...
if (!string.IsNullOrEmpty(CodArticolo))
{
// controllo se la macchina è in attrezzaggio...
DS_applicazione.StatoMacchineRow rigaStato = null;
try
{
// se è multi controllo parent...
if (isMulti)
{
rigaStato = selData.mng.rigaStato(idxMaccParent);
}
else
{
rigaStato = selData.mng.rigaStato(idxMacchinaFix);
}
if (rigaStato != null)
{
inAttr = (rigaStato.IdxStato == 2);
}
}
catch
{ }
}
lbtClearOdl.Visible = inAttr;
}
private void cmp_ST_objCheck_eh_doUpdate(object sender, EventArgs e)
{
repGroup.DataBind();
checkReset();
}
#endregion Private Methods
#region Protected Methods
protected void lbtClearOdl_Click(object sender, EventArgs e)
{
// chiamo stored x ripulire dati check già caricati
DataLayerObj.taSTChk.cleanByOdl(idxOdl);
// sollevo evento
repGroup.DataBind();
reportUpdate();
checkReset();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lbtClearOdl.DataBind();
}
cmp_ST_objCheck.eh_doUpdate += cmp_ST_objCheck_eh_doUpdate;
checkReset();
}
#endregion Protected Methods
}
}
+53
View File
@@ -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 MP_ADM.WebUserControls
{
public partial class cmp_ST_preview
{
/// <summary>
/// Controllo lbtClearOdl.
/// </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.LinkButton lbtClearOdl;
/// <summary>
/// Controllo repGroup.
/// </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.Repeater repGroup;
/// <summary>
/// Controllo odsGroup.
/// </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 odsGroup;
/// <summary>
/// Controllo hfCodArticolo.
/// </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 hfCodArticolo;
}
}
@@ -42,12 +42,12 @@
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DescGruppo" HeaderText="Gruppo" SortExpression="DescGruppo" ReadOnly="True" />
<asp:BoundField DataField="Oggetto" HeaderText="Oggetto" ReadOnly="True" SortExpression="Oggetto" />
<%--<asp:BoundField DataField="Label" HeaderText="Label" ReadOnly="True" SortExpression="Label" />--%>
<asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" ReadOnly="True" />
<%--<asp:BoundField DataField="CodTipo" HeaderText="CodTipo" SortExpression="CodTipo" />--%>
<asp:BoundField DataField="DescTipo" HeaderText="Tipo" SortExpression="DescTipo" ReadOnly="True" />
<asp:BoundField DataField="Num" HeaderText="Num" SortExpression="Num" ReadOnly="True" />
<asp:BoundField DataField="Oggetto" HeaderText="Oggetto" ReadOnly="True" SortExpression="Oggetto" />
<asp:BoundField DataField="Value" HeaderText="Valore" SortExpression="Value" ControlStyle-CssClass="form-control" />
<asp:BoundField DataField="CheckType" HeaderText="Check" SortExpression="CheckType" ReadOnly="True" />
<asp:CheckBoxField DataField="Required" HeaderText="Req" SortExpression="Required" ReadOnly="True" />