sistemato file (con completo editing7upload/delete) vers 0.9!!!

This commit is contained in:
Samuele E. Locatelli
2015-05-14 14:55:58 +02:00
parent 4eb3756229
commit 2ca0efcc9d
17 changed files with 70 additions and 64 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
using System.Reflection;
[assembly: AssemblyVersion("0.8.028.43")]
[assembly: AssemblyFileVersion("0.8.028.43")]
[assembly: AssemblyVersion("0.9.030.43")]
[assembly: AssemblyFileVersion("0.9.030.43")]
[assembly: AssemblyCopyright("Steamware © 2015-2015")]
[assembly: AssemblyCompany("Steamware")]
+2 -2
View File
@@ -6,8 +6,8 @@
using System.Reflection;
[assembly: AssemblyVersion("0.8.028.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("0.8.028.<#= this.RevisionNumber #>")]
[assembly: AssemblyVersion("0.9.030.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("0.9.030.<#= this.RevisionNumber #>")]
[assembly: AssemblyCopyright("Steamware © 2015-<#= DateTime.Now.Year #>")]
[assembly: AssemblyCompany("Steamware")]
<#+
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+7 -3
View File
@@ -4,6 +4,7 @@
<%@ Register Src="~/WebUserControls/mod_dettInt.ascx" TagPrefix="uc1" TagName="mod_dettInt" %>
<%@ Register Src="~/WebUserControls/mod_ImpegnoSmall.ascx" TagPrefix="uc1" TagName="mod_ImpegnoSmall" %>
<%@ Register Src="~/WebUserControls/mod_gestIntSquadra.ascx" TagPrefix="uc1" TagName="mod_gestIntSquadra" %>
<%@ Register Src="~/WebUserControls/mod_fileUpload.ascx" TagPrefix="uc1" TagName="mod_fileUpload" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
@@ -11,8 +12,11 @@
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="ui-mini" style="margin: 2px; padding: 2px;">
<uc1:mod_consegne runat="server" ID="mod_consegne" />
<uc1:mod_gestIntSquadra runat="server" id="mod_gestIntSquadra" />
<uc1:mod_ImpegnoSmall runat="server" id="mod_ImpegnoSmall" />
<uc1:mod_dettInt runat="server" ID="mod_dettInt" disableEdit="true" />
<uc1:mod_gestIntSquadra runat="server" ID="mod_gestIntSquadra" />
<uc1:mod_ImpegnoSmall runat="server" ID="mod_ImpegnoSmall" />
<div id="divFile" runat="server" style="text-align: center; margin: 2px auto; padding: 2px; border: 1px solid #333333;" class="ui-shadow ui-corner-all">
<uc1:mod_fileupload runat="server" ID="mod_fileUpload" />
</div>
<uc1:mod_dettInt runat="server" ID="mod_dettInt" disableEdit="true" />
</div>
</asp:Content>
+2
View File
@@ -42,6 +42,7 @@ namespace WebSCR
mod_consegne.Visible = true;
mod_dettInt.Visible = false;
mod_ImpegnoSmall.Visible = false;
divFile.Visible = false;
mod_gestIntSquadra.Visible = false;
if (qsVal("Data") != "")
{
@@ -50,6 +51,7 @@ namespace WebSCR
mod_gestIntSquadra.Visible = true;
mod_ImpegnoSmall.Visible = true;
mod_dettInt.Visible = true;
divFile.Visible = true;
mod_consegne.Visible = false;
}
else
+18
View File
@@ -39,6 +39,24 @@ namespace WebSCR {
/// </remarks>
protected global::WebSCR.WebUserControls.mod_ImpegnoSmall mod_ImpegnoSmall;
/// <summary>
/// divFile 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 divFile;
/// <summary>
/// mod_fileUpload control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebSCR.WebUserControls.mod_fileUpload mod_fileUpload;
/// <summary>
/// mod_dettInt control.
/// </summary>
+1 -1
View File
@@ -14,7 +14,7 @@
<SortedDescendingHeaderStyle BackColor="#4870BE" />
<AlternatingRowStyle BackColor="White" />
<EmptyDataTemplate>
Nessun risultato
Nessuna Consegna
</EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="Appuntamento" SortExpression="DataOra">
+19 -19
View File
@@ -6,11 +6,11 @@
</div>
<div id="divFileUpl" runat="server">
<div style="width: 75%; float: left; padding: 4px;">
<div style="width: 100%;">
<asp:FileUpload ID="FileUpload1" runat="server" />
</div>
<div style="width: 23%; float: right; padding: 4px;">
<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="Upload" />
<div style="width: 100%;">
<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="Upload" data-theme="b" />
</div>
</div>
<asp:GridView ID="grView" runat="server" Width="100%" AutoGenerateColumns="False" DataSourceID="odsFile" DataKeyNames="idxFile" OnSelectedIndexChanged="grView_SelectedIndexChanged">
@@ -31,19 +31,19 @@
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FileName") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkDownload" runat="server" OnClick="DownloadFile"
CommandArgument='<%# Eval("idxFile") %>'>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("FileName") %>'></asp:Label>
</asp:LinkButton>
<div>
<asp:LinkButton ID="lnkDownload" runat="server" OnClick="DownloadFile"
CommandArgument='<%# Eval("idxFile") %>'>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("FileName") %>' />
</asp:LinkButton>
</div>
<div>
<asp:Label CssClass="flLeft" ID="lblDataMod" runat="server" Text='<%# Eval("DataMod","{0:yyyy-MM-dd HH:mm}") %>' Font-Size="0.7em" />
<asp:Label CssClass="flRight" ID="lblSize" runat="server" Text='<%# Eval("Size","{0:N0} kb") %>' Font-Size="0.8em" />
</div>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField DataField="DataMod" HeaderText="modificato" ItemStyle-HorizontalAlign="left">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Size" HeaderText="Size" DataFormatString="{0:N0} kb" ItemStyle-HorizontalAlign="Right">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:BoundField>
<asp:TemplateField ItemStyle-HorizontalAlign="right">
<ItemTemplate>
<div id="Div1" runat="server" visible='<%# isWriteEnabled %>'>
@@ -56,23 +56,23 @@
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsFile" runat="server" DeleteMethod="DeleteQuery" InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" SelectMethod="getByPaziente" TypeName="WebSCR_Data.DS_UtilityTableAdapters.tblFilesTableAdapter" UpdateMethod="UpdateQuery">
<asp:ObjectDataSource ID="odsFile" runat="server" DeleteMethod="DeleteQuery" OldValuesParameterFormatString="original_{0}" SelectMethod="getByImpegno" TypeName="WebSCR_Data.DS_UtilityTableAdapters.tblFilesTableAdapter" InsertMethod="InsertQuery" UpdateMethod="UpdateQuery">
<SelectParameters>
<asp:SessionParameter Name="IdxPaziente" SessionField="IdxPaziente" Type="Int32" DefaultValue="0" />
<asp:QueryStringParameter DefaultValue="0" Name="IdxImpegno" QueryStringField="IdxImpegno" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxFile" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Gruppo" Type="String" />
<asp:SessionParameter Name="IdxPaziente" SessionField="IdxPaziente" Type="Int32" DefaultValue="0" />
<asp:QueryStringParameter DefaultValue="0" Name="IdxImpegno" QueryStringField="IdxImpegno" Type="Int32" />
<asp:Parameter Name="IdxRapportino" DefaultValue="0" Type="Int32" />
<asp:Parameter Name="FileName" Type="String" />
<asp:Parameter Name="ContentType" Type="String" />
<asp:Parameter Name="Data" Type="Object" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Gruppo" Type="String" />
<asp:SessionParameter Name="IdxPaziente" SessionField="IdxPaziente" Type="Int32" DefaultValue="0" />
<asp:QueryStringParameter DefaultValue="0" Name="IdxImpegno" QueryStringField="IdxImpegno" Type="Int32" />
<asp:Parameter Name="IdxRapportino" DefaultValue="0" Type="Int32" />
<asp:Parameter Name="FileName" Type="String" />
<asp:Parameter Name="ContentType" Type="String" />
<asp:Parameter Name="Data" Type="Object" />
+18 -21
View File
@@ -29,33 +29,30 @@ namespace WebSCR.WebUserControls
{
string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);
string contentType = FileUpload1.PostedFile.ContentType;
string gruppo = memLayer.ML.StringSessionObj("Gruppo");
int idxPaziente = memLayer.ML.IntSessionObj("IdxPaziente");
int idxImpegno = memLayer.ML.QSI("idxImpegno");
using (Stream fs = FileUpload1.PostedFile.InputStream)
{
using (BinaryReader br = new BinaryReader(fs))
{
byte[] bytes = br.ReadBytes((Int32)fs.Length);
// controllo se sia caricamento o update...
if (grView.SelectedIndex != -1)
// PROCEDO SOLO SE HO UN FILE!!!! ovvero bytes <> null
if (bytes.Length > 0)
{
try
// controllo se sia caricamento o update...
if (grView.SelectedIndex != -1)
{
int orig_idxFile = Convert.ToInt32(grView.SelectedValue);
// FARE!!!
#if false
DtProxy.man.taFile.UpdateQuery(gruppo, idxPaziente, filename, contentType, bytes, orig_idxFile);
#endif
try
{
int orig_idxFile = Convert.ToInt32(grView.SelectedValue);
DtProxy.man.taFile.UpdateQuery(idxImpegno, 0, filename, contentType, bytes, orig_idxFile);
}
catch
{ }
}
else
{
DtProxy.man.taFile.InsertQuery(idxImpegno, 0, filename, contentType, bytes);
}
catch
{ }
}
else
{
// FARE!!!
#if false
DtProxy.man.taFile.InsertQuery(gruppo, idxPaziente, filename, contentType, bytes);
#endif
}
}
}
@@ -86,13 +83,13 @@ namespace WebSCR.WebUserControls
{
// mostro controllo x edit...
fisVisFU(true);
btnUpload.Text = "Aggiorna File";
btnUpload.Text = "Sostituisci File";
}
protected void btnAdd_Click(object sender, EventArgs e)
{
fisVisFU(true);
btnUpload.Text = "Carica Nuovo";
btnUpload.Text = "Carica Nuovo File";
}
/// <summary>
/// fix visibilità controllo file upload
@@ -23,7 +23,6 @@
<asp:LinkButton ID="lbInizioInt" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-clock ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" Text="Inizio Intervento" Width="75%" OnClick="lbInizioInt_Click" />
<asp:LinkButton ID="lbFineInt" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-clock ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" Text="Fine Intervento" Width="75%" OnClick="lbFineInt_Click" />
<asp:LinkButton ID="lbNoteInt" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-edit ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" Text="Note Intervento" Width="75%" OnClick="lbNoteInt_Click" />
<asp:LinkButton ID="lbFileInt" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-camera ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" Text="Allega File" Width="75%" OnClick="lbFileInt_Click" />
</div>
<div id="divNote" runat="server" visible="false" style="text-align: center; margin: auto;">
@@ -107,7 +107,7 @@ namespace WebSCR.WebUserControls
lbFineInt.Visible = iniziato && !finito;
if (divNote.Visible)
{
lbNoteInt.Text = "Annulla edit note";
lbNoteInt.Text = "Chiudi Note Intervento";
}
else
{
@@ -151,11 +151,6 @@ namespace WebSCR.WebUserControls
reportEvent();
}
protected void lbFileInt_Click(object sender, EventArgs e)
{
fixVisibility();
reportEvent();
}
/// <summary>
/// Aggiungo nota...
/// </summary>
@@ -57,15 +57,6 @@ namespace WebSCR.WebUserControls {
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbNoteInt;
/// <summary>
/// lbFileInt 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 lbFileInt;
/// <summary>
/// divNote control.
/// </summary>
Binary file not shown.