235 lines
6.4 KiB
C#
235 lines
6.4 KiB
C#
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.Days = day2show;
|
|
}
|
|
|
|
public int day2show
|
|
{
|
|
get
|
|
{
|
|
int answ = memLayer.ML.CRI("day2show");
|
|
try
|
|
{
|
|
answ = memLayer.ML.IntSessionObj("day2show");
|
|
if (answ < 1) answ = memLayer.ML.CRI("day2show");
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal("day2show", value);
|
|
doUpdate();
|
|
}
|
|
}
|
|
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)
|
|
{
|
|
return memLayer.ML.QSS(nome);
|
|
}
|
|
protected void DayPilotCalendar1_EventMove(object sender, DayPilot.Web.Ui.Events.EventMoveEventArgs e)
|
|
{
|
|
// controllo che sia presente matricola altrimenti NON lo permetto...
|
|
if (matrOp != "")
|
|
{
|
|
// sposto evento!
|
|
DtProxy.man.taImp.updStart(Convert.ToInt32(e.Id), e.NewStart);
|
|
if (memLayer.ML.confReadBool("svuotaMatrOp"))
|
|
{
|
|
// rimuovo matrOp
|
|
memLayer.ML.emptySessionVal("matrOp");
|
|
errorMess = "spostamento effettuato";
|
|
}
|
|
doUpdate();
|
|
}
|
|
else
|
|
{
|
|
errorMess = "Attenzione manca matricola! prego selezionare prima di effettuare spostamento.";
|
|
//Response.Redirect(devicesAuthProxy.pagCorrente);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// anno selezionato
|
|
/// </summary>
|
|
public int yearSel
|
|
{
|
|
get
|
|
{
|
|
int answ = DateTime.Now.Year;
|
|
if (memLayer.ML.isInSessionObject("yearSel"))
|
|
{
|
|
answ = memLayer.ML.IntSessionObj("yearSel");
|
|
}
|
|
return answ;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// anno selezionato
|
|
/// </summary>
|
|
public string errorMess
|
|
{
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal("errorMess", value);
|
|
|
|
}
|
|
}
|
|
#if false
|
|
/// <summary>
|
|
/// richiesta refresh COMPLETO della pagina
|
|
/// </summary>
|
|
public bool needRefresh
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.BoolSessionObj("needRefresh");
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal("needRefresh", value);
|
|
}
|
|
}
|
|
#endif
|
|
|
|
public 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...
|
|
}
|
|
|
|
/// <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
|
|
{ }
|
|
}
|
|
|
|
public string matrOp
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj("matrOp");
|
|
}
|
|
}
|
|
public string currDoc
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj("currDoc");
|
|
}
|
|
}
|
|
public string codSquadra
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj("elencoSquadre").Split(',')[0].ToString();
|
|
}
|
|
}
|
|
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
|
|
}
|
|
|
|
}
|
|
} |