Fix gestione reset operatore in post multi
This commit is contained in:
+175
-177
@@ -2,188 +2,186 @@
|
||||
|
||||
namespace AppData
|
||||
{
|
||||
public class mUtils
|
||||
{
|
||||
|
||||
#region definizione Regexp
|
||||
/// <summary>
|
||||
/// RegExp x Cod ARTICOLO
|
||||
/// </summary>
|
||||
public static string reCodArt = memLayer.ML.cdv("regExp_CodArt");
|
||||
/// <summary>
|
||||
/// RegExp x Cod OPERATORE
|
||||
/// </summary>
|
||||
public static string reCodOper = memLayer.ML.cdv("regExp_CodOper");
|
||||
/// <summary>
|
||||
/// RegExp x Cod POSTAZIONE
|
||||
/// </summary>
|
||||
public static string reCodPost = memLayer.ML.cdv("regExp_CodPost");
|
||||
/// <summary>
|
||||
/// RegExp x Cod COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reNumTask = memLayer.ML.cdv("regExp_NumTask");
|
||||
/// <summary>
|
||||
/// RegExp x QTA
|
||||
/// </summary>
|
||||
public static string reQta = memLayer.ML.cdv("regExp_QtaRic");
|
||||
/// <summary>
|
||||
/// RegExp x RESET / CANCEL
|
||||
/// </summary>
|
||||
public static string reReset = memLayer.ML.cdv("regExp_KO");
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA ADD
|
||||
/// </summary>
|
||||
public static string reAddNew = memLayer.ML.cdv("regExp_AddNew");
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA DELETE
|
||||
/// </summary>
|
||||
public static string reDelete = memLayer.ML.cdv("regExp_DEL");
|
||||
/// <summary>
|
||||
/// Comando x RESET OPERATORE
|
||||
/// </summary>
|
||||
public static string reCmdResetOper = memLayer.ML.cdv("regExp_CmdResetOper");
|
||||
/// <summary>
|
||||
/// Comando x RESET COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdResetNumTask = memLayer.ML.cdv("regExp_CmdResetNumTask");
|
||||
/// <summary>
|
||||
/// Comando x PAUSA (es COMMESSA/NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdPause = memLayer.ML.cdv("regExp_CmdPause");
|
||||
/// <summary>
|
||||
/// Comando x CHIUSURA COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdClose = memLayer.ML.cdv("regExp_CmdClose");
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitato BCode
|
||||
/// </summary>
|
||||
public static bool OptUseBCode = memLayer.ML.CRB("OptUseBCode");
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TASK/COMMESSA
|
||||
/// </summary>
|
||||
public static bool OptUseSelTask = memLayer.ML.CRB("OptUseSelTask");
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TAG
|
||||
/// </summary>
|
||||
public static bool OptUseSelTag = memLayer.ML.CRB("OptUseSelTag");
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è da eseguire il preprocessing
|
||||
/// </summary>
|
||||
public static bool OptBCodePrepDo = memLayer.ML.CRB("OptBCodePrepDo");
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati raw x preprocessare
|
||||
/// </summary>
|
||||
public static string rePreproc = memLayer.ML.cdv("regExp_Preproc");
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati da TENERE post preprocessing
|
||||
/// </summary>
|
||||
public static string rePreprocKeep = memLayer.ML.cdv("regExp_PreprocKeep");
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public static string CodOpr
|
||||
public class mUtils
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodOpr");
|
||||
// se vuoto cerco anche nei cookies...
|
||||
if (answ == "")
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodOpr");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodOpr", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodOpr", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodOpr", value);
|
||||
memLayer.ML.emptySessionVal("NomeOpr");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public static string CodPost
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodPost");
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodPost");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodPost", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodPost", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodPost", value);
|
||||
memLayer.ML.emptySessionVal("DescPost");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce boolean se post corrente sia multi operatore
|
||||
/// </summary>
|
||||
public static bool postIsMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
if (memLayer.ML.isInSessionObject("postIsMulti"))
|
||||
{
|
||||
answ = memLayer.ML.BoolSessionObj("postIsMulti");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rawAnsw = memLayer.ML.getCookieVal("CTrack_postIsMulti");
|
||||
bool.TryParse(rawAnsw, out answ);
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("postIsMulti", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("postIsMulti", value);
|
||||
memLayer.ML.setCookieVal("CTrack_postIsMulti", value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// oggetto valore opzionale letto 8e scorporato da barcode), es TAG in commessa + tag
|
||||
/// </summary>
|
||||
public static string optValueBC
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ;
|
||||
if (memLayer.ML.isInSessionObject("optValueBC"))
|
||||
#region definizione Regexp
|
||||
/// <summary>
|
||||
/// RegExp x Cod ARTICOLO
|
||||
/// </summary>
|
||||
public static string reCodArt = memLayer.ML.cdv("regExp_CodArt");
|
||||
/// <summary>
|
||||
/// RegExp x Cod OPERATORE
|
||||
/// </summary>
|
||||
public static string reCodOper = memLayer.ML.cdv("regExp_CodOper");
|
||||
/// <summary>
|
||||
/// RegExp x Cod POSTAZIONE
|
||||
/// </summary>
|
||||
public static string reCodPost = memLayer.ML.cdv("regExp_CodPost");
|
||||
/// <summary>
|
||||
/// RegExp x Cod COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reNumTask = memLayer.ML.cdv("regExp_NumTask");
|
||||
/// <summary>
|
||||
/// RegExp x QTA
|
||||
/// </summary>
|
||||
public static string reQta = memLayer.ML.cdv("regExp_QtaRic");
|
||||
/// <summary>
|
||||
/// RegExp x RESET / CANCEL
|
||||
/// </summary>
|
||||
public static string reReset = memLayer.ML.cdv("regExp_KO");
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA ADD
|
||||
/// </summary>
|
||||
public static string reAddNew = memLayer.ML.cdv("regExp_AddNew");
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA DELETE
|
||||
/// </summary>
|
||||
public static string reDelete = memLayer.ML.cdv("regExp_DEL");
|
||||
/// <summary>
|
||||
/// Comando x RESET OPERATORE
|
||||
/// </summary>
|
||||
public static string reCmdResetOper = memLayer.ML.cdv("regExp_CmdResetOper");
|
||||
/// <summary>
|
||||
/// Comando x RESET COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdResetNumTask = memLayer.ML.cdv("regExp_CmdResetNumTask");
|
||||
/// <summary>
|
||||
/// Comando x PAUSA (es COMMESSA/NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdPause = memLayer.ML.cdv("regExp_CmdPause");
|
||||
/// <summary>
|
||||
/// Comando x CHIUSURA COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdClose = memLayer.ML.cdv("regExp_CmdClose");
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitato BCode
|
||||
/// </summary>
|
||||
public static bool OptUseBCode = memLayer.ML.CRB("OptUseBCode");
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TASK/COMMESSA
|
||||
/// </summary>
|
||||
public static bool OptUseSelTask = memLayer.ML.CRB("OptUseSelTask");
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TAG
|
||||
/// </summary>
|
||||
public static bool OptUseSelTag = memLayer.ML.CRB("OptUseSelTag");
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è da eseguire il preprocessing
|
||||
/// </summary>
|
||||
public static bool OptBCodePrepDo = memLayer.ML.CRB("OptBCodePrepDo");
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati raw x preprocessare
|
||||
/// </summary>
|
||||
public static string rePreproc = memLayer.ML.cdv("regExp_Preproc");
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati da TENERE post preprocessing
|
||||
/// </summary>
|
||||
public static string rePreprocKeep = memLayer.ML.cdv("regExp_PreprocKeep");
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public static string CodOpr
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("optValueBC");
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodOpr");
|
||||
// se vuoto cerco anche nei cookies...
|
||||
if (answ == "")
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodOpr");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodOpr", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodOpr", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodOpr", value);
|
||||
memLayer.ML.emptySessionVal("NomeOpr");
|
||||
}
|
||||
}
|
||||
else
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public static string CodPost
|
||||
{
|
||||
answ = "";
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodPost");
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodPost");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodPost", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodPost", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodPost", value);
|
||||
memLayer.ML.emptySessionVal("DescPost");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce boolean se post corrente sia multi operatore
|
||||
/// </summary>
|
||||
public static bool postIsMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
if (memLayer.ML.isInSessionObject("postIsMulti"))
|
||||
{
|
||||
answ = memLayer.ML.BoolSessionObj("postIsMulti");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rawAnsw = memLayer.ML.getCookieVal("CTrack_postIsMulti");
|
||||
bool.TryParse(rawAnsw, out answ);
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("postIsMulti", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("postIsMulti", value);
|
||||
memLayer.ML.setCookieVal("CTrack_postIsMulti", value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// oggetto valore opzionale letto 8e scorporato da barcode), es TAG in commessa + tag
|
||||
/// </summary>
|
||||
public static string optValueBC
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ;
|
||||
if (memLayer.ML.isInSessionObject("optValueBC"))
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("optValueBC");
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("optValueBC", value, false);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("optValueBC", value, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,142 +7,148 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_task2post : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqUpdate;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_task2post : System.Web.UI.UserControl
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (mUtils.postIsMulti)
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqUpdate;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
doUpdate();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (mUtils.postIsMulti)
|
||||
{
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
public void doUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog($"Eccezione in render gridView: CodPost = {memLayer.ML.StringSessionObj("CodPost")}");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Stato TASK da mostrare
|
||||
/// </summary>
|
||||
public bool taskIsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(hfIsActive.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfIsActive.Value = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se lo stato sia ATTIVO
|
||||
/// </summary>
|
||||
/// <param name="_IsActive"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkActive(object _IsActive)
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(_IsActive.ToString(), out answ);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// CodPost selezionato in sessione
|
||||
/// </summary>
|
||||
protected string codPost
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CodPost");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stato TASK da mostrare
|
||||
/// </summary>
|
||||
public bool taskIsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(hfIsActive.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfIsActive.Value = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se lo stato sia ATTIVO
|
||||
/// </summary>
|
||||
/// <param name="_IsActive"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkActive(object _IsActive)
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(_IsActive.ToString(), out answ);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// CodPost selezionato in sessione
|
||||
/// </summary>
|
||||
protected string codPost
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CodPost");
|
||||
}
|
||||
}
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string numTask = grView.SelectedValue.ToString();
|
||||
// chiamo toggle status, segnalo update!
|
||||
dataLayer.man.taTL2Post.ToggleActive(codPost, numTask);
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string numTask = grView.SelectedValue.ToString();
|
||||
// chiamo toggle status, segnalo update!
|
||||
dataLayer.man.taTL2Post.ToggleActive(codPost, numTask);
|
||||
reportUpdate();
|
||||
}
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
private void reportUpdate()
|
||||
{
|
||||
// invoco update...
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
private void reportUpdate()
|
||||
{
|
||||
// invoco update...
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Input da processare (tipo codOperatore...)...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Input da processare (tipo codOperatore...)...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Cod OPERATORE corrente
|
||||
/// </summary>
|
||||
public string NumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currNumTaskMulti");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currNumTaskMulti", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un operatore...
|
||||
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
|
||||
|
||||
/// <summary>
|
||||
/// Cod OPERATORE corrente
|
||||
/// </summary>
|
||||
public string NumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currNumTaskMulti");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currNumTaskMulti", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un operatore...
|
||||
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
|
||||
if (testNumTask.Success)
|
||||
{
|
||||
NumTask = value;
|
||||
string codTag = mUtils.optValueBC != "" ? mUtils.optValueBC : "";
|
||||
dataLayer.man.taTL2Post.InsertQuery(codPost, NumTask, codTag);
|
||||
reportUpdate();
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
if (testNumTask.Success)
|
||||
{
|
||||
NumTask = value;
|
||||
string codTag = mUtils.optValueBC != "" ? mUtils.optValueBC : "";
|
||||
dataLayer.man.taTL2Post.InsertQuery(codPost, NumTask, codTag);
|
||||
reportUpdate();
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
public bool showTag
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.CRB("OptUseSelTag");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool showTag
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.CRB("OptUseSelTag");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+676
-671
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user