+
FESTIVITA'
-
+
CHIUSURE AZIENDALI
-
+
WEEK-END
+
+ MALATTIE
+
diff --git a/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.cs b/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.cs
index 7ad4242..d138928 100644
--- a/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.cs
+++ b/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.cs
@@ -16,49 +16,65 @@ namespace GPW_Admin.WebUserControls
set
{
_anno = value;
- //doUpdateCal();
//odsMesi.DataBind();
repCal.DataBind();
}
}
- public bool showAll { get; set; } = true;
+ ///
+ /// Mostra anche richieste (permessi/ferie/104) confermate o solo da confermare
+ ///
+ public bool showAlsoConf { get; set; } = true;
+ ///
+ /// Mostrare/Colorare sul calendario le chiusure aziendali programmate
+ ///
+ public bool showCalAz
+ {
+ get => _showCalAz;
+ set
+ {
+ _showCalAz = value;
+ divCalAz.Visible = value;
+ divFes.Visible = value;
+ }
+ }
+
+ ///
+ /// Mostrare/Colorare sul calendario le malattie ricevute
+ ///
+ public bool showMal
+ {
+ get => _showMal;
+ set
+ {
+ _showMal = value;
+ divMal.Visible = value;
+ }
+ }
+
+ ///
+ /// Mostrare/Colorare sul calendario le richieste dipendente
+ ///
public bool showRichDip
{
get => _showRichDip;
set
{
- if (_showRichDip != value)
- {
- _showRichDip = value;
- divRichDip.Visible = value;
- }
+ _showRichDip = value;
+ divRichDip.Visible = value;
}
}
#endregion Public Properties
- #region Public Methods
-
- public List
elencoMesi()
- {
- List listaMesi = new List();
- for (int i = 0; i < 12; i++)
- {
- listaMesi.Add(new DateTime(_anno, 1 + i, 1));
- }
- return listaMesi;
- }
-
- #endregion Public Methods
-
#region Protected Properties
protected DS_Applicazione.DipendentiDataTable listaDip { get; set; }
protected List listCFF { get; set; }
+ protected List listRM { get; set; }
protected List listRR { get; set; }
#endregion Protected Properties
@@ -73,15 +89,51 @@ namespace GPW_Admin.WebUserControls
protected void calDisplay_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
{
bool isColored = false;
- // coloro se fa parte delle festività/ferie...
- if (listCFF != null && listCFF.Count > 0)
+ if (showCalAz)
{
- // cerco riga...
- var thisDate = listCFF.Where(x => x.data == e.Day.Date).FirstOrDefault();
- if (thisDate != null && e.Cell.CssClass != "text-light")
+ // coloro se fa parte delle festività/ferie...
+ if (listCFF != null && listCFF.Count > 0)
{
- isColored = true;
- e.Cell.CssClass = thisDate.codGiust == "FEST" ? "bg-danger text-warning" : "bg-warning";
+ // cerco riga...
+ var thisDate = listCFF.Where(x => x.data == e.Day.Date).FirstOrDefault();
+ if (thisDate != null && e.Cell.CssClass != "text-light")
+ {
+ isColored = true;
+ e.Cell.CssClass = thisDate.codGiust == "FEST" ? "bg-danger text-warning" : "bg-warning";
+ e.Cell.ToolTip = $"{thisDate.descrizione}";
+ }
+ }
+ }
+ if (showMal)
+ {
+ // coloro se fa parte delle festività/ferie...
+ if (listRM != null && listRM.Count > 0)
+ {
+ // cerco riga...
+ var listMal = listRM.Where(x => e.Day.Date >= x.DtInizio && e.Day.Date < x.DtInizio.AddDays(x.NumGG)).ToList();
+ var thisDate = listMal.FirstOrDefault();
+ if (thisDate != null && e.Cell.CssClass != "text-light")
+ {
+ isColored = true;
+ e.Cell.CssClass = "bg-dark text-light";
+ // se ho 1 sola riga --> metto 1, altrimenti compilo multiplo...
+ string toolTip = "";
+ if (listMal.Count == 1)
+ {
+ toolTip = $"{datiDip(thisDate.IdxDipendente)}";
+ }
+ else
+ {
+ foreach (var item in listMal)
+ {
+ toolTip += $"{datiDip(item.IdxDipendente)} | ";
+ }
+ // elimino ultimo
+ //
+ toolTip = toolTip.Substring(0, toolTip.Length - 3);
+ }
+ e.Cell.ToolTip = toolTip;
+ }
}
}
if (showRichDip)
@@ -119,7 +171,7 @@ namespace GPW_Admin.WebUserControls
}
}
// se ho 1 sola riga --> metto 1, altrimenti compilo multiplo...
- string toolTip = $"";
+ string toolTip = "";
if (listReq.Count == 1)
{
toolTip = $"{thisDate.CodGiust}, {datiDip(thisDate.IdxDipendente)}";
@@ -164,11 +216,18 @@ namespace GPW_Admin.WebUserControls
protected void doUpdateCal()
{
- listCFF = CffListByAnno(anno);
+ if (showCalAz)
+ {
+ listCFF = CffListByAnno(anno);
+ }
if (showRichDip)
{
listRR = RRListByAnno(anno);
}
+ if (showMal)
+ {
+ listRM = RMListByAnno(anno);
+ }
}
protected void Page_Load(object sender, EventArgs e)
@@ -187,7 +246,22 @@ namespace GPW_Admin.WebUserControls
#region Private Properties
- private int _anno { get; set; } = DateTime.Today.Year;
+ private int _anno
+ {
+ get
+ {
+ int answ = 0;
+ int.TryParse(hfAnno.Value, out answ);
+ return answ;
+ }
+ set
+ {
+ hfAnno.Value = $"{value}";
+ }
+ }
+
+ private bool _showCalAz { get; set; } = true;
+ private bool _showMal { get; set; } = false;
private bool _showRichDip { get; set; } = true;
#endregion Private Properties
@@ -206,6 +280,18 @@ namespace GPW_Admin.WebUserControls
return result;
}
+ ///
+ /// Elenco Richieste Dipendenti x anno
+ ///
+ ///
+ private List RMListByAnno(int reqYear)
+ {
+ DateTime inizio = new DateTime(reqYear, 1, 1);
+ DateTime fine = inizio.AddYears(1);
+ List result = DataProxy.DP.taRM.getPeriod(0, inizio, fine).ToList();
+ return result;
+ }
+
///
/// Elenco Richieste Dipendenti x anno
///
@@ -214,7 +300,7 @@ namespace GPW_Admin.WebUserControls
{
DateTime inizio = new DateTime(reqYear, 1, 1);
DateTime fine = inizio.AddYears(1);
- List result = DataProxy.DP.taRR.getPeriod(0, inizio, fine, showAll).ToList();
+ List result = DataProxy.DP.taRR.getPeriod(0, inizio, fine, showAlsoConf).ToList();
return result;
}
diff --git a/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.designer.cs b/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.designer.cs
index 216e2d0..c6dcd78 100644
--- a/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.designer.cs
+++ b/GPW_Admin/WebUserControls/cmp_calAnnuale.ascx.designer.cs
@@ -14,6 +14,42 @@ namespace GPW_Admin.WebUserControls
public partial class cmp_calAnnuale
{
+ ///
+ /// divFes control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divFes;
+
+ ///
+ /// divCalAz control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divCalAz;
+
+ ///
+ /// divMal control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMal;
+
+ ///
+ /// hfAnno control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HiddenField hfAnno;
+
///
/// repCal control.
///
diff --git a/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx b/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx
index e60431e..1d8e5d7 100644
--- a/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx
+++ b/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx
@@ -90,6 +90,6 @@
-
+
diff --git a/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx.cs b/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx.cs
index 67738b5..d9d15da 100644
--- a/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx.cs
+++ b/GPW_Admin/WebUserControls/cmp_gestMalattia.ascx.cs
@@ -100,7 +100,7 @@ namespace GPW_Admin.WebUserControls
protected void chkShowAll_CheckedChanged(object sender, EventArgs e)
{
chkShowAll.Text = chkShowAll.Checked ? "Mostra Tutti" : "Da Confermare";
- cmp_calAnnuale.showAll = chkShowAll.Checked;
+ cmp_calAnnuale.showAlsoConf = chkShowAll.Checked;
}
protected string datiDip(object idxDip)
diff --git a/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx b/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx
index f179dc2..25257ff 100644
--- a/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx
+++ b/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx
@@ -104,6 +104,6 @@
-
+
diff --git a/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx.cs b/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx.cs
index 3732c60..acff91e 100644
--- a/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx.cs
+++ b/GPW_Admin/WebUserControls/cmp_gestRichDip.ascx.cs
@@ -102,7 +102,7 @@ namespace GPW_Admin.WebUserControls
protected void chkShowAll_CheckedChanged(object sender, EventArgs e)
{
chkShowAll.Text = chkShowAll.Checked ? "Mostra Tutti" : "Da Confermare";
- cmp_calAnnuale.showAll = chkShowAll.Checked;
+ cmp_calAnnuale.showAlsoConf = chkShowAll.Checked;
}
protected string datiDip(object idxDip)
diff --git a/GPW_Admin/WebUserControls/mod_gestCalendario.ascx b/GPW_Admin/WebUserControls/mod_gestCalendario.ascx
index b889dc2..80363f1 100644
--- a/GPW_Admin/WebUserControls/mod_gestCalendario.ascx
+++ b/GPW_Admin/WebUserControls/mod_gestCalendario.ascx
@@ -1,14 +1,16 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestCalendario.ascx.cs" Inherits="GPW_Admin.WebUserControls.mod_gestCalendario" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/WebUserControls/cmp_periodoAnalisi.ascx" TagPrefix="uc1" TagName="cmp_periodoAnalisi" %>
+<%@ Register Src="~/WebUserControls/cmp_calAnnuale.ascx" TagPrefix="uc1" TagName="cmp_calAnnuale" %>
+