Update x gestione pagina SchedaTech

This commit is contained in:
Samuele E. Locatelli
2020-11-09 15:58:02 +01:00
parent f34c3929d5
commit 2a4fdf6138
18 changed files with 829 additions and 407 deletions
+103 -28
View File
@@ -10,6 +10,40 @@ namespace MoonProTablet.WebUserControls
{
public partial class cmp_ST_objView : BaseUserControl
{
#region Public Properties
public string dataCss
{
get
{
string answ = "";
if (required)
{
if (dataValue != extCode)
{
answ = " text-danger";
}
else
{
answ = " text-success";
}
}
return answ;
}
}
public string dataLabel
{
get
{
return hfLabel.Value.Trim();
}
set
{
hfLabel.Value = value.Trim();
}
}
public string dataType
{
get
@@ -22,17 +56,7 @@ namespace MoonProTablet.WebUserControls
fixDisplay();
}
}
public string dataLabel
{
get
{
return hfLabel.Value.Trim();
}
set
{
hfLabel.Value = value.Trim();
}
}
public string dataValue
{
get
@@ -44,28 +68,20 @@ namespace MoonProTablet.WebUserControls
hfValue.Value = value.Trim();
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
private void fixDisplay()
public string extCode
{
divImg.Visible = false;
divTxt.Visible = false;
switch (dataType)
get
{
case "IMG":
divImg.Visible = true;
break;
case "TXT":
divTxt.Visible = true;
break;
default:
divTxt.Visible = true;
break;
return hfExtCode.Value.Trim();
}
set
{
hfExtCode.Value = value.Trim();
fixDisplay();
}
}
/// <summary>
/// Url immagine SE richiesta
/// </summary>
@@ -94,5 +110,64 @@ namespace MoonProTablet.WebUserControls
}
}
public bool required
{
get
{
bool answ = false;
bool.TryParse(hfRequired.Value.Trim(), out answ);
return answ;
}
set
{
hfRequired.Value = value.ToString();
fixDisplay();
}
}
public bool showMissingData
{
get
{
bool answ = false;
if (required && (dataValue != extCode))
{
answ = true;
}
return answ;
}
}
#endregion Public Properties
#region Private Methods
private void fixDisplay()
{
divImg.Visible = false;
divTxt.Visible = false;
switch (dataType)
{
case "IMG":
divImg.Visible = true;
break;
case "TXT":
default:
divTxt.Visible = true;
break;
}
lblError.Visible = showMissingData;
}
#endregion Private Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
}
#endregion Protected Methods
}
}