From 8725ea6796877428cb8d4f214b93128bf1d04ff2 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 4 Oct 2019 10:22:17 +0200 Subject: [PATCH] Completo update editing / creazione... --- .../WebUserControls/mod_attivitaIns.ascx | 312 +++++++----- .../WebUserControls/mod_attivitaIns.ascx.cs | 447 +++++++++--------- .../WebUserControls/mod_commAttivita.ascx | 14 +- .../WebUserControls/mod_commAttivita.ascx.cs | 5 +- GPW_Smart/WebUserControls/mod_dateTime.ascx | 20 - Jenkinsfile | 2 +- 6 files changed, 413 insertions(+), 387 deletions(-) diff --git a/GPW_Smart/WebUserControls/mod_attivitaIns.ascx b/GPW_Smart/WebUserControls/mod_attivitaIns.ascx index a540cea..d576395 100644 --- a/GPW_Smart/WebUserControls/mod_attivitaIns.ascx +++ b/GPW_Smart/WebUserControls/mod_attivitaIns.ascx @@ -1,137 +1,187 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_attivitaIns.ascx.cs" Inherits="GPW.WebUserControls.mod_attivitaIns" %> <%@ Register Src="mod_dateTime.ascx" TagName="mod_dateTime" TagPrefix="uc1" %> +
+
+ Edit / Nuova Attività +
+
+ + +
+ + + + + + + + + + +
+ + +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+ + + + + + + + + + +
+ + +
+
+ +
+
+ +
+
+
+ <%-- -
-

Edit / Nuova Attività

