Creata NUOVA scheda giorno e mostra quella (da gestire eventi e eliminare vecchia...)

This commit is contained in:
Samuele E. Locatelli
2015-05-08 17:39:02 +02:00
parent 78d91e4d44
commit 532b46617c
23 changed files with 372 additions and 61 deletions
BIN
View File
Binary file not shown.
+16
View File
@@ -364,7 +364,9 @@
<Content Include="WebUserControls\mod_filtroPeriodo.ascx" />
<Content Include="WebUserControls\mod_filtroZona.ascx" />
<Content Include="WebUserControls\mod_footer.ascx" />
<Content Include="WebUserControls\mod_giornata.ascx" />
<Content Include="WebUserControls\mod_header.ascx" />
<Content Include="WebUserControls\mod_impegno.ascx" />
<Content Include="WebUserControls\mod_Interventi.ascx" />
<Content Include="WebUserControls\mod_pianificazione.ascx" />
<Content Include="WebUserControls\mod_resocontoImpegni.ascx" />
@@ -598,6 +600,13 @@
<Compile Include="WebUserControls\mod_footer.ascx.designer.cs">
<DependentUpon>mod_footer.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_giornata.ascx.cs">
<DependentUpon>mod_giornata.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_giornata.ascx.designer.cs">
<DependentUpon>mod_giornata.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_header.ascx.cs">
<DependentUpon>mod_header.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -605,6 +614,13 @@
<Compile Include="WebUserControls\mod_header.ascx.designer.cs">
<DependentUpon>mod_header.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_impegno.ascx.cs">
<DependentUpon>mod_impegno.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserControls\mod_impegno.ascx.designer.cs">
<DependentUpon>mod_impegno.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserControls\mod_Interventi.ascx.cs">
<DependentUpon>mod_Interventi.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -31,14 +31,6 @@ namespace WebSCR.WebUserControls
protected string qsVal(string nome)
{
return memLayer.ML.QSS(nome);
//string answ = "";
//try
//{
// answ = Request.QueryString[nome].ToString();
//}
//catch
//{ }
//return answ;
}
/// <summary>
/// esegue update componenti
@@ -130,8 +122,6 @@ namespace WebSCR.WebUserControls
{
LinkButton lb = (LinkButton)sender;
dataSel = Convert.ToDateTime(lb.CommandArgument);
//Response.Redirect(string.Format("Pianificazione?CodCliente={0}&Indir={1}&Data={2:yyyy-MM-dd}", qsVal("CodCliente"), qsVal("Indir"), dataSel));
Response.Redirect(string.Format("{0}?CodCliente={1}&Indir={2}&Data={3:yyyy-MM-dd}", devicesAuthProxy.pagCorrente, qsVal("CodCliente"), qsVal("Indir"), dataSel));
}
}
+60
View File
@@ -0,0 +1,60 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_giornata.ascx.cs" Inherits="WebSCR.WebUserControls.mod_giornata" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<script type="text/javascript">
function eventClick(e) {
//alert('Event with id ' + e.id() + ' was selected.');
document.location = '<%= SteamWare.devicesAuthProxy.pagCorrente %>?CodCliente=<%= this.CodCliente %>&Indir=<%= this.Indir %>&Data=<%= this.Data %>&IdxImpegno=' + e.id();
}
</script>
<asp:Label runat="server" ID="lblCodCli" Visible="true" />
<asp:Label runat="server" ID="lblData" Visible="true" />
<div class="ui-grid-a ui-mini">
<div class="ui-block-a" style="text-align: right;">
<asp:Button runat="server" ID="btnAllSquadre" Text="Squadre (tutte)" OnClick="btnAllSquadre_Click" />
</div>
<div class="ui-block-b">
<fieldset data-role="controlgroup" data-type="horizontal" class="ui-controlgroup ui-controlgroup-horizontal ui-corner-all">
<asp:RadioButtonList ID="rblSquadre" runat="server" DataSourceID="odsSquadre" DataTextField="CodSquadra" DataValueField="CodSquadra" RepeatDirection="Horizontal" RepeatLayout="Flow" AppendDataBoundItems="false" AutoPostBack="True" OnSelectedIndexChanged="rblSquadre_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Tutte" Value="*"></asp:ListItem>
</asp:RadioButtonList>
</fieldset>
<asp:ObjectDataSource ID="odsSquadre" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByData" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.DisponibilitaTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="lblData" Name="Data" PropertyName="Text" Type="DateTime" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server"
DataSourceID="ods"
DataIdField="IdxImpegno"
DataValueField="IdxImpegno"
DataTextField="NomeImpegno"
DataStartField="Inizio"
DataEndField="Fine"
TimeFormat="Clock24Hours"
ViewType="Day"
HeightSpec="BusinessHours"
BusinessBeginsHour="8"
BusinessEndsHour="19"
ScrollPositionHour="13"
ShowEventStartEnd="True"
CellHeight="15"
TimeRangeSelectedHandling="CallBack"
EventMoveHandling="CallBack"
EventClickHandling="JavaScript"
EventClickJavaScript="eventClick(e)"
Theme="calendar_white"
OnBeforeEventRender="DayPilotCalendar1_BeforeEventRender"
OnEventClick="DayPilotCalendar1_EventClick"
>
</DayPilot:DayPilotCalendar>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByDate" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.v_ImpegniCalTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="lblData" Name="Data" PropertyName="Text" Type="DateTime" />
<asp:ControlParameter ControlID="rblSquadre" Name="CodSquadra" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
+165
View File
@@ -0,0 +1,165 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using WebSCR_data;
namespace WebSCR.WebUserControls
{
public partial class mod_giornata : System.Web.UI.UserControl
{
public event EventHandler eh_newData;
/// <summary>
/// solleva evento selezione data
/// </summary>
protected void reportEvent()
{
// evento!
if (eh_newData != null)
{
eh_newData(this, new EventArgs());
}
}
protected void Page_Load(object sender, EventArgs e)
{
lblCodCli.Text = Request.QueryString["CodCliente"];
if (qsVal("Data") != "")
{
data = Convert.ToDateTime(qsVal("Data"));
}
DayPilotCalendar1.TimeRangeSelected += DayPilotCalendar1_TimeRangeSelected;
DayPilotCalendar1.EventMove += DayPilotCalendar1_EventMove;
}
public string CodCliente
{
get
{
return qsVal("CodCliente");
}
}
public string Indir
{
get
{
return qsVal("Indir");
}
}
public string Data
{
get
{
return qsVal("Data");
}
}
/// <summary>
/// recupera valore querystring
/// </summary>
/// <param name="nome"></param>
/// <returns></returns>
protected string qsVal(string nome)
{
string answ = "";
try
{
answ = Request.QueryString[nome].ToString();
}
catch
{ }
return answ;
}
void DayPilotCalendar1_EventMove(object sender, DayPilot.Web.Ui.Events.EventMoveEventArgs e)
{
// sposto evento!
DtProxy.man.taImp.updStart(Convert.ToInt32(e.Id), e.NewStart);
doUpdate();
}
/// <summary>
/// evento selezione periodo inizio
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void DayPilotCalendar1_TimeRangeSelected(object sender, DayPilot.Web.Ui.Events.TimeRangeSelectedEventArgs e)
{
// se ho squadra selezionata...
if (rblSquadre.SelectedIndex >= 0)
{
// recupero indirizzo e cliente !!FARE!!!
// selezionato periodo, salvo evento inizio...
DtProxy.man.taImp.insertQuery(e.Start, "INDIC", rblSquadre.SelectedValue, "OC00000000");
}
doUpdate();
}
private void doUpdate()
{
//ods.DataBind();
//rblSquadre.SelectedIndex = -1;
DayPilotCalendar1.DataBind();
DayPilotCalendar1.Update();
reportEvent();
}
/// <summary>
/// data di riferimento
/// </summary>
public DateTime data
{
get
{
DateTime answ = DateTime.Now;
try
{
answ = DayPilotCalendar1.StartDate;
}
catch
{ }
return answ;
}
set
{
DayPilotCalendar1.StartDate = value;
lblData.Text = value.ToString("yyyy/MM/dd");
}
}
/// <summary>
/// selezione nuova squadra...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void rblSquadre_SelectedIndexChanged(object sender, EventArgs e)
{
// aggiorno controllo...
}
protected void btnAllSquadre_Click(object sender, EventArgs e)
{
// resetto sel rbl
rblSquadre.SelectedIndex = -1;
}
/// <summary>
/// intercetto e cambio classe CSS...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void DayPilotCalendar1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Calendar.BeforeEventRenderEventArgs e)
{
try
{
// this assumes your event object in Events collection has "color" field or property
e.BackgroundColor = (string)e.DataItem["CssColor"];
}
catch
{ }
}
protected void DayPilotCalendar1_EventClick(object sender, DayPilot.Web.Ui.Events.EventClickEventArgs e)
{
#if false
Response.Redirect(string.Format("{0}?CodCliente={1}&Indir={2}&Data={3:yyyy-MM-dd}&IdxImpegno={4}", devicesAuthProxy.pagCorrente, qsVal("CodCliente"), qsVal("Indir"), qsVal("Data"), e.Id));
#endif
}
}
}
+78
View File
@@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebSCR.WebUserControls {
public partial class mod_giornata {
/// <summary>
/// lblCodCli 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 lblCodCli;
/// <summary>
/// lblData 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 lblData;
/// <summary>
/// btnAllSquadre 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 btnAllSquadre;
/// <summary>
/// rblSquadre 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.RadioButtonList rblSquadre;
/// <summary>
/// odsSquadre 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.ObjectDataSource odsSquadre;
/// <summary>
/// DayPilotCalendar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::DayPilot.Web.Ui.DayPilotCalendar DayPilotCalendar1;
/// <summary>
/// ods 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.ObjectDataSource ods;
}
}
+2
View File
@@ -0,0 +1,2 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_impegno.ascx.cs" Inherits="WebSCR.WebUserControls.mod_impegno" %>
IMPEGNO
@@ -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 WebSCR.WebUserControls
{
public partial class mod_impegno : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
+17
View File
@@ -0,0 +1,17 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebSCR.WebUserControls
{
public partial class mod_impegno
{
}
}
@@ -1,9 +1,10 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_pianificazione.ascx.cs" Inherits="WebSCR.WebUserControls.mod_pianificazione" %>
<%@ Register Src="~/WebUserControls/mod_resocontoImpegni.ascx" TagName="mod_resocontoImpegni" TagPrefix="uc3" %>
<%@ Register Src="~/WebUserControls/mod_filtroZona.ascx" TagPrefix="uc1" TagName="mod_filtroZona" %>
<%@ Register Src="~/WebUserControls/mod_filtroPeriodo.ascx" TagPrefix="uc1" TagName="mod_filtroPeriodo" %>
<%@ Register Src="~/WebUserControls/mod_dispPeriodo.ascx" TagPrefix="uc1" TagName="mod_dispPeriodo" %>
<%@ Register Src="~/WebUserControls/mod_giornata.ascx" TagPrefix="uc1" TagName="mod_giornata" %>
<%@ Register Src="~/WebUserControls/mod_impegno.ascx" TagPrefix="uc1" TagName="mod_impegno" %>
<div>
<uc1:mod_filtroZona runat="server" ID="mod_filtroZona" />
@@ -16,7 +17,8 @@
<uc1:mod_dispPeriodo runat="server" id="mod_dispPeriodo" />
</div>
<div class="ui-block-b">
<uc3:mod_resocontoImpegni ID="mod_resocontoImpegni1" runat="server" />
<uc1:mod_giornata runat="server" id="mod_giornata" />
<uc1:mod_impegno runat="server" id="mod_impegno" />
</div>
</div>
@@ -44,53 +44,15 @@ namespace WebSCR.WebUserControls
protected string qsVal(string nome)
{
return memLayer.ML.QSS(nome);
#if false
string answ = "";
try
{
answ = Request.QueryString[nome].ToString();
}
catch
{ }
return answ;
#endif
}
/// <summary>
/// imposta visibilità dato elementi già impostati
/// </summary>
private void fixVisibility()
{
#if false
if (true)
{
#endif
// imposto zona...
mod_dispPeriodo.Zona = mod_filtroZona.Zona;
mod_filtroPeriodo.Visible = true;
#if false
}
// vecchia modalità con selezione "Pre" dell'indirizzo...
else
{
// controllo se c'è CodCliente
if ((qsVal("CodCliente") != "") && memLayer.ML.isInSessionObject("CodCliente") && memLayer.ML.isInSessionObject("Cliente"))
{
mod_filtroZona.Visible = true;
}
// controllo se c'è indirizzo...
if (qsVal("Indir") != "")
{
// imposto zona...
mod_selettoreSlot1.Zona = "Z00"; // mod_selettoreIndirizzo1.selAddr.zona;
mod_selettoreSlot1.Visible = true;
}
else
{
mod_selettoreSlot1.Visible = false;
}
}
#endif
}
/// <summary>
/// evento selezione indirizzo, allora mostro il resto
+11 -2
View File
@@ -40,12 +40,21 @@ namespace WebSCR.WebUserControls {
protected global::WebSCR.WebUserControls.mod_dispPeriodo mod_dispPeriodo;
/// <summary>
/// mod_resocontoImpegni1 control.
/// mod_giornata control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebSCR.WebUserControls.mod_resocontoImpegni mod_resocontoImpegni1;
protected global::WebSCR.WebUserControls.mod_giornata mod_giornata;
/// <summary>
/// mod_impegno control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebSCR.WebUserControls.mod_impegno mod_impegno;
}
}
@@ -3,12 +3,5 @@
<%@ Register Src="~/WebUserControls/mod_schedaGiorno.ascx" TagPrefix="uc4" TagName="mod_schedaGiorno" %>
<%@ Register Src="~/WebUserControls/mod_dettImpegno.ascx" TagPrefix="uc5" TagName="mod_dettImpegno" %>
<%--<div class="ui-grid-a ui-mini">
<div class="ui-block-a">
</div>
<div class="ui-block-b">--%>
<uc4:mod_schedaGiorno runat="server" ID="mod_schedaGiorno" />
<uc5:mod_dettImpegno runat="server" ID="mod_dettImpegno" />
<%-- </div>
</div>--%>
<uc4:mod_schedaGiorno runat="server" ID="mod_schedaGiorno" />
<uc5:mod_dettImpegno runat="server" ID="mod_dettImpegno" />
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.