Inserito e ristilizzato list value mgmt
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_listValues.ascx.cs"
|
||||
Inherits="CMS_SC.WebUserControls.mod_listValues" %>
|
||||
|
||||
|
||||
<div class="row" style="font-size: 8pt; margin-top: 5px;">
|
||||
<div class="col-sm-2">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-btn">
|
||||
<asp:DropDownList ID="ddlTable" runat="server" AutoPostBack="True" CssClass="btn btn-default dropdown-toggle" Font-Size="X-Small" DataSourceID="odsTableName" DataTextField="TableName" DataValueField="TableName" AppendDataBoundItems="true" OnSelectedIndexChanged="ddlTable_SelectedIndexChanged">
|
||||
<asp:ListItem Value="" Selected="True">--- Select ---</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<asp:LinkButton ID="lbShowNew" runat="server" OnClick="btnShowInsert" CssClass="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<asp:Label ID="lblBtnShowNew" runat="server" Text="..." />
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-sm-8" style="height: 5em;">
|
||||
<div runat="server" id="divInsert">
|
||||
<div class="col-sm-3">
|
||||
<%: traduci("TableName") %>:
|
||||
<asp:TextBox runat="server" ID="txtTableName" />
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<%: traduci("FieldName") %>:
|
||||
<asp:TextBox runat="server" ID="txtFieldName" />
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<%: traduci("value") %>:
|
||||
<asp:TextBox runat="server" ID="txtvalue" />
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<asp:LinkButton ID="btnDoInsert" runat="server" CssClass="btn btn-default" OnClick="btnDoInsert_Click">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<%: traduci("insertNew") %>
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<asp:GridView ID="grView" runat="server" DataSourceID="ods" AllowPaging="True" AllowSorting="True"
|
||||
DataKeyNames="TableName,FieldName,value" AutoGenerateColumns="False" CssClass="table table-striped table-bordered"
|
||||
OnDataBound="grView_DataBound">
|
||||
<EmptyDataTemplate>
|
||||
<h3>
|
||||
<asp:Label runat="server" ID="lblNoRes" Text='<%# traduci("NoResultsFound") %>' />
|
||||
</h3>
|
||||
<asp:Label runat="server" ID="Label4" Text='<%# traduci("PleaseSelectFromList") %>' />
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbUpdate" CausesValidation="true" CommandName="Update"><i class="fa fa-check fa-2x"></i></asp:LinkButton><asp:LinkButton runat="server" ID="lbCancel" CausesValidation="false" CommandName="Cancel"><i class="fa fa-undo fa-2x"></i></asp:LinkButton>
|
||||
</EditItemTemplate>
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbEdit" CausesValidation="false" CommandName="Edit"><i class="fa fa-edit fa-2x"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="TableName" HeaderText="TableName" ReadOnly="True" SortExpression="TableName" />
|
||||
<asp:BoundField DataField="FieldName" HeaderText="FieldName" ReadOnly="True" SortExpression="FieldName" />
|
||||
<asp:BoundField DataField="value" HeaderText="value" ReadOnly="True" SortExpression="value" />
|
||||
<asp:TemplateField HeaderText="label" SortExpression="label">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("label") %>' />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Bind("label") %>' />
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("label") %>' Width="20em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="ordinal" SortExpression="ordinal">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ordinal") %>' Width="3em" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Bind("ordinal") %>' />
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:TextBox ID="txtordinal" runat="server" Text='<%# Bind("ordinal") %>' Width="3em" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="lbtReset" runat="server" OnClick="btnShowFooter" CssClass="btn btn-default" Visible="true"><i class="glyphicon glyphicon-plus"></i> <%: traduci("btnNewListVal") %></asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<EditItemTemplate>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbDelete" CausesValidation="false" CommandName="Delete" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>'><i class="fa fa-trash-o fa-2x"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
|
||||
<asp:ObjectDataSource ID="ods" runat="server" InsertMethod="insertQuery"
|
||||
OldValuesParameterFormatString="Original_{0}" SelectMethod="getByTable" FilterExpression=" (value like '%{0}%' OR label like '%{0}%' OR (CONVERT(ordinal, 'System.String') LIKE '%{0}%')) "
|
||||
TypeName="CMS_SC_Data.DS_UtilityTableAdapters.ListValuesTableAdapter" DeleteMethod="deleteQuery" UpdateMethod="updateQuery">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="ddlTable" PropertyName="SelectedValue" Name="TableName"
|
||||
DefaultValue="" Type="String" />
|
||||
</SelectParameters>
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_TableName" Type="String" />
|
||||
<asp:Parameter Name="Original_FieldName" Type="String" />
|
||||
<asp:Parameter Name="Original_value" Type="String" />
|
||||
</DeleteParameters>
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter Type="String" Name="valore" SessionField="searchVal" />
|
||||
</FilterParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="TableName" Type="String" />
|
||||
<asp:Parameter Name="FieldName" Type="String" />
|
||||
<asp:Parameter Name="value" Type="String" />
|
||||
<asp:Parameter Name="label" Type="String" />
|
||||
<asp:Parameter Name="ordinal" Type="Int32" />
|
||||
</InsertParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="label" Type="String" />
|
||||
<asp:Parameter Name="ordinal" Type="Int32" />
|
||||
<asp:Parameter Name="Original_TableName" Type="String" />
|
||||
<asp:Parameter Name="Original_FieldName" Type="String" />
|
||||
<asp:Parameter Name="Original_value" Type="String" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource ID="odsTableName" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="getDistTableName" TypeName="CMS_SC_Data.DS_UtilityTableAdapters.ListValuesTableAdapter"></asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
|
||||
namespace CMS_SC.WebUserControls
|
||||
{
|
||||
public partial class mod_listValues : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
lbShowNew.Enabled = true;
|
||||
lblBtnShowNew.Text = traduci("btnNewListVal");
|
||||
divInsert.Visible = false;
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// dimensione pagina grid view
|
||||
/// </summary>
|
||||
public int pageSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return grView.PageSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
grView.PageSize = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
/// <summary>
|
||||
/// effettuo update
|
||||
/// </summary>
|
||||
private void doUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// reset selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
// deseleziono e nascondo pnl statistiche...
|
||||
grView.SelectedIndex = -1;
|
||||
}
|
||||
/// <summary>
|
||||
/// mostra footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnShowInsert(object sender, EventArgs e)
|
||||
{
|
||||
// SE HO SELEZIONATO UN VALORE!!!
|
||||
if (ddlTable.SelectedIndex > 0)
|
||||
{
|
||||
// inverto visibilità insert nuovi valori
|
||||
divInsert.Visible = !divInsert.Visible;
|
||||
if (divInsert.Visible)
|
||||
{
|
||||
lblBtnShowNew.Text = traduci("btnHideNewListVal");
|
||||
// precompilo valori tabella
|
||||
txtTableName.Text = ddlTable.SelectedValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblBtnShowNew.Text = traduci("btnNewListVal");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// evento post "aggancio" del grView x traduzione headers
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
protected void ddlTable_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// se seleziono valore "vuoto" resetto...
|
||||
if (ddlTable.SelectedIndex == 0)
|
||||
{
|
||||
lblBtnShowNew.Text = traduci("btnNewListVal");
|
||||
divInsert.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
txtTableName.Text = ddlTable.SelectedValue;
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnDoInsert_Click(object sender, EventArgs e)
|
||||
{
|
||||
// effettua insert!
|
||||
CMS_SC_Data.DtProxy.man.taListVal.insertQuery(txtTableName.Text.Trim(), txtFieldName.Text.Trim(), txtvalue.Text.Trim(), txtvalue.Text.Trim(), 999);
|
||||
// refresh dati!
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CMS_SC.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_listValues {
|
||||
|
||||
/// <summary>
|
||||
/// ddlTable control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlTable;
|
||||
|
||||
/// <summary>
|
||||
/// lbShowNew control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbShowNew;
|
||||
|
||||
/// <summary>
|
||||
/// lblBtnShowNew control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblBtnShowNew;
|
||||
|
||||
/// <summary>
|
||||
/// divInsert control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divInsert;
|
||||
|
||||
/// <summary>
|
||||
/// txtTableName control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtTableName;
|
||||
|
||||
/// <summary>
|
||||
/// txtFieldName control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtFieldName;
|
||||
|
||||
/// <summary>
|
||||
/// txtvalue control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtvalue;
|
||||
|
||||
/// <summary>
|
||||
/// btnDoInsert control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnDoInsert;
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumRec control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumRec;
|
||||
|
||||
/// <summary>
|
||||
/// lblWarning control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWarning;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// odsTableName control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsTableName;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" id="A4" runat="server" href="~/Default">
|
||||
<img src="~/Images/LogoCms.png?h=70&w=160&mode=max" alt="Costimate" class="img-responsive" runat="server" id="imgLogo" />
|
||||
<img src="~/Images/LogoCms.png?h=70&w=160&mode=max" alt="CMS" class="img-responsive" runat="server" id="imgLogo" />
|
||||
</a>
|
||||
<div class="subnavbar">
|
||||
<div class="subnavbar-inner">
|
||||
|
||||
Reference in New Issue
Block a user