typo pre modifica
This commit is contained in:
Binary file not shown.
@@ -9,222 +9,222 @@ using WebSCR_data;
|
||||
|
||||
namespace WebSCR.WebUserControls
|
||||
{
|
||||
public partial class mod_giornata : System.Web.UI.UserControl
|
||||
public partial class mod_giornata : System.Web.UI.UserControl
|
||||
{
|
||||
public event EventHandler eh_newData;
|
||||
/// <summary>
|
||||
/// solleva evento selezione data
|
||||
/// </summary>
|
||||
protected void reportEvent()
|
||||
{
|
||||
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;
|
||||
// controllo SE si tratta di reload faccio update...
|
||||
if (memLayer.ML.BoolSessionObj("forceUpdate"))
|
||||
{
|
||||
memLayer.ML.setSessionVal("forceUpdate", false);
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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 se sia EFFETTIVO spostamento (altrimenti è edit...)
|
||||
if (e.NewStart == e.OldStart && e.NewEnd == e.OldEnd)
|
||||
{
|
||||
// rimando a edit!!!
|
||||
Response.Redirect(string.Format("{0}?Action=EDIT&CodCliente={1}&Indir={2}&Data={3}&IdxImpegno={4}", devicesAuthProxy.pagCorrente, CodCliente, Indir, Data, e.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
// controllo che sia presente matricola altrimenti NON lo permetto...
|
||||
if (matrOp != "")
|
||||
{
|
||||
// sposto evento!
|
||||
DtProxy.man.taImp.updStart(Convert.ToInt32(e.Id), e.NewStart, matrOp, DateTime.Now);
|
||||
if (memLayer.ML.confReadBool("svuotaMatrOpMove"))
|
||||
{
|
||||
// rimuovo matrOp
|
||||
memLayer.ML.emptySessionVal("matrOp");
|
||||
errorMess = "spostamento effettuato";
|
||||
}
|
||||
doUpdate();
|
||||
Response.Redirect(devicesAuthProxy.pagCorrente);
|
||||
}
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
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(Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Eccezione in cambio colore evento:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
// controllo SE si tratta di reload faccio update...
|
||||
if (memLayer.ML.BoolSessionObj("forceUpdate"))
|
||||
{
|
||||
memLayer.ML.setSessionVal("forceUpdate", false);
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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 se sia EFFETTIVO spostamento (altrimenti è edit...)
|
||||
if (e.NewStart == e.OldStart && e.NewEnd == e.OldEnd)
|
||||
{
|
||||
// rimando a edit!!!
|
||||
Response.Redirect(string.Format("{0}?Action=EDIT&CodCliente={1}&Indir={2}&Data={3}&IdxImpegno={4}", devicesAuthProxy.pagCorrente, CodCliente, Indir, Data, e.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
// controllo che sia presente matricola altrimenti NON lo permetto...
|
||||
if (matrOp != "")
|
||||
{
|
||||
// sposto evento!
|
||||
DtProxy.man.taImp.updStart(Convert.ToInt32(e.Id), e.NewStart, matrOp, DateTime.Now);
|
||||
if (memLayer.ML.confReadBool("svuotaMatrOpMove"))
|
||||
{
|
||||
// rimuovo matrOp
|
||||
memLayer.ML.emptySessionVal("matrOp");
|
||||
errorMess = "spostamento effettuato";
|
||||
}
|
||||
doUpdate();
|
||||
Response.Redirect(devicesAuthProxy.pagCorrente);
|
||||
}
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
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 (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Eccezione in cambio colore evento:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace WebSCR.WebUserControls
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se ci sia matricola in sessione (CON VALORE > 1000...
|
||||
/// verifica se ci sia matricola in sessione (CON VALORE > 1000...)
|
||||
/// </summary>
|
||||
public bool hasMatricolaKilo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user