fix 2 punti asto, vers 113+
This commit is contained in:
@@ -158,11 +158,11 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-2 text-left">
|
||||
<uc1:mod_display ID="mod_display19" runat="server" etichetta='<%# traduci("WSR01_sim") %>' />
|
||||
<asp:TextBox Font-Bold="true" ID="TextBox3" runat="server" Text='<%# Bind("WSR01_sim", "{0:N0}") %>' />
|
||||
<asp:TextBox Font-Bold="true" ID="TextBox3" runat="server" Text='<%# Bind("WSR01_sim", "{0:N3}") %>' />
|
||||
</div>
|
||||
<div class="col-xs-2 text-left">
|
||||
<uc1:mod_display ID="mod_display20" runat="server" etichetta='<%# traduci("MSR01_sim") %>' />
|
||||
<asp:TextBox Font-Bold="true" ID="TextBox4" runat="server" Text='<%# Bind("MSR01_sim", "{0:N0}") %>' />
|
||||
<asp:TextBox Font-Bold="true" ID="TextBox4" runat="server" Text='<%# Bind("MSR01_sim", "{0:N3}") %>' />
|
||||
</div>
|
||||
<div class="col-xs-8 text-right">
|
||||
<uc1:mod_display ID="mod_display21" runat="server" etichetta='<%# traduci("NetProd01_sim") %>' />
|
||||
@@ -181,7 +181,7 @@
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
</asp:FormView>
|
||||
<asp:ObjectDataSource ID="odsQuotes" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByKey" TypeName="C2P_Data.DS_QuotesTableAdapters.QuoteFull_QTableAdapter" UpdateMethod="updateExtrParSim" OnUpdated="odsQuotes_Updated">
|
||||
<asp:ObjectDataSource ID="odsQuotes" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByKey" TypeName="C2P_Data.DS_QuotesTableAdapters.QuoteFull_QTableAdapter" UpdateMethod="updateExtrParSim" OnUpdated="odsQuotes_Updated" OnUpdating="odsQuotes_Updating">
|
||||
<SelectParameters>
|
||||
<asp:QueryStringParameter Name="QuoteType" QueryStringField="QuoteType" Type="String" />
|
||||
<asp:QueryStringParameter Name="CodQuote" QueryStringField="CodQuote" Type="Int64" />
|
||||
|
||||
@@ -62,5 +62,42 @@ namespace C2P.WebUserControls
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// intercetto evento update
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void odsQuotes_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
// verifico i campi che possono contenere "%" e percentuali x sistemare come decimal...
|
||||
e.InputParameters["WSR01_sim"] = fixPerc(e.InputParameters["WSR01_sim"].ToString());
|
||||
e.InputParameters["MSR01_sim"] = fixPerc(e.InputParameters["MSR01_sim"].ToString());
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema un valore stringa ad un decimal per valori "%" corretti, secondo regola
|
||||
/// - se > 1 è da dividere per 100
|
||||
/// - se contiene % è da dividere per 100
|
||||
/// - altrimenti è già da convertire decimal
|
||||
/// </summary>
|
||||
/// <param name="originalVal"></param>
|
||||
/// <returns></returns>
|
||||
protected decimal fixPerc(string originalVal)
|
||||
{
|
||||
decimal answ = 0;
|
||||
try
|
||||
{
|
||||
// inizio convertendo ..
|
||||
answ = Convert.ToDecimal(originalVal);
|
||||
// se > 1 divido per 100...
|
||||
if (answ > 1)
|
||||
{
|
||||
answ = answ / 100;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@
|
||||
</div>
|
||||
</EditItemTemplate>
|
||||
</asp:FormView>
|
||||
<asp:ObjectDataSource ID="odsQuotes" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByKey" TypeName="C2P_Data.DS_QuotesTableAdapters.QuoteFull_QTableAdapter" UpdateMethod="updatePackPar" OnUpdated="odsQuotes_Updated">
|
||||
<asp:ObjectDataSource ID="odsQuotes" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByKey" TypeName="C2P_Data.DS_QuotesTableAdapters.QuoteFull_QTableAdapter" UpdateMethod="updatePackPar" OnUpdated="odsQuotes_Updated" OnUpdating="odsQuotes_Updating">
|
||||
<SelectParameters>
|
||||
<asp:QueryStringParameter Name="QuoteType" QueryStringField="QuoteType" Type="String" />
|
||||
<asp:QueryStringParameter Name="CodQuote" QueryStringField="CodQuote" Type="Int64" />
|
||||
|
||||
@@ -62,5 +62,42 @@ namespace C2P.WebUserControls
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// intercetto evento update
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void odsQuotes_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
// verifico i campi che possono contenere "%" e percentuali x sistemare come decimal...
|
||||
e.InputParameters["DSR_sim"] = fixPerc(e.InputParameters["DSR_sim"].ToString());
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema un valore stringa ad un decimal per valori "%" corretti, secondo regola
|
||||
/// - se > 1 è da dividere per 100
|
||||
/// - se contiene % è da dividere per 100
|
||||
/// - altrimenti è già da convertire decimal
|
||||
/// </summary>
|
||||
/// <param name="originalVal"></param>
|
||||
/// <returns></returns>
|
||||
protected decimal fixPerc(string originalVal)
|
||||
{
|
||||
decimal answ = 0;
|
||||
try
|
||||
{
|
||||
// inizio convertendo ..
|
||||
answ = Convert.ToDecimal(originalVal);
|
||||
// se > 1 divido per 100...
|
||||
if (answ > 1)
|
||||
{
|
||||
answ = answ / 100;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user