Continuo aggiunta pagine a progetto... mancano conf web.config...

This commit is contained in:
Samuele E. Locatelli
2019-12-31 10:11:30 +01:00
parent cb54425e58
commit 08de3c40ce
34 changed files with 4463 additions and 0 deletions
+88
View File
@@ -222,6 +222,10 @@
<Content Include="Global.asax" />
<Content Include="App_Readme\SteamWare_demo\example-NLog.config" />
<Content Include="App_Readme\SteamWare_demo\example-app.config" />
<Content Include="HwSwInfo.aspx" />
<Content Include="login.aspx" />
<Content Include="menu.aspx" />
<Content Include="Planner.aspx" />
<Content Include="Scripts\bootstrap.bundle.js" />
<Content Include="Scripts\bootstrap.bundle.min.js" />
<Content Include="Scripts\bootstrap.js" />
@@ -245,13 +249,20 @@
<Content Include="Content\bootstrap-reboot.css.map" />
<Content Include="Content\bootstrap-grid.min.css.map" />
<Content Include="Content\bootstrap-grid.css.map" />
<Content Include="test.aspx" />
<Content Include="WebUserControls\mod_footer.ascx" />
<Content Include="WebUserControls\mod_gestPromODL_OUT.ascx" />
<Content Include="WebUserControls\mod_login.ascx" />
<Content Include="WebUserControls\mod_main_help.ascx" />
<Content Include="WebUserControls\mod_menuTop.ascx" />
<Content Include="WebUserControls\mod_menuTopCompact.ascx" />
<Content Include="WebUserControls\cmp_HwSwInfo.ascx" />
<Content Include="WebUserControls\cmp_numRow.ascx" />
<Content Include="WebUserControls\mod_menuBottom.ascx" />
<Content Include="WebUserControls\mod_newPromessaODL.ascx" />
<Content Include="WebUserControls\mod_pageTitleAndSearch.ascx" />
<Content Include="WebUserControls\mod_planCreate.ascx" />
<Content Include="WebUserControls\mod_planStats.ascx" />
<Content Include="WebUserControls\mod_ricercaGenerica.ascx" />
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
<Content Include="mongocrypt.dll" />
@@ -401,6 +412,34 @@
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="HwSwInfo.aspx.cs">
<DependentUpon>HwSwInfo.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HwSwInfo.aspx.designer.cs">
<DependentUpon>HwSwInfo.aspx</DependentUpon>
</Compile>
<Compile Include="login.aspx.cs">
<DependentUpon>login.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="login.aspx.designer.cs">
<DependentUpon>login.aspx</DependentUpon>
</Compile>
<Compile Include="menu.aspx.cs">
<DependentUpon>menu.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="menu.aspx.designer.cs">
<DependentUpon>menu.aspx</DependentUpon>
</Compile>
<Compile Include="Planner.aspx.cs">
<DependentUpon>Planner.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Planner.aspx.designer.cs">
<DependentUpon>Planner.aspx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Site.Master.cs">
<DependentUpon>Site.Master</DependentUpon>
@@ -416,6 +455,13 @@
<Compile Include="Site.Mobile.Master.designer.cs">
<DependentUpon>Site.Mobile.Master</DependentUpon>
</Compile>
<Compile Include="test.aspx.cs">
<DependentUpon>test.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="test.aspx.designer.cs">
<DependentUpon>test.aspx</DependentUpon>
</Compile>
<Compile Include="ViewSwitcher.ascx.cs">
<DependentUpon>ViewSwitcher.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -437,6 +483,27 @@
<Compile Include="WebUserControls\mod_footer.ascx.designer.cs">
<DependentUpon>mod_footer.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_gestPromODL_OUT.ascx.cs">
<DependentUpon>mod_gestPromODL_OUT.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_gestPromODL_OUT.ascx.designer.cs">
<DependentUpon>mod_gestPromODL_OUT.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_login.ascx.cs">
<DependentUpon>mod_login.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_login.ascx.designer.cs">
<DependentUpon>mod_login.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_main_help.ascx.cs">
<DependentUpon>mod_main_help.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_main_help.ascx.designer.cs">
<DependentUpon>mod_main_help.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_menuTop.ascx.cs">
<DependentUpon>mod_menuTop.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -479,6 +546,13 @@
<Compile Include="WebUserControls\mod_menuBottom.ascx.designer.cs">
<DependentUpon>mod_menuBottom.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_newPromessaODL.ascx.cs">
<DependentUpon>mod_newPromessaODL.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_newPromessaODL.ascx.designer.cs">
<DependentUpon>mod_newPromessaODL.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_pageTitleAndSearch.ascx.cs">
<DependentUpon>mod_pageTitleAndSearch.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -486,6 +560,20 @@
<Compile Include="WebUserControls\mod_pageTitleAndSearch.ascx.designer.cs">
<DependentUpon>mod_pageTitleAndSearch.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_planCreate.ascx.cs">
<DependentUpon>mod_planCreate.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_planCreate.ascx.designer.cs">
<DependentUpon>mod_planCreate.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_planStats.ascx.cs">
<DependentUpon>mod_planStats.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_planStats.ascx.designer.cs">
<DependentUpon>mod_planStats.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_ricercaGenerica.ascx.cs">
<DependentUpon>mod_ricercaGenerica.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
+7
View File
@@ -0,0 +1,7 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="HwSwInfo.aspx.cs" Inherits="ES3.HwSwInfo" %>
<%@ Register Src="~/WebUserControls/cmp_HwSwInfo.ascx" TagPrefix="uc1" TagName="cmp_HwSwInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<uc1:cmp_HwSwInfo runat="server" id="cmp_HwSwInfo" />
</asp:Content>
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ES3
{
public partial class HwSwInfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
+26
View File
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <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 ES3
{
public partial class HwSwInfo
{
/// <summary>
/// Controllo cmp_HwSwInfo.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.cmp_HwSwInfo cmp_HwSwInfo;
}
}
+41
View File
@@ -0,0 +1,41 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="Planner.aspx.cs" Inherits="ES3.Planner" %>
<%@ Register Src="~/WebUserControls/mod_planStats.ascx" TagPrefix="uc1" TagName="mod_planStats" %>
<%@ Register Src="~/WebUserControls/mod_planCreate.ascx" TagPrefix="uc1" TagName="mod_planCreate" %>
<%@ Register Src="~/WebUserControls/mod_gestPromODL_OUT.ascx" TagPrefix="uc1" TagName="mod_gestPromODL_OUT" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Label runat="server" ID="lblDataImportOut" CssClass="text-danger" />
<div runat="server" id="divContent">
<uc1:mod_planStats runat="server" ID="mod_planStats" />
<uc1:mod_planCreate runat="server" ID="mod_planCreate" />
<div class="card">
<div class="card-header bg-success text-light">
<div class="d-flex justify-content-between">
<div class="p-0 align-self-center">
<h5>Pianificazione</h5>
</div>
<div class="p-0" style="font-size: 1.6em;">
</div>
<div class="p-0 align-self-center">
<asp:LinkButton runat="server" ID="lbtToggle" OnClick="lbtToggle_Click" CssClass="btn btn-light"><i class="fa fa-chevron-up" aria-hidden="true" runat="server" id="tgIcon"></i></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-1" runat="server" id="divPromOUT">
<%-- <br />
rivedere il discorso dei FREEPASS autogenerati... x filtrare x TIPO creazione
<br />
ordinare SEMPRE x priorità ASC (FIFO) e indicarlo!!!
<br />
togliere filtri da header e/o gestione toggle e/o nascondere creazione promessa?--%>
<uc1:mod_gestPromODL_OUT runat="server" ID="mod_gestPromODL_OUT" />
</div>
</div>
</div>
</asp:Content>
+78
View File
@@ -0,0 +1,78 @@
using SteamWare;
using System;
namespace ES3
{
public partial class Planner : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
toggleVisibility();
}
checkEnabled();
string codPre = memLayer.ML.CRS("OptAdmKit_CodPre");
mod_planStats.eh_reset += Mod_planStats_eh_reset;
mod_planStats.eh_selVal += Mod_planStats_eh_selVal;
mod_planCreate.eh_ucev += Mod_planCreate_eh_ucev;
}
private void Mod_planCreate_eh_ucev(object sender, EventArgs e)
{
// se trovo evento select/reset mostro/nascondo dettagli...
ucEvent evento = (ucEvent)e;
switch (evento.tipoEvento)
{
case ucEvType.ReqUpdateParent:
mod_planStats.doReset();
mod_gestPromODL_OUT.resetSelezione();
break;
default:
break;
}
}
protected void lbtToggle_Click(object sender, EventArgs e)
{
toggleVisibility();
}
private void toggleVisibility()
{
divPromOUT.Visible = !divPromOUT.Visible;
tgIcon.Attributes["class"] = divPromOUT.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down";
}
private void Mod_planStats_eh_selVal(object sender, EventArgs e)
{
fixSelStat();
}
private void Mod_planStats_eh_reset(object sender, EventArgs e)
{
fixSelStat();
}
protected void fixSelStat()
{
mod_planCreate.CodGruppo = mod_planStats.CodGruppo;
mod_planCreate.IdxMacchina = mod_planStats.IdxMacchina;
mod_planCreate.CodArticolo = mod_planStats.CodArticolo;
mod_planCreate.doUpdate();
}
private void checkEnabled()
{
bool optPar = memLayer.ML.CRB("OptAdmKitEnabled");
divContent.Visible = optPar;
lblDataImportOut.Visible = !optPar;
string messaggio = "";
if (!optPar)
{
messaggio = "Attenzione: Gestione KIT disabilitata";
lblDataImportOut.Text = messaggio;
}
}
}
}
+87
View File
@@ -0,0 +1,87 @@
//------------------------------------------------------------------------------
// <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 ES3 {
public partial class Planner {
/// <summary>
/// Controllo lblDataImportOut.
/// </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 lblDataImportOut;
/// <summary>
/// Controllo divContent.
/// </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 divContent;
/// <summary>
/// Controllo mod_planStats.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.mod_planStats mod_planStats;
/// <summary>
/// Controllo mod_planCreate.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.mod_planCreate mod_planCreate;
/// <summary>
/// Controllo lbtToggle.
/// </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 lbtToggle;
/// <summary>
/// Controllo tgIcon.
/// </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 tgIcon;
/// <summary>
/// Controllo divPromOUT.
/// </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 divPromOUT;
/// <summary>
/// Controllo mod_gestPromODL_OUT.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.mod_gestPromODL_OUT mod_gestPromODL_OUT;
}
}
@@ -0,0 +1,248 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestPromODL_OUT.ascx.cs" Inherits="ES3.WebUserControls.mod_gestPromODL_OUT" %>
<%@ Register Src="~/WebUserControls/mod_newPromessaODL.ascx" TagPrefix="uc1" TagName="mod_newPromessaODL" %>
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<h4>Filtri attivi</h4>
</div>
<div class="col">
REPARTO
<br />
<asp:DropDownList runat="server" ID="ddlCodGruppo" DataSourceID="odsCodGruppo" DataTextField="DescrGruppo" DataValueField="CodGruppo" AutoPostBack="True" OnSelectedIndexChanged="ddlCodGruppo_SelectedIndexChanged" AppendDataBoundItems="true">
<asp:ListItem Text="-- SHOW ALL --" Value=""></asp:ListItem>
</asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsCodGruppo" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_applicazioneTableAdapters.AnagraficaGruppiTableAdapter" FilterExpression="TipoGruppo = 'FASE' AND SelEnabled = 1"></asp:ObjectDataSource>
</div>
<div class="col text-nowrap">
<div class="input-group my-1 input-group-sm">
<div class="input-group-prepend">
<asp:LinkButton runat="server" ID="lbtResArt" CssClass="btn btn-outline-dark" OnClick="lbtResArt_Click"><i class="fa fa-refresh"></i> <b>Articolo</b></asp:LinkButton>
<asp:Label runat="server" ID="lblCodArt" CssClass="input-group-text" />
<asp:Label runat="server" ID="lblDescArt" CssClass="input-group-text text-truncate" />
</div>
</div>
</div>
<div class="col">
<div class="input-group my-1 input-group-sm">
<div class="input-group-prepend">
<asp:LinkButton runat="server" ID="lbtResMacc" CssClass="btn btn-outline-dark" OnClick="lbtResMacc_Click"><i class="fa fa-refresh"></i> <b>Macchina</b></asp:LinkButton>
<asp:Label runat="server" ID="lblNomeMacc" CssClass="input-group-text" />
<asp:Label runat="server" ID="lblIdxMacc" CssClass="input-group-text" />
</div>
</div>
</div>
<div class="col">
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">
<asp:CheckBox runat="server" ID="chkUnassigned" AutoPostBack="True" OnCheckedChanged="chkUnassigned_CheckedChanged" Checked="true" />
</div>
</div>
<asp:Label runat="server" ID="lblUnass" CssClass="input-group-text" Text="Mostra SOLO programmate" />
</div>
</div>
</div>
<div class="bg-dark text-light" style="white-space: nowrap; padding: 2px;">
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<asp:LinkButton ID="lbtNewPODL" runat="server" OnClick="lbtNewPODL_Click" CssClass="btn btn-block btn-primary text-light"><i class="fa fa-plus"></i> PROMESSA ODL <i class="fa fa-list-ol"></i></asp:LinkButton>
</div>
<div class="col-4"></div>
</div>
<uc1:mod_newPromessaODL runat="server" ID="mod_newPromessaODL" />
</div>
<div id="divEditQta" runat="server" visible="false" class="ctrSelRowStyle" style="white-space: nowrap; padding: 2px;">
<div class="row">
<div class="col-sm-3">
<asp:LinkButton ID="lbtOk" runat="server" Text="Ok" OnClick="btnOk_Click" CssClass="btn btn-block btn-success" OnClientClick="return confirm('Sicuro di voler modificare la Promessa ODL?');"><i class="fa fa-plus"></i> Modifica </asp:LinkButton>
</div>
<div class="col-sm-3">
# Pezzi Richiesti:
<asp:TextBox runat="server" ID="txtNewQta" Width="6em" />
</div>
<div class="col-sm-3">
Pezzi Pallet:
<asp:TextBox runat="server" ID="txtNewPzPallet" Width="6em" />
</div>
<div class="col-sm-3">
<asp:LinkButton ID="lbtCancel" runat="server" Text="Annulla" OnClick="btnCancel_Click" CssClass="btn btn-block btn-warning"><i class="fa fa-ban"></i> Annulla</asp:LinkButton>
</div>
</div>
</div>
</div>
<div class="card-body">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound" PageSize="25"
DataKeyNames="IdxPromessa" DataSourceID="ods" Width="100%">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:LinkButton runat="server" ID="lbtReset" CausesValidation="false" OnClick="btnReset_Click" ToolTip="Reset selezione" CssClass="btn btn-block btn-warning"><i class="fa fa-refresh"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtSel" CausesValidation="false" CommandName="Select" OnCommand="lbt_Command" CommandArgument="Edit" ToolTip="Modifica promessa" Visible='<%# Eval("IdxODL").ToString()=="" || Eval("IdxODL").ToString()=="0" %>' CssClass="btn btn-sm btn-info"><i class="fa fa-edit"></i></asp:LinkButton>
<asp:LinkButton runat="server" ID="lbtClona" CausesValidation="false" CommandName="Select" OnCommand="lbt_Command" CommandArgument="Clona" ToolTip="Copia promessa" CssClass="btn btn-sm btn-primary" Visible='<%# !Eval("KeyRichiesta").ToString().StartsWith("KIT") %>'><i class="fa fa-clipboard"></i></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="#" SortExpression="IdxPromessa">
<ItemTemplate>
<asp:Label runat="server" ID="txtIdxPromessa" Text='<%# Eval("IdxPromessa") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ODL" SortExpression="IdxOdl">
<ItemTemplate>
<asp:Label runat="server" ID="txtIdxOdl" Text='<%# Eval("IdxOdl") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodArticolo" SortExpression="CodArticolo">
<ItemTemplate>
<div class="row">
<div class="col-6">
<asp:LinkButton runat="server" ID="lbtSelArt" OnClick="lbtSelArt_Click" CausesValidation="False" CommandArgument='<%# Eval("CodArticolo")+"|"+Eval("DescArticolo") %>' CssClass="btn btn-sm btn-outline-dark p-1">
<i class="fa fa-search"></i>
<b><%# Eval("CodArticolo") %></b>
</asp:LinkButton>
</div>
<div class="col-6 text-right font-weight-bold">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("KeyRichiesta") %>' />
</div>
</div>
<div class="row">
<div class="col-5">
<asp:Label runat="server" ID="txtDescArticolo" Text='<%# Eval("DescArticolo") %>' />
</div>
<div class="col-7 text-right">
<asp:Label runat="server" ID="Label2" Text='<%# Eval("Note") %>' />
</div>
</div>
<div style="float: none; clear: both;">
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="codMacchina" SortExpression="CodMacchina">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtSelMacc" OnClick="lbtSelMacc_Click" CausesValidation="False" CommandArgument='<%# Eval("IdxMacchina")+"|"+Eval("Nome") %>' CssClass="btn btn-sm btn-outline-dark p-1 btn-block">
<i class="fa fa-search"></i>
<b><%# Eval("Nome") %></b>
<div><%# Eval("CodMacchina") %></div>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NumPezzi" SortExpression="NumPezzi" ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:Label runat="server" ID="txtNumPezzi" Text='<%# Eval("NumPezzi") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:Label runat="server" ID="txtNumPezzi" Text='<%# Bind("NumPezzi") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TCAssegnato" SortExpression="TCAssegnato" ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:Label runat="server" ID="txtTCAssegnato" Text='<%# Eval("TCAssegnato","{0:0.000}") %>' />
<div class="small">
<asp:Label runat="server" ID="txtTCAssMs" Text='<%# SteamWare.TempiCiclo.minSec(Eval("TCAssegnato")) %>' />
(m:s)
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PzPallet" SortExpression="PzPallet" ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:Label runat="server" ID="txtPzPallet" Text='<%# Eval("PzPallet") %>' />
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Data" SortExpression="DueDate" ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:Label runat="server" ID="txtDataInizio" Text='<%# Eval("DueDate") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ord" SortExpression="Priorita" ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:Label runat="server" ID="txtPriorita" Text='<%# Eval("Priorita") %>' CssClass="font-weight-bold" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div class="d-flex">
<div class="mr-auto p-2">
<div class="btn-group">
<asp:LinkButton runat="server" ID="lbtNoneSx" Enabled="false" Visible='<%# !checkChgPrio(Eval("IdxMacchina").ToString(), Eval("Priorita").ToString(), 1) %>' CssClass="btn btn-sm btn-outline-success text-light"><i class="fa fa-plus" aria-hidden="true"></i></asp:LinkButton>
<asp:LinkButton runat="server" ID="lnkMoveUp" Visible='<%# checkChgPrio(Eval("IdxMacchina").ToString(), Eval("Priorita").ToString(), 1) %>' ToolTip="Aumenta (ritarda)" OnClick="lnkMoveUp_Click" CausesValidation="False" CommandArgument='<%# Eval("IdxPromessa") %>' CssClass="btn btn-sm btn-success"><i class="fa fa-plus" aria-hidden="true"></i></asp:LinkButton>
<asp:LinkButton runat="server" ID="lnkMoveDown" Visible='<%# checkChgPrio(Eval("IdxMacchina").ToString(), Eval("Priorita").ToString(), -1) %>' ToolTip="Diminuisci (anticipa)" OnClick="lnkMoveDown_Click" CausesValidation="False" CommandArgument='<%# Eval("IdxPromessa") %>' CssClass="btn btn-sm btn-success"><i class="fa fa-minus" aria-hidden="true"></i></asp:LinkButton>
<asp:LinkButton runat="server" ID="lbtNoneDx" Enabled="false" Visible='<%# !checkChgPrio(Eval("IdxMacchina").ToString(), Eval("Priorita").ToString(), -1) %>' CssClass="btn btn-sm btn-outline-success text-light"><i class="fa fa-minus" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Attiva" SortExpression="Attivabile" ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkAttiva" Checked='<%# Eval("Attivabile") %>' Enabled="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtDel" CommandArgument='<%# Eval("IdxPromessa") %>' OnClientClick="return confirm('Sicuro di voler procedere con eliminazione?');" OnClick="lbtDel_Click" ToolTip='<%# traduci("Delete") %>' Visible='<%# Eval("IdxODL").ToString()=="" || Eval("IdxODL").ToString()=="0" %>' CssClass="btn btn-sm btn-danger"><i class="fa fa-trash"></i></asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:HiddenField runat="server" ID="hfCodGruppo" />
<asp:HiddenField runat="server" ID="hfCodPre" />
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByMaccArt" TypeName="MapoDb.DS_PlanTableAdapters.PromesseOUTTableAdapter" OnInserting="recuperaFooter" FilterExpression=" ( CodArticolo LIKE '%{0}%' OR DescArticolo LIKE '%{0}%' ) AND ( KeyRichiesta LIKE '{1}%' ) " OnInserted="ods_Updated" OnUpdated="ods_Updated" DeleteMethod="deleteQuery" OnDeleted="ods_Updated" UpdateMethod="updateQta">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
<asp:ControlParameter ControlID="hfCodPre" Name="CodPre" PropertyName="Value" Type="String" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxPromessa" Type="Int32" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="lblIdxMacc" Name="IdxMacchina" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="lblCodArt" Name="CodArticolo" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="ddlCodGruppo" Name="CodGruppo" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="chkUnassigned" Name="onlyFree" PropertyName="Checked" Type="Boolean" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="NumPezzi" Type="Int32" />
<asp:Parameter Name="PzPallet" Type="Int32" />
<asp:Parameter Name="Original_idxPromessa" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
</div>
<div class="card-footer">
<div class="row">
<div class="col"></div>
<div class="col text-center">
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
</div>
<div class="col text-right">
mostra:
<asp:TextBox runat="server" ID="txtPageSize" Text="10" Width="2em" OnTextChanged="txtPageSize_TextChanged" />
</div>
</div>
</div>
</div>
@@ -0,0 +1,693 @@
using MapoDb;
using SteamWare;
using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ES3.WebUserControls
{
public partial class mod_gestPromODL_OUT : System.Web.UI.UserControl
{
/// <summary>
/// Determina se sia solo readonly il controllo...
/// </summary>
public bool readOnly;
/// <summary>
/// Chiave PRE selezione tipo richiesta ordine
/// </summary>
public string codOrdPre
{
get
{
return hfCodPre.Value.Trim();
}
set
{
hfCodPre.Value = value;
}
}
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
/// <summary>
/// Abilitazione modifica selettore fase
/// </summary>
public bool enableSelFase
{
get
{
return ddlCodGruppo.Enabled;
}
set
{
ddlCodGruppo.Enabled = value;
}
}
/// <summary>
/// Gruppo selezionato
/// </summary>
public string CodGruppo
{
get
{
return ddlCodGruppo.SelectedValue;
}
set
{
ddlCodGruppo.SelectedValue = value;
}
}
#region area da NON modificare
#region area protected
protected string _idxGridView;
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
bool doClone = false;
bool doEdit = false;
// gestione buttons richieste
string _comando = "";
if (memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = memLayer.ML.StringSessionObj("nextObjCommand");
memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Clona":
doClone = true;
break;
case "Edit":
doEdit = true;
break;
default:
break;
}
if (doClone)
{
memLayer.ML.setSessionVal("idxProm2Clone", grView.SelectedValue, false);
showAddNewPODL();
mod_newPromessaODL.doSelPODL();
}
else if (doEdit)
{
memLayer.ML.setSessionVal("idxProm2Edit", grView.SelectedValue, false);
showAddNewPODL();
mod_newPromessaODL.doSelPODL();
}
else
{
// mostro edit quantità...
divEditQta.Visible = true;
lbtNewPODL.Visible = true;
mod_newPromessaODL.Visible = false;
var riga = DataLayer.obj.taPODL.getByKey(idxPOdlSel)[0];
numPz = riga.NumPezzi;
pzPallet = riga.PzPallet;
}
}
/// <summary>
/// traduce gli header delle colonne
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_DataBound(object sender, EventArgs e)
{
if (grView.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grView.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
}
else
{
lblNumRec.Text = "";
}
}
/// <summary>
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
{
//recupero la riga footer...
DataColumnCollection colonne = colonneObj();
string nomeCol;
string tipoColonna = "";
foreach (DataColumn colonna in colonne)
{
nomeCol = colonna.ColumnName;
// cerco un textbox o quello che sia...
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
{
tipoColonna = "textBox";
}
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
{
tipoColonna = "dropDownList";
}
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
{
tipoColonna = "checkBox";
}
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
{
tipoColonna = "selAjax";
}
// in base al tipo salvo negli inputparameters dell'ODS
switch (tipoColonna)
{
case "textBox":
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
break;
case "dropDownList":
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
break;
case "checkBox":
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
break;
//case "selAjax":
// e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
// break;
default:
break;
}
tipoColonna = "";
}
}
/// <summary>
/// svuoto da cache post update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// evento come nuovo...
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
#endregion
#region are public
/// <summary>
/// effettua traduzione del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// effettua traduzione in inglese del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduciEn(string lemma)
{
return user_std.UtSn.TraduciEn(lemma);
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
divEditQta.Visible = false;
mod_newPromessaODL.Visible = false;
lbtNewPODL.Visible = true;
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
#endregion
#region area da modificare
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Page.IsPostBack)
{
mod_newPromessaODL.Visible = false;
grView.PageSize = pageSize;
// se ho in sessione selezione la recupero...
if (memLayer.ML.isInSessionObject("selFaseBCode") && enableSelFase)
{
ddlCodGruppo.SelectedValue = memLayer.ML.StringSessionObj("selFaseBCode");
}
}
mod_newPromessaODL.eh_nuovoValore += new EventHandler(mod_newOdl1_eh_nuovoValore);
}
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "IdxODL";
}
/// <summary>
/// nuovo valore creato...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e)
{
// nascondo controllo e mostro button
mod_newPromessaODL.Visible = false;
lbtNewPODL.Visible = true;
// aggiorno!
resetSelezione();
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
MapoDb.DS_ProdTempi.ODLDataTable tabella = new MapoDb.DS_ProdTempi.ODLDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
public bool delEnabled(object _idxOdl)
{
bool answ = false;
int idxOdl = 0;
// controllo non sia già stata iniziata la produzione sennò non posso cancellare...
try
{
idxOdl = Convert.ToInt32(_idxOdl);
answ = (MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, true).Count > 0);
}
catch
{ }
return answ;
}
/// <summary>
/// mostra creazione nuovo ODL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtNewPODL_Click(object sender, EventArgs e)
{
showAddNewPODL();
}
private void showAddNewPODL()
{
// mostro controllo creazione ODL
mod_newPromessaODL.Visible = true;
divEditQta.Visible = false;
lbtNewPODL.Visible = false;
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// formatot url x stampa ODL
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public string formattaUrlOdl(object idx)
{
string answ = String.Format(memLayer.ML.CRS("exportFormat1"), Convert.ToInt32(reportRichiesto.SchedaODL), idx);
return answ;
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// elimina commento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtDel_Click(object sender, EventArgs e)
{
LinkButton imgBtn = (LinkButton)sender;
int IdxProm = 0;
int.TryParse(imgBtn.CommandArgument, out IdxProm);
DataLayer.obj.taPODL.deleteQuery(IdxProm);
doUpdate();
}
protected void doUpdate()
{
updateGrView();
}
#endregion
protected void btnOk_Click(object sender, EventArgs e)
{
if (idxPOdlSel > 0)
{
DataLayer.obj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel);
}
updateCtrl();
}
private void updateCtrl()
{
divEditQta.Visible = false;
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// idxOdl selezionato
/// </summary>
protected int idxPOdlSel
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(grView.SelectedValue);
}
catch
{ }
return answ;
}
}
/// <summary>
/// Nuovo num pz
/// </summary>
protected int numPz
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(txtNewQta.Text.Trim());
}
catch
{ }
return answ;
}
set
{
txtNewQta.Text = value.ToString();
}
}
/// <summary>
/// Nuovo num pz per pallet
/// </summary>
protected int pzPallet
{
get
{
int answ = 1;
try
{
answ = Convert.ToInt32(txtNewPzPallet.Text.Trim());
}
catch
{ }
// controllo sia > 0...
if (answ < 1)
{
answ = 1;
}
return answ;
}
set
{
txtNewPzPallet.Text = value.ToString();
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
updateCtrl();
}
protected void chkUnassigned_CheckedChanged(object sender, EventArgs e)
{
updateGrView();
}
/// <summary>
/// Aggiorno Gridview
/// </summary>
private void updateGrView()
{
grView.DataBind();
}
/// <summary>
/// IdxMacchina filtrata
/// </summary>
protected string idxMacc
{
get
{
return lblIdxMacc.Text;
}
set
{
lblIdxMacc.Text = value;
}
}
/// <summary>
/// Nome filtrata
/// </summary>
protected string NomeMacc
{
get
{
return lblNomeMacc.Text;
}
set
{
lblNomeMacc.Text = value;
}
}
/// <summary>
/// CodArt filtrato
/// </summary>
protected string CodArt
{
get
{
return lblCodArt.Text;
}
set
{
lblCodArt.Text = value;
}
}
/// <summary>
/// CodArt filtrato
/// </summary>
protected string DescArt
{
get
{
return lblDescArt.Text;
}
set
{
lblDescArt.Text = value;
}
}
/// <summary>
/// Selezionato un condominio --> riporto selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelArt_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
string[] artData = lb.CommandArgument.Split('|');
CodArt = artData[0];
DescArt = artData[1];
updateGrView();
}
/// <summary>
/// Selezionato un condominio --> riporto selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelMacc_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
string[] maccData = lb.CommandArgument.Split('|');
idxMacc = maccData[0];
NomeMacc = maccData[1];
updateGrView();
}
/// <summary>
/// Richiesto abbassamento priorità = ANTICIPA
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkMoveDown_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
int IdxPromessa = 0;
int.TryParse(lb.CommandArgument, out IdxPromessa);
// chiamo stored
DataLayer.obj.taPromOut.movePrio(IdxPromessa, -1);
//update!
updateGrView();
}
/// <summary>
/// Richiesto aumento priorità = RITARDA
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkMoveUp_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
int IdxPromessa = 0;
int.TryParse(lb.CommandArgument, out IdxPromessa);
// chiamo stored
DataLayer.obj.taPromOut.movePrio(IdxPromessa, 1);
//update!
updateGrView();
}
protected void lbtResArt_Click(object sender, EventArgs e)
{
CodArt = "";
DescArt = "";
updateGrView();
}
protected void lbtResMacc_Click(object sender, EventArgs e)
{
idxMacc = "";
NomeMacc = "";
updateGrView();
}
protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in sessione selezione...
memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue);
}
/// <summary>
/// Verifica se sia permesso cambio priorità (NON può andare a 0 ne oltre il max x macchina)
/// </summary>
/// <param name="IdxMacchina"></param>
/// <param name="priorStr"></param>
/// <param name="delta"></param>
/// <returns></returns>
public bool checkChgPrio(string IdxMacchina, string priorStr, int delta)
{
bool answ = false;
int priorita = 0;
int.TryParse(priorStr, out priorita);
// calcolo i limiti priorità x macchina (0 --> max x macchina)... LPI/LPS liminte priorità inferiore / superiore
int LPI = 1;
int LPS = 1;
var tabella = DataLayer.obj.taPromOut.getMaxPrioByMacc(IdxMacchina, true);
if (tabella.Rows.Count > 0)
{
LPS = tabella[0].Priorita;
}
// è ok SE sono ENTRO i 2 limiti
answ = ((priorita + delta) >= LPI && (priorita + delta) <= LPS);
//return
return answ;
}
}
}
+231
View File
@@ -0,0 +1,231 @@
//------------------------------------------------------------------------------
// <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 ES3.WebUserControls {
public partial class mod_gestPromODL_OUT {
/// <summary>
/// Controllo ddlCodGruppo.
/// </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.DropDownList ddlCodGruppo;
/// <summary>
/// Controllo odsCodGruppo.
/// </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 odsCodGruppo;
/// <summary>
/// Controllo lbtResArt.
/// </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 lbtResArt;
/// <summary>
/// Controllo lblCodArt.
/// </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 lblCodArt;
/// <summary>
/// Controllo lblDescArt.
/// </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 lblDescArt;
/// <summary>
/// Controllo lbtResMacc.
/// </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 lbtResMacc;
/// <summary>
/// Controllo lblNomeMacc.
/// </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 lblNomeMacc;
/// <summary>
/// Controllo lblIdxMacc.
/// </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 lblIdxMacc;
/// <summary>
/// Controllo chkUnassigned.
/// </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.CheckBox chkUnassigned;
/// <summary>
/// Controllo lblUnass.
/// </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 lblUnass;
/// <summary>
/// Controllo lbtNewPODL.
/// </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 lbtNewPODL;
/// <summary>
/// Controllo mod_newPromessaODL.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.mod_newPromessaODL mod_newPromessaODL;
/// <summary>
/// Controllo divEditQta.
/// </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 divEditQta;
/// <summary>
/// Controllo lbtOk.
/// </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 lbtOk;
/// <summary>
/// Controllo txtNewQta.
/// </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.TextBox txtNewQta;
/// <summary>
/// Controllo txtNewPzPallet.
/// </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.TextBox txtNewPzPallet;
/// <summary>
/// Controllo lbtCancel.
/// </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 lbtCancel;
/// <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 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 hfCodPre.
/// </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 hfCodPre;
/// <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 lblNumRec.
/// </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 lblNumRec;
/// <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 txtPageSize.
/// </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.TextBox txtPageSize;
}
}
+74
View File
@@ -0,0 +1,74 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" Codebehind="mod_login.ascx.cs" %>
<asp:Panel ID="pnlForceUser" runat="server">
<table width="100%">
<tr>
<td class="chPwdTitle">
<asp:Label runat="server" ID="lblTitolo" />
</td>
</tr>
</table>
<table class="smallTable">
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblPwd" />
</td>
<td>
<asp:TextBox runat="server" ID="authKey" TextMode="Password" Width="210px" />
</td>
</tr>
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblDominio" />
</td>
<td>
<asp:TextBox runat="server" ID="dominio" Width="210px" />
</td>
</tr>
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblUser" />
</td>
<td>
<asp:TextBox runat="server" ID="user" Width="210px" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button Width="100%" runat="server" ID="btnOk" CommandName="ok" CommandArgument="ok"
OnClick="btnOk_Click"></asp:Button>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="pnlSelectUser" runat="server">
<table class="smallTable">
<tr>
<td>
<asp:DropDownList ID="ddlStdUser" runat="server">
<asp:ListItem>DOMITBREMBO\WebGTD_R</asp:ListItem>
<asp:ListItem>DOMITBREMBO\WebGTD_W</asp:ListItem>
<asp:ListItem>DOMITBREMBO\WebGTD_X</asp:ListItem>
<asp:ListItem>DOMITBREMBO\WebGTD_A</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnOkUserStd" runat="server" Width="100%"
onclick="btnOkUserStd_Click" />
</td>
</tr>
</table>
</asp:Panel>
<table class="smallTable">
<tr>
<td colspan="2">
<asp:Label CssClass="chPwdTxt" ID="lblMessage" runat="server" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:HyperLink ID="HypLinkSSO" runat="server" NavigateUrl="~/login.aspx" Text="Single-Sign-On Login"></asp:HyperLink>
</td>
</tr>
</table>
+309
View File
@@ -0,0 +1,309 @@
using SteamWare;
using System;
using System.Web.UI;
/// <summary>
/// classe gestione login e forzatura login
/// </summary>
public partial class mod_login : SteamWare.ApplicationUserControl
{
#region area protected/private
#region area proprietà
private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale;
#endregion
#region area metodi
/// <summary>
/// imposta la modalità di login tra normale / forceUser
/// </summary>
private void setLoginMode()
{
switch (_isForceUser)
{
case SteamWare.loginMode.normale:
pnlForceUser.Visible = false;
pnlSelectUser.Visible = false;
break;
case SteamWare.loginMode.forceUser:
pnlForceUser.Visible = true;
pnlSelectUser.Visible = false;
break;
case SteamWare.loginMode.standardUser:
pnlForceUser.Visible = false;
pnlSelectUser.Visible = true;
break;
default:
break;
}
}
protected override void traduciObj()
{
lblPwd.Text = user_std.UtSn.Traduci("lblPwd");
lblUser.Text = user_std.UtSn.Traduci("lblUser");
lblDominio.Text = user_std.UtSn.Traduci("lblDominio");
lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente");
btnOk.Text = user_std.UtSn.Traduci("btnCommit");
btnOkUserStd.Text = user_std.UtSn.Traduci("btnCommit");
}
/// <summary>
/// prova a verificare se l'utente sia ok x AD credentials
/// </summary>
private void AdLogin()
{
lblMessage.Text = "User not authenticated...";
if (Page.User.Identity.IsAuthenticated)
{
//recupera user windows se c'è...
string ad_name = Page.User.Identity.Name;
string delimStr = "\\";
char[] delimiter = delimStr.ToCharArray();
string[] dom_user = ad_name.Split(delimiter, 2);
// passo al controllo di verifica ADuserOk...
user_std _utente = new user_std();
if (_utente.ADuserOk(dom_user[0], dom_user[1]))
{
bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]);
if (fatto)
{
SteamWare.logger.lg.scriviLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD), SteamWare.tipoLog.INFO);
if (Login_ok != null)
{
Login_ok(this, new EventArgs());
}
}
else
{
lblMessage.Text = String.Format("{0}<br>There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = String.Format("{0}<br>user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
SteamWare.logger.lg.scriviLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth");
SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
/// <summary>
/// effettua verifiche e se concesso permette di forzare l'accesso utente
/// </summary>
private void ForceUserIdentity()
{
if (Page.User.Identity.IsAuthenticated)
{
bool _allowForceUser = false;
try
{
_allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser");
}
catch
{
_allowForceUser = false;
}
if (_allowForceUser)
{
if (authKey.Text == "forzaInter") // verifica passphrase...
{
user_std _utente = new user_std();
user_std.UtSn.isForcedUser = true;
bool fatto = _utente.startUpUtente(dominio.Text, user.Text);
if (fatto)
{
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
if (Login_ok != null)
{
Login_ok(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = String.Format("{0}<br>key not allowed for operation!! operation logged!!", user_std.UtSn.Traduci("AccessFail"));
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = string.Format("{0}<br>user not authenticated!<br>", user_std.UtSn.Traduci("AccessFail"));
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
}
}
/// <summary>
/// se concesso il generico ForceUser permette di forzare l'accesso utente ad uno degli standard
/// </summary>
private void StdUserIdentity()
{
if (Page.User.Identity.IsAuthenticated)
{
bool _allowForceUser = false;
try
{
_allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser");
}
catch
{
_allowForceUser = false;
}
if (_allowForceUser)
{
//leggo e codifico utente indicato
string delimStr = "\\";
char[] delimiter = delimStr.ToCharArray();
string[] dom_user = ddlStdUser.SelectedValue.Split(delimiter, 2);
//forzo login!
user_std _utente = new user_std();
user_std.UtSn.isForcedUser = true;
bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]);
if (fatto)
{
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dom_user[0], dom_user[1]);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
if (Login_ok != null)
{
Login_ok(this, new EventArgs());
}
}
}
else
{
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = string.Format("{0}<br>user not authenticated!<br>", user_std.UtSn.Traduci("AccessFail"));
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
}
}
/// <summary>
/// fa login con force user e controllo pwd
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
ForceUserIdentity();
}
/// <summary>
/// fa login utente tipo standard
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOkUserStd_Click(object sender, EventArgs e)
{
StdUserIdentity();
}
#endregion
#endregion
#region area public
#region eventi pubblici esposti
public event EventHandler Login_ok;
public event EventHandler Login_Error;
#endregion
#region area proprietà
/// <summary>
/// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser
/// </summary>
public SteamWare.loginMode modoLogin
{
get
{
return _isForceUser;
}
set
{
_isForceUser = value;
}
}
#endregion
/// <summary>
/// avvio pagina
/// </summary>
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
//carico da web.config i default values
loadDefaultsWebConfig();
// procedo...
setLoginMode();
Session.RemoveAll();
if (_isForceUser == SteamWare.loginMode.normale)
{
AdLogin();
}
}
#endregion
}
+140
View File
@@ -0,0 +1,140 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class mod_login {
/// <summary>
/// pnlForceUser control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnlForceUser;
/// <summary>
/// lblTitolo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblTitolo;
/// <summary>
/// lblPwd control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPwd;
/// <summary>
/// authKey control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox authKey;
/// <summary>
/// lblDominio control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblDominio;
/// <summary>
/// dominio control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox dominio;
/// <summary>
/// lblUser control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblUser;
/// <summary>
/// user control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox user;
/// <summary>
/// btnOk control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnOk;
/// <summary>
/// pnlSelectUser control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnlSelectUser;
/// <summary>
/// ddlStdUser control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlStdUser;
/// <summary>
/// btnOkUserStd control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnOkUserStd;
/// <summary>
/// lblMessage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMessage;
/// <summary>
/// HypLinkSSO control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO;
}
+91
View File
@@ -0,0 +1,91 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_main_help" CodeBehind="mod_main_help.ascx.cs" %>
<div class="row">
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtAnagArticoli" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnAnagArticoli_Click">
<div><i class="fa fa-tasks fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnAnagArticoli") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestPromesseOdl" CssClass="btn btn-outline-primary btn-block py-3" OnClick="btnGestPromesseOdl_Click">
<div><i class="fa fa-list-ol fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestPromesseOdl") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestOdl" CssClass="btn btn-outline-success btn-block py-3" OnClick="btnGestOdl_Click">
<div><i class="fa fa-wrench fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestOdl") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestDatiMacchina" CssClass="btn btn-outline-secondary btn-block py-3" OnClick="btnGestDatiMacchina_Click">
<div><i class="fa fa-industry fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestDatiMacchina") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaTC" CssClass="btn btn-outline-warning btn-block py-3" OnClick="btnApprovaTC_Click"> <div><i class="fa fa-clock-o fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnApprovaTC") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaProd" CssClass="btn btn-outline-danger btn-block py-3" OnClick="btnApprovaProd_Click">
<div><i class="fa fa-thumbs-up fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnApprovaProd") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtBCode" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnBCode_Click">
<div><i class="fa fa-barcode fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnBCode") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestKIT" CssClass="btn btn-outline-info btn-block py-3" OnClick="lbtGestKIT_Click">
<div><i class="fa fa-object-group fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestKIT") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestPlan" CssClass="btn btn-outline-warning btn-block py-3" OnClick="lbtGestPlan_Click">
<div><i class="fa fa-map-signs fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnPlanner") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtDataImport" CssClass="btn btn-outline-info btn-block py-3" OnClick="lbtDataImport_Click">
<div><i class="fa fa-download fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnDataImport") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtBCodeCtrack" CssClass="btn btn-outline-primary btn-block py-3" OnClick="lbtBCodeCtrack_Click">
<div><i class="fa fa-barcode fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnBCodeCTrack") %>
</div>
</asp:LinkButton>
</div>
</div>
+63
View File
@@ -0,0 +1,63 @@
using SteamWare;
using System;
public partial class mod_main_help : ApplicationUserControl
{
protected override void Page_Load(object sender, EventArgs e)
{
}
protected void btnGestPromesseOdl_Click(object sender, EventArgs e)
{
Response.Redirect("~/gestPromesseODL");
}
protected void btnGestOdl_Click(object sender, EventArgs e)
{
Response.Redirect("~/gestioneODL");
}
protected void btnAnagArticoli_Click(object sender, EventArgs e)
{
Response.Redirect("~/anagArticoli");
}
protected void btnGestDatiMacchina_Click(object sender, EventArgs e)
{
Response.Redirect("~/gestioneDatiMacchine");
}
protected void btnApprovaTC_Click(object sender, EventArgs e)
{
Response.Redirect("~/approvazioneODL");
}
protected void btnApprovaProd_Click(object sender, EventArgs e)
{
Response.Redirect("~/approvazioneProd");
}
protected void btnBCode_Click(object sender, EventArgs e)
{
Response.Redirect("~/BCode");
}
protected void lbtGestKIT_Click(object sender, EventArgs e)
{
Response.Redirect("~/GestKIT");
}
protected void lbtGestPlan_Click(object sender, EventArgs e)
{
Response.Redirect("~/Planner");
}
protected void lbtDataImport_Click(object sender, EventArgs e)
{
Response.Redirect("~/DataImport");
}
protected void lbtBCodeCtrack_Click(object sender, EventArgs e)
{
Response.Redirect("~/CTrackBCode");
}
}
+112
View File
@@ -0,0 +1,112 @@
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
public partial class mod_main_help {
/// <summary>
/// Controllo lbtAnagArticoli.
/// </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 lbtAnagArticoli;
/// <summary>
/// Controllo lbtGestPromesseOdl.
/// </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 lbtGestPromesseOdl;
/// <summary>
/// Controllo lbtGestOdl.
/// </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 lbtGestOdl;
/// <summary>
/// Controllo lbtGestDatiMacchina.
/// </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 lbtGestDatiMacchina;
/// <summary>
/// Controllo lbtApprovaTC.
/// </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 lbtApprovaTC;
/// <summary>
/// Controllo lbtApprovaProd.
/// </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 lbtApprovaProd;
/// <summary>
/// Controllo lbtBCode.
/// </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 lbtBCode;
/// <summary>
/// Controllo lbtGestKIT.
/// </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 lbtGestKIT;
/// <summary>
/// Controllo lbtGestPlan.
/// </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 lbtGestPlan;
/// <summary>
/// Controllo lbtDataImport.
/// </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 lbtDataImport;
/// <summary>
/// Controllo lbtBCodeCtrack.
/// </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 lbtBCodeCtrack;
}
+193
View File
@@ -0,0 +1,193 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_newPromessaODL.ascx.cs" Inherits="ES3.WebUserControls.mod_newPromessaODL" %>
<div class="row my-2 textCondens font-weight-bold">
<div class="col-4 pr-0">
<div class="text-truncate">
Articolo (ricerca + selezione)
</div>
<div class="my-0 small">
<div class="input-group mb-3">
<div class="input-group-prepend">
<asp:TextBox runat="server" ID="txtSearch" CssClass="form form-control form-control-sm" AutoPostBack="True" OnTextChanged="txtSearch_TextChanged" placeholder="Ricerca" Width="5em" />
</div>
<asp:DropDownList runat="server" ID="ddlArticolo" DataSourceID="odsArticoli" DataTextField="label" DataValueField="value" CssClass="form-control form-control-sm" OnSelectedIndexChanged="ddlArticolo_SelectedIndexChanged"></asp:DropDownList>
<asp:ObjectDataSource ID="odsArticoli" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="MapoDb.DS_UtilityTableAdapters.v_selArticoliTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" DefaultValue="Non definito" Name="conditio" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Gruppo
</div>
<div class="my-0 small">
<asp:DropDownList ID="ddlGruppi" runat="server" DataTextField="label" DataValueField="value" AutoPostBack="True" DataSourceID="odsGruppi" CssClass="form-control form-control-sm" OnSelectedIndexChanged="ddlGruppi_SelectedIndexChanged"/>
<asp:ObjectDataSource ID="odsGruppi" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="MapoDb.DS_UtilityTableAdapters.v_selGruppiTableAdapter">
<SelectParameters>
<asp:Parameter DefaultValue="FASE" Name="conditio" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Macchina
</div>
<div class="my-0 small">
<asp:DropDownList ID="ddlMacchine" runat="server" DataTextField="label" DataValueField="value" AutoPostBack="True" DataSourceID="odsMacchine" CssClass="form-control form-control-sm" OnSelectedIndexChanged="ddlMacchine_SelectedIndexChanged"/>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="MapoDb.DS_UtilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="ddlGruppi" DefaultValue="0" Name="conditio" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Num Pz
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtNumPz" CssClass="form form-control form-control-sm text-right" TextMode="Number" />
</div>
</div>
<div class="col-2 pl-0" runat="server" id="divTCms">
<div class="text-truncate">
T.Ciclo min:sec
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtTCms" CssClass="form form-control form-control-sm text-right" />
</div>
</div>
<div class="col-2 pl-0" runat="server" id="divTCmc">
<div class="text-truncate">
T.Ciclo min.cent
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtTCmc" CssClass="form form-control form-control-sm text-right" />
</div>
</div>
</div>
<div class="row my-2 textCondens">
<div class="col-2 pr-0">
<div class="text-truncate">
Commessa / Ordine Ext
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtKeyExt" CssClass="form form-control text-right" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Priorita
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtPrio" CssClass="form form-control text-right" TextMode="Number" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Attivabile
</div>
<div class="my-0">
<asp:CheckBox runat="server" ID="chkAttiv" Checked="true" CssClass="text-center mx-3 px-2" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
PzPallet
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtPzPallet" CssClass="form form-control text-right" TextMode="Number" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
&nbsp;
</div>
<div class="my-0">
<asp:LinkButton ID="lbtOk" runat="server" Text="Ok" OnClick="btnOk_Click" CssClass="btn btn-block btn-success" OnClientClick="return confirm('Sicuro di voler creare la Promessa ODL?');" ><i class="fa fa-plus"></i> <%: testoConf %></asp:LinkButton>
</div>
</div>
<div class="col-2 pl-1">
<div class="text-truncate">
&nbsp;
</div>
<div class="my-0">
<asp:LinkButton ID="lbtCancel" runat="server" Text="Annulla" OnClick="btnCancel_Click" CssClass="btn btn-block btn-warning"><i class="fa fa-ban"></i> Annulla</asp:LinkButton>
</div>
</div>
</div>
<div style="font-size: 0.8em; background-color: #EFEFEF;">
<div runat="server" id="divTempi" style="clear: both;">
<asp:GridView ID="grViewTempi" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="IdxODL" DataSourceID="odsTempi" ForeColor="Black" GridLines="None" OnSelectedIndexChanged="grViewTempi_SelectedIndexChanged" Width="100%">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
<EmptyDataRowStyle BackColor="Tan" Font-Bold="True" />
<EmptyDataTemplate>
Nessun record storico trovato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False">
<HeaderTemplate>
<asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click"><i class="fa fa-refresh fa-2x"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Selezione"><i class="fa fa-arrow-circle-right fa-2x"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CommessaAs400" HeaderText="CommessaAs400" SortExpression="CommessaAs400" />
<asp:BoundField DataField="IdxODL" HeaderText="IdxODL" InsertVisible="False" ReadOnly="True" SortExpression="IdxODL" />
<asp:BoundField DataField="NumPezzi" HeaderText="NumPezzi" SortExpression="NumPezzi" />
<asp:TemplateField HeaderText="TCAssegnato" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("TCAssegnato", "{0:N2}") %>' />
<div style="color: #696969; font-size: 0.7em;">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("TCRichAttr", "{0:N2} (attr.)") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PzPallet" HeaderText="PzPallet" SortExpression="PzPallet" />
<asp:TemplateField HeaderText="Note" SortExpression="Note">
<ItemTemplate>
<asp:Label ID="lblNote" runat="server" Text='<%# Eval("Note") %>' />
<div style="color: #696969; font-size: 0.7em;">
<asp:Label ID="lblCodArticolo" runat="server" Text='<%# Eval("CodArticolo","({0})") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataInizio" SortExpression="DataInizio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("DataInizio","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataFine" SortExpression="DataFine" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("DataFine","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsTempi" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByMacchinaArticolo" TypeName="MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="ddlMacchine" DefaultValue="0" Name="IdxMacchina" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ddlArticolo" DefaultValue="0" Name="CodArticolo" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
@@ -0,0 +1,308 @@
using MapoDb;
using SteamWare;
using System;
using System.Web.UI;
namespace ES3.WebUserControls
{
public partial class mod_newPromessaODL : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
setDefaults();
}
}
/// <summary>
/// Testo conferma salvataggio (create/Edit)
/// </summary>
public string testoConf
{
get
{
string answ = "Crea Promessa ODL";
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
answ = "Edit Promessa ODL";
}
return answ;
}
}
public void doSelPODL()
{
// se ho una promessa da clonare copio dati da quella...
int idxProm = 0;
try
{
if (memLayer.ML.isInSessionObject("idxProm2Clone"))
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Clone");
}
else if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
}
// provo a selezionare
var tPODL = DataLayer.obj.taPODL.getByKey(idxProm);
if (tPODL.Rows.Count > 0)
{
var rPODL = tPODL[0];
txtSearch.Text = rPODL.CodArticolo;
ddlArticolo.DataBind();
ddlArticolo.SelectedValue = rPODL.CodArticolo;
ddlGruppi.DataBind();
ddlGruppi.SelectedValue = rPODL.CodGruppo;
txtNumPz.Text = rPODL.NumPezzi.ToString();
txtPzPallet.Text = rPODL.PzPallet.ToString();
txtPrio.Text = rPODL.Priorita.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rPODL.TCAssegnato);
}
else
{
txtTCmc.Text = rPODL.TCAssegnato.ToString("N3");
}
ddlMacchine.SelectedValue = rPODL.IdxMacchina;
txtKeyExt.Text = rPODL.KeyRichiesta;
// svuoto se ci fosse cloning......
memLayer.ML.emptySessionVal("idxProm2Clone");
}
}
catch
{ }
}
private void setDefaults()
{
// se abilitato in config inserisce i valori defaults x insert...
if (memLayer.ML.cdvb("resetDefaultPromessaOdl"))
{
txtNumPz.Text = "1";
txtPzPallet.Text = "1";
txtPrio.Text = "1";
// in base ad impostazione mostro TC come min:sec o min.cent
divTCms.Visible = false;
divTCmc.Visible = false;
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
divTCms.Visible = true;
txtTCms.Text = "1:00";
}
else
{
divTCmc.Visible = true;
txtTCmc.Text = "1.00";
}
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
}
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
ddlArticolo.DataBind();
}
#region gestione eventi
public event EventHandler eh_nuovoValore;
#endregion
/// <summary>
/// conferma inserimento TC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
// controllo se ho tutti i valori ok...
string CodArticolo = "";
string Gruppo = "";
string IdxMacchina = "";
string KeyReq = "";
int numPezzi = 0;
int pzPallet = 1;
decimal TCiclo = 0;
bool attiv = false;
int prio = 0;
try
{
CodArticolo = ddlArticolo.SelectedValue;
Gruppo = ddlGruppi.SelectedValue;
IdxMacchina = ddlMacchine.SelectedValue;
KeyReq = txtKeyExt.Text.Trim();
//IdxMacchina = txtMacchina.Text.Trim();
// se IdxMacchina è vuoto metto null...
if (IdxMacchina == "")
{
IdxMacchina = "0";
}
numPezzi = Convert.ToInt32(txtNumPz.Text.Trim());
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
string[] sTC = txtTCms.Text.Trim().Split(':');
int numMin = 0;
int numSec = 0;
int.TryParse(sTC[0], out numMin);
int.TryParse(sTC[1], out numSec);
TCiclo = numMin + ((decimal)numSec) / 60;
}
else
{
decimal.TryParse(txtTCmc.Text.Replace(".", ","), out TCiclo);
}
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
attiv = chkAttiv.Checked;
int.TryParse(txtPrio.Text, out prio);
// controllo se sono in modalità EDIT faccio un update, altrimenti faccio un INSERT...
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
int idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
DataLayer.obj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm);
memLayer.ML.emptySessionVal("idxProm2Edit");
}
else
{
// 2018.09.25 --> inserisco PROMESSA ODL
//MapoDb.DataLayer.obj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
DataLayer.obj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, "");
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire la PromessaODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8}{9}{10}", KeyReq, attiv, CodArticolo, IdxMacchina, numPezzi, TCiclo, prio, pzPallet, memLayer.ML.IntSessionObj("idxProm2Edit"), Environment.NewLine, exc), tipoLog.EXCEPTION);
memLayer.ML.emptySessionVal("idxProm2Edit");
}
// segnalo update
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// annullamento inserimento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// aggiorno label min e centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempoCiclo_TextChanged(object sender, EventArgs e)
{
#if false
string text = "";
string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ",");
int min = 0;
int sec = 0;
try
{
// cerco di convertire in min/sec
min = Convert.ToInt32(Math.Floor(Convert.ToDouble(txtMinCent)));
sec = Convert.ToInt32((Convert.ToDouble(txtMinCent) - min) * 60);
text = string.Format("{0}:{1:00}", min, sec);
}
catch
{ }
lblMinSec.Text = text;
#endif
}
/// <summary>
/// selezione articolo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// mostro elenco ultimi 5 tempi e note...
/// </summary>
private void showLastTimeAndNote()
{
// update tempi ciclo!
grViewTempi.DataBind();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlGruppi_SelectedIndexChanged(object sender, EventArgs e)
{
ddlMacchine.DataBind();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grViewTempi.SelectedIndex = -1;
grViewTempi.DataBind();
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grViewTempi.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
// precompilo dati pezzi/tempi
txtNumPz.Text = rigaOdl.NumPezzi.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rigaOdl.TCAssegnato);
}
else
{
txtTCmc.Text = rigaOdl.TCAssegnato.ToString("N3");
}
txtPzPallet.Text = rigaOdl.PzPallet.ToString();
}
}
}
+204
View File
@@ -0,0 +1,204 @@
//------------------------------------------------------------------------------
// <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 ES3.WebUserControls {
public partial class mod_newPromessaODL {
/// <summary>
/// Controllo txtSearch.
/// </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.TextBox txtSearch;
/// <summary>
/// Controllo ddlArticolo.
/// </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.DropDownList ddlArticolo;
/// <summary>
/// Controllo odsArticoli.
/// </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 odsArticoli;
/// <summary>
/// Controllo ddlGruppi.
/// </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.DropDownList ddlGruppi;
/// <summary>
/// Controllo odsGruppi.
/// </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 odsGruppi;
/// <summary>
/// Controllo ddlMacchine.
/// </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.DropDownList ddlMacchine;
/// <summary>
/// Controllo odsMacchine.
/// </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 odsMacchine;
/// <summary>
/// Controllo txtNumPz.
/// </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.TextBox txtNumPz;
/// <summary>
/// Controllo divTCms.
/// </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 divTCms;
/// <summary>
/// Controllo txtTCms.
/// </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.TextBox txtTCms;
/// <summary>
/// Controllo divTCmc.
/// </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 divTCmc;
/// <summary>
/// Controllo txtTCmc.
/// </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.TextBox txtTCmc;
/// <summary>
/// Controllo txtKeyExt.
/// </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.TextBox txtKeyExt;
/// <summary>
/// Controllo txtPrio.
/// </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.TextBox txtPrio;
/// <summary>
/// Controllo chkAttiv.
/// </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.CheckBox chkAttiv;
/// <summary>
/// Controllo txtPzPallet.
/// </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.TextBox txtPzPallet;
/// <summary>
/// Controllo lbtOk.
/// </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 lbtOk;
/// <summary>
/// Controllo lbtCancel.
/// </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 lbtCancel;
/// <summary>
/// Controllo divTempi.
/// </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 divTempi;
/// <summary>
/// Controllo grViewTempi.
/// </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 grViewTempi;
/// <summary>
/// Controllo odsTempi.
/// </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 odsTempi;
}
}
+171
View File
@@ -0,0 +1,171 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_planCreate.ascx.cs" Inherits="ES3.WebUserControls.mod_planCreate" %>
<div class="row">
<div class="col-sm-12">
<div class="card-deck">
<asp:HiddenField runat="server" ID="hfCodGruppo" />
<asp:HiddenField runat="server" ID="hfIdxMacchina" />
<asp:HiddenField runat="server" ID="hfCodArticolo" />
<div class="card">
<div class="card-header bg-primary text-light">
<div class="d-flex justify-content-between">
<div class="p-0 align-self-center">
<h5>Richieste aperte</h5>
</div>
<div class="p-0" style="font-size: 1.6em;">
<div class="d-flex justify-content-between">
<div class="py-0 px-2">
<div class="d-flex justify-content-between">
<div class="py-0 px-2">Tot PEZZI (num)</div>
<div class="py-0 px-2 font-weight-bold">
<asp:Label runat="server" ID="lblNumPzTot" />
<asp:HiddenField runat="server" ID="hfNumPzTot" />
</div>
</div>
</div>
<div class="py-0 px-2">
<div class="d-flex justify-content-between">
<div class="py-0 px-2">Tot Tempo (ore)</div>
<div class="py-0 px-2 font-weight-bold">
<asp:Label runat="server" ID="lblOreTot" />
</div>
</div>
</div>
</div>
</div>
<div class="p-0 align-self-center">
<asp:LinkButton runat="server" ID="lbtToggle" OnClick="lbtToggle_Click" CssClass="btn btn-light"><i class="fa fa-chevron-up" aria-hidden="true" runat="server" id="tgIcon"></i></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-1" runat="server" id="divDetail">
<div class="row">
<div class="col-9">
<asp:GridView runat="server" ID="grView" AutoGenerateColumns="False" DataSourceID="odsPromIN" CssClass="table table-striped table-sm my-0" PageSize="5" AllowPaging="True" AllowSorting="True" DataKeyNames="idxPromessa">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle CssClass="table-success" />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="btnSelAll" runat="server" Checked="false" ToolTip='<%# traduci("btnSelAll") %>'
OnCheckedChanged="btnSelAll_Click" CssClass="btn btn-default btn-sm" AutoPostBack="true"></asp:CheckBox>
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" CssClass="btn btn-default btn-sm" runat="server" OnCheckedChanged="chkSelect_CheckedChanged" AutoPostBack="true" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="KeyRichiesta" SortExpression="KeyRichiesta">
<ItemTemplate>
<div class="row">
<div class="col-12 font-weight-bold">
<asp:Label ID="lblKeyRichiesta" runat="server" Text='<%# Eval("KeyRichiesta") %>'></asp:Label>
</div>
<div class="col-12 small">
<asp:Label ID="lblIdxPromessa" runat="server" Text='<%# Eval("idxPromessa") %>'></asp:Label>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DescrGruppo" HeaderText="Gruppo" SortExpression="DescrGruppo" ItemStyle-CssClass="text-nowrap">
<ItemStyle CssClass="text-nowrap"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="DescrMacc" HeaderText="Macchina" SortExpression="DescrMacc" />
<asp:TemplateField HeaderText="Disegno" SortExpression="Disegno">
<ItemTemplate>
<div class="row">
<div class="col-6 font-weight-bold">
<asp:Label ID="lblDisegno" runat="server" Text='<%# Eval("Disegno") %>'></asp:Label>
</div>
<div class="col-6 text-right">
cod.
<asp:Label ID="lblCodArticolo" runat="server" Text='<%# Eval("CodArticolo") %>'></asp:Label>
</div>
<div class="col-12 small">
<asp:Label ID="lblDescArticolo" runat="server" Text='<%# Eval("DescArticolo") %>'></asp:Label>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:CheckBoxField DataField="Attivabile" HeaderText="Attivabile" SortExpression="Attivabile" />
<asp:TemplateField HeaderText="NumPezzi" SortExpression="NumPezzi">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtNumPezzi" Text='<%# Eval("NumPezzi") %>' CssClass="text-right" TextMode="Number" Width="4em" AutoPostBack="true" OnTextChanged="txtNumPezzi_TextChanged" />
<asp:Label ID="lblNumPezzi" runat="server" Text='<%# Eval("NumPezzi", "{0:N0}") %>' />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Right" />
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField DataField="TCAssegnato" HeaderText="TCAssegnato" SortExpression="TCAssegnato" DataFormatString="{0:N3}" ItemStyle-HorizontalAlign="Right">
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:BoundField>
<asp:TemplateField HeaderText="DueDate" SortExpression="DueDate">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("DueDate") %>' CssClass='<%# cssDueDate(Eval("DueDate")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Priorita" HeaderText="Priorita" SortExpression="Priorita" />
<asp:BoundField DataField="PzPallet" HeaderText="PzPallet" SortExpression="PzPallet" />
<asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />
<asp:TemplateField HeaderText="TC50p" SortExpression="TC50p">
<ItemTemplate>
<asp:Label ID="lblTC50p" runat="server" Text='<%# Eval("TC50p", "{0:N3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="TotMinuti" SortExpression="TotMinuti" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblTotMinuti" runat="server" Text='<%# Eval("TotMinuti","{0:N2}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="odsPromIN" OldValuesParameterFormatString="original_{0}" SelectMethod="getFilt" TypeName="MapoDb.DS_PlanTableAdapters.RichiesteTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hfCodGruppo" DefaultValue="*" Name="CodGruppo" PropertyName="Value" Type="String" />
<asp:ControlParameter ControlID="hfCodArticolo" DefaultValue="*" Name="CodArticolo" PropertyName="Value" Type="String" />
<asp:ControlParameter ControlID="hfIdxMacchina" DefaultValue="*" Name="IdxMacchina" PropertyName="Value" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="col-3 pl-0">
<div runat="server" id="divConfirm" class="p-1 border border-success table-success my-1">
<asp:LinkButton runat="server" ID="lbtDoPlan" CssClass="btn btn-success btn-block" OnClick="lbtDoPlan_Click" OnClientClick="return confirm('Sei sciuro di voler confermare senza modifica le richieste selezionate?');">
<i class="fa fa-thumbs-up" aria-hidden="true"></i> APPROVA e PIANIFICA <i class="fa fa-thumbs-up" aria-hidden="true"></i>
<div class="small">
approvazione e pianificazione richieste selezionate
</div>
</asp:LinkButton>
</div>
<div runat="server" id="divCreaGrp" class="p-1 border border-primary table-primary">
<div>
Macchina
<asp:DropDownList runat="server" ID="ddlMacc" CssClass="btn btn-sm btn-light btn-block" DataSourceID="odsMac" DataTextField="Descrizione" DataValueField="IdxMacchina"></asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsMac" OldValuesParameterFormatString="original_{0}" SelectMethod="getByCodGruppo" TypeName="MapoDb.DS_applicazioneTableAdapters.MacchineTableAdapter" FilterExpression="NOT (IdxMacchina LIKE '%#%')">
<SelectParameters>
<asp:ControlParameter ControlID="hfCodGruppo" DefaultValue="*" Name="CodGruppo" PropertyName="Value" Type="String" />
<asp:Parameter DefaultValue="true" Name="AddND" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<asp:LinkButton runat="server" ID="lbtCreaGrp" CssClass="btn btn-primary btn-block py-1 my-1" OnClick="lbtCreaGrp_Click" OnClientClick="return confirm('Sei sciuro di voler raggruppare in un nuovo PODL le richieste selezionate?');">
<i class="fa fa-object-group" aria-hidden="true"></i> RAGGRUPPA SELEZIONATE <i class="fa fa-object-group" aria-hidden="true"></i>
<div class="small">
Creazione nuovo ordine raggruppato dalle richieste e quantità selezionate
</div>
</asp:LinkButton>
</div>
<div runat="server" id="divSplitOdl" class="my-1">
<%--<asp:LinkButton runat="server" ID="lbtSplit" CssClass="btn btn-warning btn-block">SPLIT RICHIESTA <i class="fa fa-cut" aria-hidden="true"></i></asp:LinkButton>
...con split deve chiedere NUM PEZZI e va a creare promessa splittata approvata (lasciando il rimanente "a monte" da approvare e/o splittare...--%>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+313
View File
@@ -0,0 +1,313 @@
using MapoDb;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ES3.WebUserControls
{
public partial class mod_planCreate : SteamWare.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// di default NASCONDE...
//toggleVisibility();
calcTotali();
}
}
public string CodGruppo
{
get
{
return hfCodGruppo.Value;
}
set
{
hfCodGruppo.Value = value;
}
}
public string CodArticolo
{
get
{
return hfCodArticolo.Value;
}
set
{
hfCodArticolo.Value = value;
}
}
public string IdxMacchina
{
get
{
return hfIdxMacchina.Value;
}
set
{
hfIdxMacchina.Value = value;
}
}
public void doUpdate()
{
grView.DataBind();
calcTotali();
}
/// <summary>
/// seleziona/deseleziona le righe indicate...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSelAll_Click(object sender, EventArgs e)
{
// seleziono tutti i valori visibili nel datagrid
CheckBox chkbox = ((CheckBox)sender);
bool isChecked = chkbox.Checked;
if (!isChecked)
{
chkbox.ToolTip = traduci("btnSelAll");
}
else
{
chkbox.ToolTip = traduci("btnDeselAll");
}
foreach (GridViewRow riga in grView.Rows)
{
((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked;
}
calcTotali();
}
/// <summary>
/// comando reset
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtReset_Click(object sender, EventArgs e)
{
doReset();
}
private void doReset()
{
grView.SelectedIndex = -1;
grView.DataBind();
raiseEvent(SteamWare.ucEvType.Reset);
}
protected void lbtToggle_Click(object sender, EventArgs e)
{
toggleVisibility();
}
private void toggleVisibility()
{
divDetail.Visible = !divDetail.Visible;
tgIcon.Attributes["class"] = divDetail.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down";
}
protected void chkSelect_CheckedChanged(object sender, EventArgs e)
{
calcTotali();
}
private void calcTotali()
{
// update valori calcolati in base a selezione...
int numOrd = 0;
int numPzOrd = 0;
decimal tempoMinOrd = 0;
decimal tc50p = 0;
int numPzTot = 0;
decimal tempoMinTot = 0;
Dictionary<string, int> ElArticoli = new Dictionary<string, int>();
string CodArt = "";
foreach (GridViewRow riga in grView.Rows)
{
numPzOrd = 0;
tempoMinOrd = 0;
DateTime DataRif = DateTime.Now.Date;
if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
{
try
{
int.TryParse(((TextBox)riga.FindControl("txtNumPezzi")).Text, out numPzOrd);
decimal.TryParse(((Label)riga.FindControl("lblTC50p")).Text, out tc50p);
tempoMinOrd = tc50p * numPzOrd;
CodArt = ((Label)riga.FindControl("lblCodArticolo")).Text;
if (numPzOrd > 0) numOrd++;
// salvo dictionary articoli...
if (ElArticoli.ContainsKey(CodArt))
{
ElArticoli[CodArt]++;
}
else
{
ElArticoli[CodArt] = 1;
}
}
catch
{ }
numPzTot += numPzOrd;
tempoMinTot += tempoMinOrd;
}
}
//lblNumPzTot.Text = $"{numPzTot:N0}";
numPzCalc = numPzTot;
lblOreTot.Text = $"{tempoMinTot / 60:N2}";
// controllo SE abilitare il crea gruppo o split...
divSplitOdl.Visible = numOrd == 1;
divConfirm.Visible = numOrd > 0;
divCreaGrp.Visible = (numOrd > 1) && (ElArticoli.Count == 1) && CodGruppo != "";
ddlMacc.DataBind();
}
/// <summary>
/// Num pz totali calcolati
/// </summary>
protected int numPzCalc
{
get
{
int answ = 0;
int.TryParse(hfNumPzTot.Value, out answ);
return answ;
}
set
{
lblNumPzTot.Text = $"{value:N0}";
hfNumPzTot.Value = value.ToString();
}
}
/// <summary>
/// Approva e pianifica richeiste...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtDoPlan_Click(object sender, EventArgs e)
{
int IdxPromessa = 0;
foreach (GridViewRow riga in grView.Rows)
{
DateTime DataRif = DateTime.Now.Date;
if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
{
try
{
int.TryParse(((Label)riga.FindControl("lblIdxPromessa")).Text, out IdxPromessa);
// approvo la promessa COPIANDOLA
DataLayer.obj.taPlanRichieste.approvaRich(IdxPromessa, SteamWare.user_std.UtSn.utente);
}
catch
{ }
}
}
// update!
reportUpdate();
}
private void reportUpdate()
{
// aggiorno grView...
grView.SelectedIndex = -1;
grView.DataBind();
// segnalo update
raiseEvent(SteamWare.ucEvType.ReqUpdateParent);
}
/// <summary>
/// Chiama stored per creare NUOVO PODL, chiudere i selezionati, registrare associazione,...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtCreaGrp_Click(object sender, EventArgs e)
{
int IdxPromessa = 0;
int IdxPromessaOUT = 0;
int QtyEv = 0;
if (numPzCalc > 0)
{
// in primis CREA la richiesta raggruppata
foreach (GridViewRow riga in grView.Rows)
{
DateTime DataRif = DateTime.Now.Date;
if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
{
try
{
int.TryParse(((Label)riga.FindControl("lblIdxPromessa")).Text, out IdxPromessa);
break;
}
catch
{ }
}
}
var resultIdxOut = DataLayer.obj.taPlanRichieste.creaGrp(IdxPromessa, SteamWare.user_std.UtSn.utente, ddlMacc.SelectedValue, CodGruppo, numPzCalc);
// se ho trovato una promessaOUT...
int.TryParse(resultIdxOut.ToString(), out IdxPromessaOUT);
if (IdxPromessaOUT > 0)
{
// poi alloca tutte le istanze alla richiesta....
foreach (GridViewRow riga in grView.Rows)
{
DateTime DataRif = DateTime.Now.Date;
if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
{
try
{
int.TryParse(((Label)riga.FindControl("lblIdxPromessa")).Text, out IdxPromessa);
int.TryParse(((TextBox)riga.FindControl("txtNumPezzi")).Text, out QtyEv);
// approvo la promessa COPIANDOLA
DataLayer.obj.taPlanRichieste.allocaIst(IdxPromessa, IdxPromessaOUT, QtyEv, SteamWare.user_std.UtSn.utente, "GRP");
}
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in CreaGrp:{Environment.NewLine}{exc}", tipoLog.EXCEPTION);
}
}
}
}
}
// update!
reportUpdate();
}
protected void txtNumPezzi_TextChanged(object sender, EventArgs e)
{
calcTotali();
}
/// <summary>
/// cambia il colore del campo secondo la due date indicata
/// rosso: in ritardo (scaduta)
/// verde: > 2 week
/// giallo: altrimenti
/// </summary>
/// <param name="dueDate"></param>
/// <returns></returns>
public string cssDueDate(object dueDate)
{
DateTime oggi = DateTime.Today;
DateTime dataRif = oggi.AddDays(-1);
DateTime.TryParse(dueDate.ToString(), out dataRif);
string answ = "text-secondary";
if (dataRif < oggi)
{
answ = "text-danger";
}
else if (dataRif < oggi.AddDays(14))
{
answ = "text-warning";
}
else
{
answ = "text-success";
}
return answ;
}
}
}
+177
View File
@@ -0,0 +1,177 @@
//------------------------------------------------------------------------------
// <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 ES3.WebUserControls {
public partial class mod_planCreate {
/// <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 hfIdxMacchina.
/// </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 hfIdxMacchina;
/// <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;
/// <summary>
/// Controllo lblNumPzTot.
/// </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 lblNumPzTot;
/// <summary>
/// Controllo hfNumPzTot.
/// </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 hfNumPzTot;
/// <summary>
/// Controllo lblOreTot.
/// </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 lblOreTot;
/// <summary>
/// Controllo lbtToggle.
/// </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 lbtToggle;
/// <summary>
/// Controllo tgIcon.
/// </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 tgIcon;
/// <summary>
/// Controllo divDetail.
/// </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 divDetail;
/// <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 odsPromIN.
/// </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 odsPromIN;
/// <summary>
/// Controllo divConfirm.
/// </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 divConfirm;
/// <summary>
/// Controllo lbtDoPlan.
/// </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 lbtDoPlan;
/// <summary>
/// Controllo divCreaGrp.
/// </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 divCreaGrp;
/// <summary>
/// Controllo ddlMacc.
/// </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.DropDownList ddlMacc;
/// <summary>
/// Controllo odsMac.
/// </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 odsMac;
/// <summary>
/// Controllo lbtCreaGrp.
/// </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 lbtCreaGrp;
/// <summary>
/// Controllo divSplitOdl.
/// </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 divSplitOdl;
}
}
+199
View File
@@ -0,0 +1,199 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_planStats.ascx.cs" Inherits="ES3.WebUserControls.mod_planStats" %>
<%@ Register Src="~/WebUserControls/mod_ricercaGenerica.ascx" TagPrefix="uc1" TagName="mod_ricercaGenerica" %>
<%@ Register Src="~/WebUserControls/cmp_numRow.ascx" TagPrefix="uc1" TagName="cmp_numRow" %>
<div class="row">
<div class="col-12">
<div class="card mx-0">
<div class="card-header bg-dark text-light">
<div class="d-flex justify-content-between">
<div class="p-0 align-self-center">
<h5>Stato richieste</h5>
</div>
<div class="p-0" style="font-size: 1.6em;">
<asp:FormView runat="server" ID="fvGlobal" DataSourceID="odsStGlb" Width="100%">
<ItemTemplate>
<div class="d-flex justify-content-between">
<div class="py-0 px-2">
<div class="d-flex justify-content-between">
<div class="py-0 px-2">Num Richieste</div>
<div class="py-0 px-2 font-weight-bold">
<asp:Label runat="server" ID="lblNumRows" Text='<%# Eval("NumRows") %>' />
</div>
</div>
</div>
<div class="py-0 px-2">
<div class="d-flex justify-content-between">
<div class="py-0 px-2">Gruppi</div>
<div class="py-0 px-2 font-weight-bold">
<asp:Label runat="server" ID="lblNumGrp" Text='<%# Eval("NumGrp") %>' />
</div>
</div>
</div>
<div class="py-0 px-2">
<div class="d-flex justify-content-between">
<div class="py-0 px-2">Macchine</div>
<div class="py-0 px-2 font-weight-bold">
<asp:Label runat="server" ID="lblNumMacc" Text='<%# Eval("NumMacc") %>' />
</div>
</div>
</div>
<div class="py-0 px-2">
<div class="d-flex justify-content-between text-danger">
<div class="py-0 px-2">Richieste</div>
<div class="py-0 px-2 font-weight-bold">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("TotOreRich","{0:N2} h") %>' />
</div>
</div>
</div>
<div class="py-0 px-2">
<div class="d-flex justify-content-between text-success">
<div class="py-0 px-2">Pianificate</div>
<div class="py-0 px-2 font-weight-bold">
<asp:Label runat="server" ID="Label2" Text='<%# Eval("TotOrePlan","{0:N2} h") %>' />
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:FormView>
<asp:ObjectDataSource runat="server" ID="odsStGlb" OldValuesParameterFormatString="original_{0}" SelectMethod="getFilt" TypeName="MapoDb.DS_PlanTableAdapters.planStatsGlobalTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="gvParetoGrp" DefaultValue="*" Name="CodGruppo" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="gvParetoArt" DefaultValue="*" Name="CodArticolo" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="gvParetoMac" DefaultValue="*" Name="IdxMacchina" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="p-0 align-self-center">
<asp:LinkButton runat="server" ID="lbtToggle" OnClick="lbtToggle_Click" CssClass="btn btn-light"><i class="fa fa-chevron-up" aria-hidden="true" runat="server" id="tgIcon"></i></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-1 bg-secondary" runat="server" id="divDetail">
<div class="card-deck">
<asp:HiddenField runat="server" ID="hlCodIstTemp" />
<div class="card mr-0">
<div class="card-header bg-dark text-light">
<h4>Reparti/Fasi</h4>
</div>
<div class="card-body p-1">
<asp:GridView runat="server" ID="gvParetoGrp" AutoGenerateColumns="False" DataSourceID="odsStGrp" CssClass="table table-striped table-sm my-0" PageSize="10" AllowPaging="True" AllowSorting="True" DataKeyNames="CodGruppo" OnSelectedIndexChanged="gvParetoGrp_SelectedIndexChanged">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle CssClass="table-info" />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="lbtResetGrp" runat="server" OnClick="lbtResetGrp_Click" CssClass="btn btn-info btn-sm" Visible="true" ToolTip='<%# traduci("Reset") %>'><i class="fa fa-refresh"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbSelectGrp" CausesValidation="false" CssClass="btn btn-secondary btn-sm" CommandName="Select" ToolTip='<%# traduci("Select") %>'><i class="fa fa-search"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DescrGruppo" HeaderText="Gruppo" SortExpression="DescrGruppo" />
<asp:BoundField DataField="TotQty" HeaderText="Tot Qty" SortExpression="TotQty" DataFormatString="{0:N0}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
<asp:BoundField DataField="TotOreRich" HeaderText="Ore Rich" ReadOnly="True" SortExpression="TotOreRich" DataFormatString="{0:N2}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
<asp:BoundField DataField="TotOrePlan" HeaderText="Ore Plan" ReadOnly="True" SortExpression="TotOrePlan" DataFormatString="{0:N2}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="odsStGrp" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_PlanTableAdapters.planStatsGroupTableAdapter"></asp:ObjectDataSource>
</div>
<div class="card-footer py-0 px-2 text-right">
<uc1:cmp_numRow runat="server" ID="cmp_numRowReparti" />
</div>
</div>
<div class="card mx-1">
<div class="card-header bg-secondary text-light">
<h4>Macchine</h4>
</div>
<div class="card-body p-1">
<asp:GridView runat="server" ID="gvParetoMac" AutoGenerateColumns="False" DataSourceID="odsStMac" CssClass="table table-striped table-sm my-0" PageSize="10" AllowPaging="True" AllowSorting="True" DataKeyNames="IdxMacchina" OnSelectedIndexChanged="gvParetoMac_SelectedIndexChanged">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle CssClass="table-primary" />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="lbtResetMac" runat="server" OnClick="lbtResetMac_Click" CssClass="btn btn-primary btn-sm" Visible="true" ToolTip='<%# traduci("Reset") %>'><i class="fa fa-refresh"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbSelectArt" CausesValidation="false" CssClass="btn btn-secondary btn-sm" CommandName="Select" ToolTip='<%# traduci("Select") %>'><i class="fa fa-search"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DescrMacc" HeaderText="Macchina" SortExpression="DescrMacc" />
<asp:BoundField DataField="TotQty" HeaderText="Tot Qty" SortExpression="TotQty" DataFormatString="{0:N0}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
<asp:BoundField DataField="TotOreRich" HeaderText="Ore Rich" ReadOnly="True" SortExpression="TotOreRich" DataFormatString="{0:N2}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
<asp:BoundField DataField="TotOrePlan" HeaderText="Ore Plan" ReadOnly="True" SortExpression="TotOrePlan" DataFormatString="{0:N2}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="odsStMac" OldValuesParameterFormatString="original_{0}" SelectMethod="getFilt" TypeName="MapoDb.DS_PlanTableAdapters.planStatsMaccTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="gvParetoGrp" DefaultValue="*" Name="CodGruppo" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="card-footer py-0 px-2 text-right">
<uc1:cmp_numRow runat="server" ID="cmp_numRowMacc" />
</div>
</div>
<div class="card ml-0">
<div class="card-header bg-secondary text-light">
<div class="row">
<div class="col-4">
<h4>Articoli</h4>
</div>
<div class="col-8">
<uc1:mod_ricercaGenerica runat="server" ID="mod_ricercaGenerica" />
</div>
</div>
</div>
<div class="card-body p-1">
<asp:GridView runat="server" ID="gvParetoArt" AutoGenerateColumns="False" DataSourceID="odsStArt" CssClass="table table-striped table-sm my-0" PageSize="5" AllowPaging="True" AllowSorting="True" DataKeyNames="CodArticolo" OnSelectedIndexChanged="gvParetoArt_SelectedIndexChanged">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle CssClass="table-primary" />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="lbtResetArt" runat="server" OnClick="lbtResetArt_Click" CssClass="btn btn-primary btn-sm" Visible="true" ToolTip='<%# traduci("Reset") %>'><i class="fa fa-refresh"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbSelectArt" CausesValidation="false" CssClass="btn btn-secondary btn-sm" CommandName="Select" ToolTip='<%# traduci("Select") %>'><i class="fa fa-search"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Articolo" SortExpression="Disegno">
<ItemTemplate>
<asp:Label ID="lblDisegno" runat="server" Text='<%# Eval("Disegno") %>'></asp:Label>
<div class="small text-truncate">
<asp:Label ID="lblDescArticolo" runat="server" Text='<%# Eval("DescArticolo") %>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="TotQty" HeaderText="Tot Qty" SortExpression="TotQty" DataFormatString="{0:N0}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
<asp:BoundField DataField="TotOreRich" HeaderText="Ore Rich" ReadOnly="True" SortExpression="TotOreRich" DataFormatString="{0:N2}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
<asp:BoundField DataField="TotOrePlan" HeaderText="Ore Plan" ReadOnly="True" SortExpression="TotOrePlan" DataFormatString="{0:N2}" HeaderStyle-CssClass="text-right" ItemStyle-CssClass="text-right" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="odsStArt" OldValuesParameterFormatString="original_{0}" SelectMethod="getFilt" TypeName="MapoDb.DS_PlanTableAdapters.planStatsArtTableAdapter" FilterExpression=" Disegno LIKE '%{0}%' OR DescArticolo LIKE '%{0}%' ">
<SelectParameters>
<asp:ControlParameter ControlID="gvParetoGrp" DefaultValue="*" Name="CodGruppo" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
</asp:ObjectDataSource>
</div>
<div class="card-footer py-0 px-2 text-right">
<uc1:cmp_numRow runat="server" ID="cmp_numRowArt" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+202
View File
@@ -0,0 +1,202 @@
using MapoSDK;
using SteamWare;
using System;
namespace ES3.WebUserControls
{
public partial class mod_planStats : SteamWare.UserControl
{
public event EventHandler eh_selVal;
public event EventHandler eh_reset;
/// <summary>
/// innalzo evento in base al tipo richiesto
/// </summary>
protected void raiseEvent(tipoEvento evReq)
{
switch (evReq)
{
case tipoEvento.reset:
// raise dell'evento
if (eh_reset != null)
{
eh_reset(this, new EventArgs());
}
break;
case tipoEvento.selection:
// raise dell'evento
if (eh_selVal != null)
{
eh_selVal(this, new EventArgs());
}
break;
case tipoEvento.edit:
case tipoEvento.delete:
default:
break;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
cmp_numRowReparti.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
cmp_numRowMacc.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
cmp_numRowArt.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
// sistemo i DataGrid...
gvParetoGrp.PageSize = cmp_numRowReparti.numRowPag;
gvParetoMac.PageSize = cmp_numRowMacc.numRowPag;
gvParetoArt.PageSize = cmp_numRowArt.numRowPag;
}
cmp_numRowArt.eh_newNum += Cmp_numRowArt_eh_newNum;
cmp_numRowMacc.eh_newNum += Cmp_numRowMacc_eh_newNum;
cmp_numRowReparti.eh_newNum += Cmp_numRowReparti_eh_newNum;
}
private void Cmp_numRowReparti_eh_newNum(object sender, EventArgs e)
{
gvParetoGrp.PageSize = cmp_numRowReparti.numRowPag;
}
private void Cmp_numRowMacc_eh_newNum(object sender, EventArgs e)
{
gvParetoMac.PageSize = cmp_numRowMacc.numRowPag;
}
private void Cmp_numRowArt_eh_newNum(object sender, EventArgs e)
{
gvParetoArt.PageSize = cmp_numRowArt.numRowPag;
}
protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e)
{
#if false
// salvo in sessione selezione...
memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue);
#endif
}
/// <summary>
/// Reset controllo
/// </summary>
public void doReset()
{
doResetGrp();
doResetMac();
doResetArt();
}
/// <summary>
/// comando reset
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtResetGrp_Click(object sender, EventArgs e)
{
doResetGrp();
doResetMac();
doResetArt();
}
/// <summary>
/// comando reset
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtResetArt_Click(object sender, EventArgs e)
{
doResetArt();
}
/// <summary>
/// comando reset
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtResetMac_Click(object sender, EventArgs e)
{
doResetMac();
}
private void doResetGrp()
{
gvParetoGrp.SelectedIndex = -1;
gvParetoGrp.DataBind();
raiseEvent(tipoEvento.reset);
}
private void doResetMac()
{
gvParetoMac.SelectedIndex = -1;
gvParetoMac.DataBind();
raiseEvent(tipoEvento.reset);
}
private void doResetArt()
{
gvParetoArt.SelectedIndex = -1;
gvParetoArt.DataBind();
raiseEvent(tipoEvento.reset);
}
protected void gvParetoGrp_SelectedIndexChanged(object sender, EventArgs e)
{
doResetArt();
}
protected void gvParetoMac_SelectedIndexChanged(object sender, EventArgs e)
{
raiseEvent(tipoEvento.selection);
}
protected void gvParetoArt_SelectedIndexChanged(object sender, EventArgs e)
{
raiseEvent(tipoEvento.selection);
}
/// <summary>
/// CodArticoloo selezionato in GridView
/// </summary>
public string CodArticolo
{
get
{
string answ = "";
try
{
answ = gvParetoArt.SelectedValue.ToString();
}
catch { }
return answ;
}
}
/// <summary>
/// CodGruppo selezionato in GridView
/// </summary>
public string CodGruppo
{
get
{
string answ = "";
try
{
answ = gvParetoGrp.SelectedValue.ToString();
}
catch { }
return answ;
}
}
/// <summary>
/// IdxMacchina selezionato in GridView
/// </summary>
public string IdxMacchina
{
get
{
string answ = "";
try
{
answ = gvParetoMac.SelectedValue.ToString();
}
catch { }
return answ;
}
}
protected void lbtToggle_Click(object sender, EventArgs e)
{
divDetail.Visible = !divDetail.Visible;
tgIcon.Attributes["class"] = divDetail.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down";
}
}
}
+159
View File
@@ -0,0 +1,159 @@
//------------------------------------------------------------------------------
// <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 ES3.WebUserControls {
public partial class mod_planStats {
/// <summary>
/// Controllo fvGlobal.
/// </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 fvGlobal;
/// <summary>
/// Controllo odsStGlb.
/// </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 odsStGlb;
/// <summary>
/// Controllo lbtToggle.
/// </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 lbtToggle;
/// <summary>
/// Controllo tgIcon.
/// </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 tgIcon;
/// <summary>
/// Controllo divDetail.
/// </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 divDetail;
/// <summary>
/// Controllo hlCodIstTemp.
/// </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 hlCodIstTemp;
/// <summary>
/// Controllo gvParetoGrp.
/// </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 gvParetoGrp;
/// <summary>
/// Controllo odsStGrp.
/// </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 odsStGrp;
/// <summary>
/// Controllo cmp_numRowReparti.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.cmp_numRow cmp_numRowReparti;
/// <summary>
/// Controllo gvParetoMac.
/// </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 gvParetoMac;
/// <summary>
/// Controllo odsStMac.
/// </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 odsStMac;
/// <summary>
/// Controllo cmp_numRowMacc.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.cmp_numRow cmp_numRowMacc;
/// <summary>
/// Controllo mod_ricercaGenerica.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::mod_ricercaGenerica mod_ricercaGenerica;
/// <summary>
/// Controllo gvParetoArt.
/// </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 gvParetoArt;
/// <summary>
/// Controllo odsStArt.
/// </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 odsStArt;
/// <summary>
/// Controllo cmp_numRowArt.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::ES3.WebUserControls.cmp_numRow cmp_numRowArt;
}
}
+8
View File
@@ -0,0 +1,8 @@
<%@ Page Title="MPADM | Login" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="ES3.login" Codebehind="login.aspx.cs" %>
<%@ Register Src="~/WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div class="centerAll">
<uc1:mod_login ID="Mod_login1" runat="server" />
</div>
</asp:Content>
+48
View File
@@ -0,0 +1,48 @@
using System;
namespace ES3
{
public partial class login : System.Web.UI.Page
{
protected string _nextPage
{
get
{
string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage");
if (pagina == "")
{
pagina = "menu.aspx";
}
return pagina;
}
}
protected void Page_Load(object sender, EventArgs e)
{
Mod_login1.modoLogin = SteamWare.loginMode.normale;
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Mod_login1.Login_ok += new EventHandler(Mod_login1_Login_ok);
Mod_login1.Login_Error += new EventHandler(Mod_login1_Login_Error);
}
void Mod_login1_Login_Error(object sender, EventArgs e)
{
Response.Redirect("./unauthorized.aspx");
}
void Mod_login1_Login_ok(object sender, EventArgs e)
{
Response.Redirect(_nextPage);
}
protected override void OnUnload(EventArgs e)
{
base.OnUnload(e);
Mod_login1.Login_ok -= new EventHandler(Mod_login1_Login_ok);
Mod_login1.Login_Error -= new EventHandler(Mod_login1_Login_Error);
}
}
}
+24
View File
@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <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 ES3 {
public partial class login {
/// <summary>
/// Controllo Mod_login1.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::mod_login Mod_login1;
}
}
+8
View File
@@ -0,0 +1,8 @@
<%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="ES3.menu" Title="MPADM" Codebehind="menu.aspx.cs" %>
<%@ Register Src="~/WebUserControls/mod_main_help.ascx" TagName="mod_main_help" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<uc2:mod_main_help ID="Mod_main_help1" runat="server" />
</asp:Content>
+6
View File
@@ -0,0 +1,6 @@
namespace ES3
{
public partial class menu : System.Web.UI.Page
{
}
}
+24
View File
@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <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 ES3 {
public partial class menu {
/// <summary>
/// Controllo Mod_main_help1.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::mod_main_help Mod_main_help1;
}
}
+46
View File
@@ -0,0 +1,46 @@
<%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true"
Inherits="test" Title="Untitled Page" CodeBehind="test.aspx.cs" %>
<%@ Register Assembly="SteamWare" Namespace="SteamWare" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<table>
<tr valign="baseline">
<td>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/bg-menu-main.png" Width="150%"
Height="50px" />
</td>
<td>
<asp:Image ID="Image4" runat="server" ImageUrl="~/images/bg-menu-main.png" Width="50%"
Height="20px" />
</td>
<td>
<asp:Image ID="Image2" runat="server" ImageUrl="~/images/bg-menu-main.png" Width="100%"
Height="80px" />
</td>
<td>
<asp:Image ID="Image3" runat="server" ImageUrl="~/images/bg-menu-main.png" Width="30px"
Height="50px" />
</td>
</tr>
</table>
<%--<asp:HiddenField runat="server" ID="HiddenID" />
<script type="text/javascript" language="javascript">
document.getElementById("ctl00_ContentPlaceHolder1_HiddenID").value = "w=" + getClientWidth() + ", h=" + getClientHeight();
window.onresize = updateValues;
function updateValues() {
document.getElementById("ctl00_ContentPlaceHolder1_HiddenID").value = "w=" + getClientWidth() + ", h=" + getClientHeight();
}
function getClientWidth() {
return document.compatMode == 'CSS1Compat' && !window.opera ? document.documentElement.clientWidth : document.body.clientWidth;
}
function getClientHeight() {
return document.compatMode == 'CSS1Compat' && !window.opera ? document.documentElement.clientHeight : document.body.clientHeight;
}
</script>
<asp:Button ID="Button1" runat="server" Text="Button" />--%>
<asp:Label runat="server" ID="lblOut" />
</asp:Content>
+9
View File
@@ -0,0 +1,9 @@
using System;
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lblOut.Text = string.Format("H: {0} - W: {1}", Session["WindowHeight"], Session["WindowWidth"]);
}
}
+59
View File
@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class test {
/// <summary>
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
/// <summary>
/// Image4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image4;
/// <summary>
/// Image2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image2;
/// <summary>
/// Image3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image3;
/// <summary>
/// lblOut control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblOut;
}