diff --git a/GPW_Smart/WebUserControls/cmq_params.ascx.cs b/GPW_Smart/BaseUserControl.cs similarity index 58% rename from GPW_Smart/WebUserControls/cmq_params.ascx.cs rename to GPW_Smart/BaseUserControl.cs index de62e33..42d5e18 100644 --- a/GPW_Smart/WebUserControls/cmq_params.ascx.cs +++ b/GPW_Smart/BaseUserControl.cs @@ -1,26 +1,14 @@ -using SteamWare; +using GPW_data; +using GPW_Smart; +using SteamWare; using System; +using System.Web.UI; +using System.Web.UI.WebControls; -namespace GPW_Smart.WebUserControls +namespace GPW_Smart { - public partial class cmq_params : System.Web.UI.UserControl + public class BaseUserControl : System.Web.UI.UserControl { - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - try - { - ddlNumCol.SelectedValue = numColEU.ToString(); - ddlNumRow.SelectedValue = numRowTimb.ToString(); - chkAbilitaAll.Checked = abilitaAll; - ddlTextSize.SelectedValue = textSize.ToString(); - } - catch - { } - } - } - public string hashEmail { get @@ -96,39 +84,36 @@ namespace GPW_Smart.WebUserControls { get { - return memLayer.ML.StringSessionObj("textSize"); + string answ=memLayer.ML.StringSessionObj("textSize"); + if (string.IsNullOrEmpty(answ)) + answ = "1.2em"; + return answ; } set { memLayer.ML.setSessionVal("textSize", value); } } - - protected void ddlNumRow_SelectedIndexChanged(object sender, EventArgs e) + /// + /// idx dipendente loggato + /// + protected int IdxDipendente { - lbtSalva.Visible = true; - } - protected void ddlNumCol_SelectedIndexChanged(object sender, EventArgs e) - { - lbtSalva.Visible = true; - } - protected void chkAbilitaAll_CheckedChanged(object sender, EventArgs e) - { - lbtSalva.Visible = true; - } - - protected void lbtSalva_Click(object sender, EventArgs e) - { - numRowTimb = Convert.ToInt32(ddlNumRow.SelectedValue); - numColEU = Convert.ToInt32(ddlNumCol.SelectedValue); - abilitaAll = chkAbilitaAll.Checked; - textSize = ddlTextSize.SelectedValue; - Response.Redirect("Timbrature"); - } - - protected void ddlTextSize_SelectedIndexChanged(object sender, EventArgs e) - { - lbtSalva.Visible = true; + get + { + int idx = 0; + try + { + idx = memLayer.ML.IntSessionObj("IdxDipendente"); + } + catch + { } + return idx; + } + set + { + memLayer.ML.setSessionVal("IdxDipendente", value.ToString()); + } } } } \ No newline at end of file diff --git a/GPW_Smart/GPW_Smart.csproj b/GPW_Smart/GPW_Smart.csproj index f3d5371..28e24be 100644 --- a/GPW_Smart/GPW_Smart.csproj +++ b/GPW_Smart/GPW_Smart.csproj @@ -627,7 +627,7 @@ - + @@ -728,6 +728,9 @@ attivitaIns.aspx + + ASPXCodeBehind + Default.aspx ASPXCodeBehind @@ -844,12 +847,12 @@ cmp_rilTemp.ascx - - cmq_params.ascx + + cmp_params.ascx ASPXCodeBehind - - cmq_params.ascx + + cmp_params.ascx mod_attivitaIns.ascx diff --git a/GPW_Smart/Parametri.aspx b/GPW_Smart/Parametri.aspx index 0c7fb11..33f1366 100644 --- a/GPW_Smart/Parametri.aspx +++ b/GPW_Smart/Parametri.aspx @@ -1,7 +1,7 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Parametri.aspx.cs" Inherits="GPW_Smart.Parametri" %> -<%@ Register Src="~/WebUserControls/cmq_params.ascx" TagPrefix="uc1" TagName="cmq_params" %> +<%@ Register Src="~/WebUserControls/cmp_params.ascx" TagPrefix="uc1" TagName="cmp_params" %> - + diff --git a/GPW_Smart/Parametri.aspx.designer.cs b/GPW_Smart/Parametri.aspx.designer.cs index c830048..43fc7ba 100644 --- a/GPW_Smart/Parametri.aspx.designer.cs +++ b/GPW_Smart/Parametri.aspx.designer.cs @@ -13,12 +13,12 @@ namespace GPW_Smart { public partial class Parametri { /// - /// Controllo cmq_params. + /// Controllo cmp_params. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::GPW_Smart.WebUserControls.cmq_params cmq_params; + protected global::GPW_Smart.WebUserControls.cmp_params cmp_params; } } diff --git a/GPW_Smart/Site.Master b/GPW_Smart/Site.Master index 90735f0..65c460c 100644 --- a/GPW_Smart/Site.Master +++ b/GPW_Smart/Site.Master @@ -49,7 +49,7 @@ -
+
diff --git a/GPW_Smart/Timbrature.aspx b/GPW_Smart/Timbrature.aspx index a5c9003..5c6c752 100644 --- a/GPW_Smart/Timbrature.aspx +++ b/GPW_Smart/Timbrature.aspx @@ -2,7 +2,6 @@ <%@ Register Src="~/WebUserControls/mod_timbrature.ascx" TagPrefix="uc1" TagName="mod_timbrature" %> - diff --git a/GPW_Smart/WebUserControls/cmq_params.ascx b/GPW_Smart/WebUserControls/cmp_params.ascx similarity index 98% rename from GPW_Smart/WebUserControls/cmq_params.ascx rename to GPW_Smart/WebUserControls/cmp_params.ascx index d49d1b3..751008f 100644 --- a/GPW_Smart/WebUserControls/cmq_params.ascx +++ b/GPW_Smart/WebUserControls/cmp_params.ascx @@ -1,7 +1,4 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmq_params.ascx.cs" Inherits="GPW_Smart.WebUserControls.cmq_params" %> - - - +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_params.ascx.cs" Inherits="GPW_Smart.WebUserControls.cmp_params" %>
diff --git a/GPW_Smart/WebUserControls/cmp_params.ascx.cs b/GPW_Smart/WebUserControls/cmp_params.ascx.cs new file mode 100644 index 0000000..d558244 --- /dev/null +++ b/GPW_Smart/WebUserControls/cmp_params.ascx.cs @@ -0,0 +1,51 @@ +using SteamWare; +using System; + +namespace GPW_Smart.WebUserControls +{ + public partial class cmp_params : BaseUserControl + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + try + { + ddlNumCol.SelectedValue = numColEU.ToString(); + ddlNumRow.SelectedValue = numRowTimb.ToString(); + chkAbilitaAll.Checked = abilitaAll; + ddlTextSize.SelectedValue = textSize.ToString(); + } + catch + { } + } + } + + protected void ddlNumRow_SelectedIndexChanged(object sender, EventArgs e) + { + lbtSalva.Visible = true; + } + protected void ddlNumCol_SelectedIndexChanged(object sender, EventArgs e) + { + lbtSalva.Visible = true; + } + protected void chkAbilitaAll_CheckedChanged(object sender, EventArgs e) + { + lbtSalva.Visible = true; + } + + protected void lbtSalva_Click(object sender, EventArgs e) + { + numRowTimb = Convert.ToInt32(ddlNumRow.SelectedValue); + numColEU = Convert.ToInt32(ddlNumCol.SelectedValue); + abilitaAll = chkAbilitaAll.Checked; + textSize = ddlTextSize.SelectedValue; + Response.Redirect("Timbrature"); + } + + protected void ddlTextSize_SelectedIndexChanged(object sender, EventArgs e) + { + lbtSalva.Visible = true; + } + } +} \ No newline at end of file diff --git a/GPW_Smart/WebUserControls/cmq_params.ascx.designer.cs b/GPW_Smart/WebUserControls/cmp_params.ascx.designer.cs similarity index 98% rename from GPW_Smart/WebUserControls/cmq_params.ascx.designer.cs rename to GPW_Smart/WebUserControls/cmp_params.ascx.designer.cs index 7826e2a..f55df5f 100644 --- a/GPW_Smart/WebUserControls/cmq_params.ascx.designer.cs +++ b/GPW_Smart/WebUserControls/cmp_params.ascx.designer.cs @@ -11,7 +11,7 @@ namespace GPW_Smart.WebUserControls { - public partial class cmq_params + public partial class cmp_params { /// diff --git a/GPW_Smart/WebUserControls/mod_timbrature.ascx.cs b/GPW_Smart/WebUserControls/mod_timbrature.ascx.cs index 02e676b..597c4ca 100644 --- a/GPW_Smart/WebUserControls/mod_timbrature.ascx.cs +++ b/GPW_Smart/WebUserControls/mod_timbrature.ascx.cs @@ -1,4 +1,5 @@ using GPW_data; +using GPW_Smart; using SteamWare; using System; using System.Web.UI; @@ -6,7 +7,7 @@ using System.Web.UI.WebControls; namespace GPW.WebUserControls { - public partial class mod_timbrature : System.Web.UI.UserControl + public partial class mod_timbrature : BaseUserControl { protected bool forceButtons { @@ -19,26 +20,6 @@ namespace GPW.WebUserControls abilitaAll = !(value); } } - public bool abilitaAll - { - get - { - bool answ = false; - try - { - string rawData = memLayer.ML.getRSV("abilitaAll"); - bool.TryParse(rawData, out answ); - } - catch - { } - return answ; - } - set - { - int ttlSec = value ? memLayer.ML.CRI("ttlAbilitaAll") : 0; - memLayer.ML.setRSV("abilitaAll", value.ToString(), ttlSec); - } - } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) @@ -58,53 +39,6 @@ namespace GPW.WebUserControls divTable.Style.Add("font-size", textSize); } - public int numColEU - { - get - { - int answ = 2; - try - { - answ = memLayer.ML.IntSessionObj("numColEU"); - } - catch - { } - if (answ <= 0) answ = 2; - return answ; - } - set - { - memLayer.ML.setSessionVal("numColEU", value); - } - } - public int numRowTimb - { - get - { - return memLayer.ML.IntSessionObj("numRowTimb"); - } - set - { - memLayer.ML.setSessionVal("numRowTimb", value); - } - } - - - public string textSize - { - get - { - string answ = memLayer.ML.StringSessionObj("textSize"); - if (string.IsNullOrEmpty(answ)) - answ = "1em"; - return answ; - } - set - { - memLayer.ML.setSessionVal("textSize", value); - } - } - /// /// fix buttons button /// @@ -206,6 +140,16 @@ namespace GPW.WebUserControls timbratrice.registraTimbratura(IdxDipendente, DateTime.Now, isEntrata, IPv4, "Web", approvata); lblWarning.Visible = false; abilitaAll = false; + // se manca temperatura x il giorno --> rimando a pagina! + DateTime dataRif = DateTime.Today; + var tabRT = DataProxy.DP.taRT.getByKey(IdxDipendente, dataRif); + if (tabRT.Rows.Count == 0) + { + // salvo in sessione... + memLayer.ML.setSessionVal("dataRif", dataRif); + // reinvio + Response.Redirect($"TempRil?dataRif={dataRif:yyyy-MM-dd}"); + } //aggiorno timbrature visualizzate setButtons(); updateTimbrature(); @@ -218,27 +162,11 @@ namespace GPW.WebUserControls } return IdxDipendente; } - /// - /// idx dipendente loggato - /// - protected int IdxDipendente - { - get - { - int idx = 0; - try - { - idx = memLayer.ML.IntSessionObj("IdxDipendente"); - } - catch - { } - return idx; - } - } + /// /// inverte valore booleano /// - /// + /// /// public bool invBool(object valore) { diff --git a/Jenkinsfile b/Jenkinsfile index a1865c6..c7daa3b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=4116']) { + withEnv(['NEXT_BUILD_NUMBER=4117']) { // env.versionNumber = VersionNumber(versionNumberString : '2.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '2.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'GPW'