Completato editing elencoSchede

This commit is contained in:
Samuele E. Locatelli
2015-09-10 16:06:14 +02:00
parent 555cfd7182
commit 4ac9f24f8c
21 changed files with 226 additions and 111 deletions
+28
View File
@@ -0,0 +1,28 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dossier.ascx.cs" Inherits="CMS_SC.WebUserControls.mod_dossier" %>
<div class="row text-center" style="font-size: 0.8em;">
<div class="col-xs-12">
<h4>Edit Dossier</h4>
</div>
<div class="col-xs-3">
<asp:DropDownList runat="server" ID="ddlFase" DataSourceID="odsFase" DataTextField="label" DataValueField="value" AutoPostBack="True" OnSelectedIndexChanged="ddlFase_SelectedIndexChanged">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsFase" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="CMS_SC_Data.DS_UtilityTableAdapters.v_selFasiTableAdapter"></asp:ObjectDataSource>
</div>
<div class="col-xs-9">
<asp:TextBox runat="server" ID="txtNote" TextMode="MultiLine" Width="100%" Height="6em" AutoPostBack="True" OnTextChanged="txtNote_TextChanged" />
</div>
<div class="col-xs-12" style="font-size: 1.5em;">
<div class="col-xs-4 col-xs-offset-2">
<asp:LinkButton runat="server" ID="lbtSalvaNote" class="btn btn-success" Visible="true" OnClick="lbtSalvaNote_Click" Width="200px" ForeColor="White">
<i class="fa fa-1x fa-floppy-o shortcut-icon"></i>
Salva
</asp:LinkButton>
</div>
<div class="col-xs-4">
<asp:LinkButton runat="server" ID="lbtResetNote" class="btn btn-danger" Visible="false" OnClick="lbtResetNote_Click" Width="200px" ForeColor="White">
<i class="fa fa-1x fa-ban shortcut-icon"></i>
Annulla
</asp:LinkButton>
</div>
</div>
</div>
@@ -0,0 +1,93 @@
using CMS_SC_Data;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CMS_SC.WebUserControls
{
public partial class mod_dossier : System.Web.UI.UserControl
{
/// <summary>
/// evento valore selezionato
/// </summary>
public event EventHandler eh_valUpdated;
protected void raiseEvent()
{
// sollevo evento nuovo valore...
if (eh_valUpdated != null)
{
eh_valUpdated(this, new EventArgs());
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
public int idxDossier
{
get
{
return memLayer.ML.IntSessionObj("idxDossierEdit");
}
set
{
memLayer.ML.setSessionVal("idxDossierEdit", value);
}
}
/// <summary>
/// carica campo note e mostra editing...
/// </summary>
public void fixNote()
{
if (idxDossier > 0)
{
DS_Applicazione.ElencoDossierRow riga = DtProxy.man.taED.getByDossier(idxDossier)[0];
txtNote.Text = riga.Note;
ddlFase.SelectedValue = riga.Stato;
}
}
/// <summary>
/// mostra btn salvataggio / annullamento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtNote_TextChanged(object sender, EventArgs e)
{
// mostra button salvataggio/annulla
showNoteBtn(true);
}
public void showNoteBtn(bool showSaveCancel)
{
lbtResetNote.Visible = showSaveCancel;
lbtSalvaNote.Visible = showSaveCancel;
}
protected void lbtResetNote_Click(object sender, EventArgs e)
{
fixNote();
showNoteBtn(false);
}
protected void lbtSalvaNote_Click(object sender, EventArgs e)
{
// salvo
if (idxDossier > 0)
{
DtProxy.man.taED.updateNote(idxDossier, ddlFase.SelectedValue, txtNote.Text.Trim());
}
// ricarico
fixNote();
showNoteBtn(false);
raiseEvent();
}
protected void ddlFase_SelectedIndexChanged(object sender, EventArgs e)
{
// mostra button salvataggio/annulla
showNoteBtn(true);
}
}
}
+60
View File
@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <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_dossier {
/// <summary>
/// ddlFase 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 ddlFase;
/// <summary>
/// odsFase 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 odsFase;
/// <summary>
/// txtNote 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 txtNote;
/// <summary>
/// lbtSalvaNote 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 lbtSalvaNote;
/// <summary>
/// lbtResetNote 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 lbtResetNote;
}
}