-
-
- - - - - - - - - - -
- descrizione: - -
-
- -
-
- -
-
- -
-
-
- - - - - - - - - -
- descrizione: - -
-
- -
-
- -
-
-
- - - - - - - - - -
- descrizione: - -
-
- -
-
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + +
+ descrizione: + +
+
+ +
+
+ +
+
--%> + + + + + + + + + + +
+ descrizione: + +
+
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ diff --git a/GPW_Smart/WebUserControls/mod_attivitaIns.ascx.cs b/GPW_Smart/WebUserControls/mod_attivitaIns.ascx.cs index 4f8ab74..b37a53d 100644 --- a/GPW_Smart/WebUserControls/mod_attivitaIns.ascx.cs +++ b/GPW_Smart/WebUserControls/mod_attivitaIns.ascx.cs @@ -1,235 +1,232 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; +using GPW_data; +using SteamWare; +using System; using System.Web.UI; using System.Web.UI.WebControls; -using SteamWare; -using GPW_data; namespace GPW.WebUserControls { - public partial class mod_attivitaIns : System.Web.UI.UserControl + public partial class mod_attivitaIns : System.Web.UI.UserControl + { + /// + /// pagina di return a fine editing + /// + protected string returnPage { - /// - /// pagina di return a fine editing - /// - protected string returnPage + get + { + string answ = memLayer.ML.confReadString("baseUrl"); + try { - get - { - string answ = memLayer.ML.confReadString("baseUrl"); - try - { - answ = memLayer.ML.StringSessionObj("returnPage"); - } - catch - { } - return answ; - } - set - { - memLayer.ML.setSessionVal("returnPage", value); - } - } - /// - /// RA selezionata - /// - protected int idxRASel - { - get - { - return memLayer.ML.IntSessionObj("idxRASel"); - } - set - { - memLayer.ML.setSessionVal("idxRASel", value); - } - } - /// - /// data selezionata - /// - protected DateTime dataRif - { - get - { - DateTime answ = DateTime.Now; - try - { - answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif")); - } - catch - { } - return answ; - } - set - { - memLayer.ML.setSessionVal("dataRif", value); - } - } - /// - /// progetto selezionato - /// - protected int idxProjSel - { - get - { - return memLayer.ML.IntSessionObj("idxProjSel"); - } - set - { - memLayer.ML.setSessionVal("idxProjSel", value); - } - } - /// - /// fase selezionata - /// - protected int idxFaseSel - { - get - { - return memLayer.ML.IntSessionObj("idxFaseSel"); - } - set - { - memLayer.ML.setSessionVal("idxFaseSel", value); - } - } - /// - /// al primo load ricarico i dati correnti (se ci sono) - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - DropDownList ddlFase_int; - if (!Page.IsPostBack) - { - // verifico se ci sia una richiesta di editing... - if (idxRASel > 0) - { - frViewRA.ChangeMode(FormViewMode.Edit); - // pre-seleziono idx progetto x ods fase... - idxFaseSel = DataProxy.DP.taRA.getByKey(idxRASel)[0].idxFase; - idxProjSel = idxPrjByFase(idxFaseSel); - // imposto valori selezionati - DropDownList ddlProj_int = (DropDownList)frViewRA.FindControl("ddlProgetto"); - ddlProj_int.SelectedValue = idxProjSel.ToString(); - ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase"); - ddlFase_int.SelectedValue = idxFaseSel.ToString(); - } - else // è insert nuova!!! - { - frViewRA.ChangeMode(FormViewMode.Insert); - mod_dateTime dtjInizio = (mod_dateTime)frViewRA.FindControl("dtjInizio"); - mod_dateTime dtjFine = (mod_dateTime)frViewRA.FindControl("dtjFine"); - dtjInizio.valoreDateTime = dataRif.AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute); - dtjFine.valoreDateTime = dtjInizio.valoreDateTime.AddMinutes(memLayer.ML.confReadInt("defRegAttMin")); - } - } - } - /// - /// calcola idxProgetto da idxFase - /// - /// - /// - public int idxPrjByFase(object idxFase) - { - int answ = 0; - try - { - answ = DataProxy.DP.taAF.getByIdx(Convert.ToInt32(idxFase))[0].idxProgetto; - } - catch - { } - return answ; - } - /// - /// aggiorno ods fasi... - /// - /// - /// - protected void ddlProgetto_SelectedIndexChanged(object sender, EventArgs e) - { - // salvo in session idxProjSel! - DropDownList ddlProj_int = (DropDownList)sender; - idxProjSel = Convert.ToInt32(ddlProj_int.SelectedValue); - // ricarico dati fasi - odsFase.DataBind(); - } - /// - /// evento richiesta update - /// - /// - /// - protected void odsRA_Updating(object sender, ObjectDataSourceMethodEventArgs e) - { - // recupero valore fase selezionato... - DropDownList ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase"); - e.InputParameters["idxFase"] = ddlFase_int.SelectedValue; - e.InputParameters["idxDipendente"] = DataProxy.idxDipendente; - } - - protected void frViewRA_ItemCommand(object sender, FormViewCommandEventArgs e) - { - // se è cancel ritorno ad altra pagina! - if (e.CommandName == "Cancel") - { - Response.Redirect(returnPage); - } - } - - protected void odsRA_Inserting(object sender, ObjectDataSourceMethodEventArgs e) - { - // recupero valori non direttamente linkati... - DropDownList ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase"); - e.InputParameters["idxFase"] = ddlFase_int.SelectedValue; - e.InputParameters["idxDipendente"] = DataProxy.idxDipendente; - } - - protected void odsRA_Inserted(object sender, ObjectDataSourceStatusEventArgs e) - { - Response.Redirect(returnPage); - } - - protected void odsRA_Updated(object sender, ObjectDataSourceStatusEventArgs e) - { - Response.Redirect(returnPage); - } - - protected void odsRA_Deleted(object sender, ObjectDataSourceStatusEventArgs e) - { - Response.Redirect(returnPage); - } - /// - /// sistemo eventuali "headers" - /// - /// - /// - protected void ddlFase_DataBound(object sender, EventArgs e) - { - // cerco eventuali controlli tipo "ancestor" e li disattivo! - DropDownList ddlFase_int = (DropDownList)sender; - ListItem li = new ListItem(); - while (li != null) - { - li = ddlFase_int.Items.FindByValue("0"); - try - { - li.Attributes.Add("style", "color:gray;"); - li.Attributes.Add("disabled", "true"); - li.Value = "-1"; - li.Text = string.Format("[ {0} ]", li.Text); - } - catch - { } - } - try - { - ddlFase_int.SelectedIndex = 1; - } - catch - { } + answ = memLayer.ML.StringSessionObj("returnPage"); } + catch + { } + return answ; + } + set + { + memLayer.ML.setSessionVal("returnPage", value); + } } + /// + /// RA selezionata + /// + protected int idxRASel + { + get + { + return memLayer.ML.IntSessionObj("idxRASel"); + } + set + { + memLayer.ML.setSessionVal("idxRASel", value); + } + } + /// + /// data selezionata + /// + protected DateTime dataRif + { + get + { + DateTime answ = DateTime.Now; + try + { + answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataRif")); + } + catch + { } + return answ; + } + set + { + memLayer.ML.setSessionVal("dataRif", value); + } + } + /// + /// progetto selezionato + /// + protected int idxProjSel + { + get + { + return memLayer.ML.IntSessionObj("idxProjSel"); + } + set + { + memLayer.ML.setSessionVal("idxProjSel", value); + } + } + /// + /// fase selezionata + /// + protected int idxFaseSel + { + get + { + return memLayer.ML.IntSessionObj("idxFaseSel"); + } + set + { + memLayer.ML.setSessionVal("idxFaseSel", value); + } + } + /// + /// al primo load ricarico i dati correnti (se ci sono) + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + DropDownList ddlFase_int; + if (!Page.IsPostBack) + { + // verifico se ci sia una richiesta di editing... + if (idxRASel > 0) + { + frViewRA.ChangeMode(FormViewMode.Edit); + // pre-seleziono idx progetto x ods fase... + idxFaseSel = DataProxy.DP.taRA.getByKey(idxRASel)[0].idxFase; + idxProjSel = idxPrjByFase(idxFaseSel); + // imposto valori selezionati + DropDownList ddlProj_int = (DropDownList)frViewRA.FindControl("ddlProgetto"); + ddlProj_int.SelectedValue = idxProjSel.ToString(); + ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase"); + ddlFase_int.SelectedValue = idxFaseSel.ToString(); + } + else // è insert nuova!!! + { + frViewRA.ChangeMode(FormViewMode.Insert); + mod_dateTime dtInizio = (mod_dateTime)frViewRA.FindControl("dtInizio"); + mod_dateTime dtFine = (mod_dateTime)frViewRA.FindControl("dtFine"); + dtInizio.valoreDateTime = dataRif.AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute); + dtFine.valoreDateTime = dtInizio.valoreDateTime.AddMinutes(memLayer.ML.confReadInt("defRegAttMin")); + } + } + } + /// + /// calcola idxProgetto da idxFase + /// + /// + /// + public int idxPrjByFase(object idxFase) + { + int answ = 0; + try + { + answ = DataProxy.DP.taAF.getByIdx(Convert.ToInt32(idxFase))[0].idxProgetto; + } + catch + { } + return answ; + } + /// + /// aggiorno ods fasi... + /// + /// + /// + protected void ddlProgetto_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in session idxProjSel! + DropDownList ddlProj_int = (DropDownList)sender; + idxProjSel = Convert.ToInt32(ddlProj_int.SelectedValue); + // ricarico dati fasi + odsFase.DataBind(); + } + /// + /// evento richiesta update + /// + /// + /// + protected void odsRA_Updating(object sender, ObjectDataSourceMethodEventArgs e) + { + // recupero valore fase selezionato... + DropDownList ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase"); + e.InputParameters["idxFase"] = ddlFase_int.SelectedValue; + e.InputParameters["idxDipendente"] = DataProxy.idxDipendente; + } + + protected void frViewRA_ItemCommand(object sender, FormViewCommandEventArgs e) + { + // se è cancel ritorno ad altra pagina! + if (e.CommandName == "Cancel") + { + Response.Redirect(returnPage); + } + } + + protected void odsRA_Inserting(object sender, ObjectDataSourceMethodEventArgs e) + { + // recupero valori non direttamente linkati... + DropDownList ddlFase_int = (DropDownList)frViewRA.FindControl("ddlFase"); + e.InputParameters["idxFase"] = ddlFase_int.SelectedValue; + e.InputParameters["idxDipendente"] = DataProxy.idxDipendente; + } + + protected void odsRA_Inserted(object sender, ObjectDataSourceStatusEventArgs e) + { + Response.Redirect(returnPage); + } + + protected void odsRA_Updated(object sender, ObjectDataSourceStatusEventArgs e) + { + Response.Redirect(returnPage); + } + + protected void odsRA_Deleted(object sender, ObjectDataSourceStatusEventArgs e) + { + Response.Redirect(returnPage); + } + /// + /// sistemo eventuali "headers" + /// + /// + /// + protected void ddlFase_DataBound(object sender, EventArgs e) + { + // cerco eventuali controlli tipo "ancestor" e li disattivo! + DropDownList ddlFase_int = (DropDownList)sender; + ListItem li = new ListItem(); + while (li != null) + { + li = ddlFase_int.Items.FindByValue("0"); + try + { + li.Attributes.Add("style", "color:gray;"); + li.Attributes.Add("disabled", "true"); + li.Value = "-1"; + li.Text = string.Format("[ {0} ]", li.Text); + } + catch + { } + } + try + { + ddlFase_int.SelectedIndex = 1; + } + catch + { } + } + } } \ No newline at end of file diff --git a/GPW_Smart/WebUserControls/mod_commAttivita.ascx b/GPW_Smart/WebUserControls/mod_commAttivita.ascx index 4c4af32..ff55c5a 100644 --- a/GPW_Smart/WebUserControls/mod_commAttivita.ascx +++ b/GPW_Smart/WebUserControls/mod_commAttivita.ascx @@ -6,14 +6,16 @@
- +
- Aggiungi + Aggiungi
- +
+ +
@@ -36,8 +38,8 @@
-
-  -  +
+  - 
diff --git a/GPW_Smart/WebUserControls/mod_commAttivita.ascx.cs b/GPW_Smart/WebUserControls/mod_commAttivita.ascx.cs index bc91a01..4e379e9 100644 --- a/GPW_Smart/WebUserControls/mod_commAttivita.ascx.cs +++ b/GPW_Smart/WebUserControls/mod_commAttivita.ascx.cs @@ -81,9 +81,6 @@ namespace GPW.WebUserControls private void setupPage() { // salvo dataFrom/To x visualizzazione attivita -#if false - lblDataRif.Text = dataRif.ToString("dd.MM.yy"); -#endif txtData.Text = dataRif.ToString("yyyy-MM-dd"); // recupero dati della commessa utente giornaliera... try @@ -91,7 +88,7 @@ namespace GPW.WebUserControls int maxErrMinus = memLayer.ML.confReadInt("maxErrMinus"); int maxErrPlus = memLayer.ML.confReadInt("maxErrPlus"); DS_Applicazione.v_logCommUtRow rigaLog = DataProxy.DP.taLCU.getByIdxDipDate(memLayer.ML.IntSessionObj("idxDipendente"), dataRif, dataRif.AddDays(1), maxErrMinus, maxErrPlus)[0]; - lblTotOreRA.Text = string.Format("{0:0.##} h / {1:0.##} h", rigaLog.h_com, rigaLog.h_lav); + lblTotOreRA.Text = string.Format("{0:0.##} / {1:0.##} h", rigaLog.h_com, rigaLog.h_lav); } catch { diff --git a/GPW_Smart/WebUserControls/mod_dateTime.ascx b/GPW_Smart/WebUserControls/mod_dateTime.ascx index 0b30851..3c06fc9 100644 --- a/GPW_Smart/WebUserControls/mod_dateTime.ascx +++ b/GPW_Smart/WebUserControls/mod_dateTime.ascx @@ -15,29 +15,9 @@
- -<%--
-
- - - - - -

- -

-
-
-
- -
-
-
-
--%> - <%----%> diff --git a/Jenkinsfile b/Jenkinsfile index 717de12..3e9843d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=4071']) { + withEnv(['NEXT_BUILD_NUMBER=4073']) { // env.versionNumber = VersionNumber(versionNumberString : '2.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '2.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'GPW'