iniziata implementazione cancellazione file

git-svn-id: https://keyhammer.ath.cx/svn/ETS/trunk@29 72332f79-082b-4ce8-9953-5b7f197a49bb
This commit is contained in:
samuele
2012-08-31 17:05:23 +00:00
parent 977c9ee6a3
commit c7d87fb86b
15 changed files with 238 additions and 30 deletions
BIN
View File
Binary file not shown.
+42
View File
@@ -156,17 +156,52 @@
<Content Include="GestioneDocumenti.aspx" />
<Content Include="Help.aspx" />
<Content Include="images\ajax-loader.gif" />
<Content Include="images\apply_l.png" />
<Content Include="images\apply_m.png" />
<Content Include="images\apply_s.png" />
<Content Include="images\Archivio.png" />
<Content Include="images\arrDown_l.png" />
<Content Include="images\arrDown_m.png" />
<Content Include="images\arrDown_s.png" />
<Content Include="images\arrUp_l.png" />
<Content Include="images\arrUp_m.png" />
<Content Include="images\arrUp_s.png" />
<Content Include="images\bg-menu-main.png" />
<Content Include="images\bg_bright.jpg" />
<Content Include="images\bg_dark.jpg" />
<Content Include="images\bluGrad32.png" />
<Content Include="images\cancel_l.png" />
<Content Include="images\cancel_m.png" />
<Content Include="images\cancel_s.png" />
<Content Include="images\clonaObj_l.png" />
<Content Include="images\clonaObj_m.png" />
<Content Include="images\clonaObj_s.png" />
<Content Include="images\edit_l.png" />
<Content Include="images\edit_m.png" />
<Content Include="images\edit_s.png" />
<Content Include="images\elimina_l.png" />
<Content Include="images\elimina_m.png" />
<Content Include="images\elimina_s.png" />
<Content Include="images\favicon.png" />
<Content Include="images\Help.png" />
<Content Include="images\home.png" />
<Content Include="images\Logo_ETS.png" />
<Content Include="images\new_l.png" />
<Content Include="images\new_m.png" />
<Content Include="images\new_s.png" />
<Content Include="images\reload_l.png" />
<Content Include="images\reload_m.png" />
<Content Include="images\reload_s.png" />
<Content Include="images\uploadFile.png" />
<Content Include="images\version_l.png" />
<Content Include="images\version_m.png" />
<Content Include="images\version_s.png" />
<Content Include="images\view_l.png" />
<Content Include="images\view_m.png" />
<Content Include="images\view_s.png" />
<Content Include="images\WorkInProgress.jpg" />
<Content Include="Menu.aspx" />
<Content Include="MyDocs.aspx" />
<Content Include="plupload\js\i18n\cs.js" />
<Content Include="plupload\js\i18n\da.js" />
<Content Include="plupload\js\i18n\de.js" />
@@ -279,6 +314,13 @@
<Compile Include="Menu.aspx.designer.cs">
<DependentUpon>Menu.aspx</DependentUpon>
</Compile>
<Compile Include="MyDocs.aspx.cs">
<DependentUpon>MyDocs.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="MyDocs.aspx.designer.cs">
<DependentUpon>MyDocs.aspx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ricerca.aspx.cs">
<DependentUpon>ricerca.aspx</DependentUpon>
+1 -1
View File
@@ -28,7 +28,7 @@
<add key="appName" value="ETS-WS" />
<add key="SiteName" value="ETS" />
<add key="mainRev" value="0.2" />
<add key="minRev" value="20" />
<add key="minRev" value="25" />
<add key="copyRight" value="SteamWare, ETS © 2012" />
<add key="tempUplDir" value="~/TempUploads" />
<!--update pagina-->
@@ -38,25 +38,25 @@ namespace ETS_WS.WebUserControls
{
path = string.Format("{0}/{1}", utils.obj.confReadString("tempUplDir"), utils.obj.currUser_FS);
utils.obj.setSessionVal("UserTempPath", path);
}
}
fileMover.checkDir(path);
}
catch(Exception exc)
catch (Exception exc)
{
lg.Info("errore check directory: {0}", exc);
}
// opra il file...
// ora il file...
try
{
if(path!="")
if (path != "")
{
path = string.Format("{0}/{1}",path, e.FileName);
fileUpload.SaveAs(MapPath(path));
lg.Info("salvato file: {0}, {1} Kb", path, e.FileSize / 1024);
if (eh_fileCaricato != null)
{
eh_fileCaricato(this, new EventArgs());
}
path = string.Format("{0}/{1}", path, e.FileName);
fileUpload.SaveAs(MapPath(path));
lg.Info("salvato file: {0}, {1} Kb", path, e.FileSize / 1024);
if (eh_fileCaricato != null)
{
eh_fileCaricato(this, new EventArgs());
}
}
}
catch (Exception exc)
+2 -2
View File
@@ -13,12 +13,12 @@
ToolTip="ETS" />
</div>
<div style="text-align: center; margin: auto; width: 1024px;">
<div style="float: left; border: 1px solid #333333; width: 300px; background: #FDFDFD">
<div style="float: left; border: 1px solid #333333; width: 300px; background: #FDFDFD;">
<h2>
<asp:Label runat="server" ID="lblMyTemp" />
</h2>
<asp:ImageButton runat="server" ID="btnClienti" ImageUrl="~/images/uploadFile.png"
ToolTip="Offerte" PostBackUrl="~/GestioneDocumenti.aspx" />
ToolTip="Offerte" PostBackUrl="~/MyDocs.aspx" />
</div>
<div style="float: right; border: 1px solid #333333; width: 300px; background: #FDFDFD">
<h2>
@@ -1,5 +1,6 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_myTempFile.ascx.cs"
Inherits="ETS_WS.WebUserControls.mod_myTempFile" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<% if (false)
{ %>
<link href="../css/BuildBlocks.css" rel="stylesheet" type="text/css" />
@@ -8,8 +9,8 @@
<link href="../css/MasterPage.css" rel="stylesheet" type="text/css" />
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
<% } %>
<asp:GridView ID="grView" runat="server" AllowSorting="True" AutoGenerateColumns="False"
DataSourceID="ods" Width="100%" AllowPaging="True">
<asp:GridView ID="grView" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Nome"
DataSourceID="ods" Width="100%">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
@@ -19,16 +20,74 @@
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<%--<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:ImageButton ID="imgBtnReset" runat="server" ToolTip='<%# traduci("Reset") %>'
CausesValidation="False" OnClick="btnReset_Click" ImageUrl="~/images/reload_l.png"
Visible='<%# !scontoEnabled %>' />
</HeaderTemplate>
<ItemTemplate>
<div style="white-space: nowrap;">
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
ToolTip="Seleziona" ImageUrl="~/images/view_m.png" Visible='<%# !scontoEnabled %>' />
<asp:ImageButton ID="imgClona" runat="server" CausesValidation="False" ToolTip='<%# traduci("clonaRSC") %>'
ImageUrl="~/images/clonaObj_m.png" Visible="false" CommandArgument="clonaObj"
CommandName="Update" OnClick="imgClonaRow_Click" />
<asp:ImageButton ID="imgMoveUp" runat="server" CausesValidation="False" CommandName="Cancel"
CommandArgument='<%# Eval("posizione") %>' ToolTip='<%# traduci("moveUp") %>'
ImageUrl="~/images/arrUp_s.png" Visible='<%# imgSpostaVisib(Eval("posizione"), true) %>'
OnClick="imgMoveUp_Click" Style="height: 16px" />
<asp:ImageButton ID="imgMoveDown" runat="server" CausesValidation="False" CommandName="Cancel"
CommandArgument='<%# Eval("posizione") %>' ToolTip='<%# traduci("moveDown") %>'
ImageUrl="~/images/arrDown_s.png" Visible='<%# imgSpostaVisib(Eval("posizione"), false) %>'
OnClick="imgMoveDown_Click" />
</div>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" Visible='<%# editMode %>' />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="btnSelAll" runat="server" Checked="false" ToolTip="Seleziona tutti"
OnCheckedChanged="btnSelAll_Click" CssClass="ctrHeaderPager" AutoPostBack="true"
Visible='<%# editMode %>' />
</HeaderTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
ico
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome"></asp:BoundField>
<asp:BoundField DataField="dataCreaz" HeaderText="dataCreaz" SortExpression="dataCreaz">
</asp:BoundField>
<asp:BoundField DataField="dataMod" HeaderText="dataMod" SortExpression="dataMod">
<asp:BoundField DataField="size" HeaderText="size" SortExpression="size" DataFormatString="{0:#,###} kb">
</asp:BoundField>
<asp:BoundField DataField="size" HeaderText="size" SortExpression="size"></asp:BoundField>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ImageUrl="~/images/elimina_m.png" ToolTip="Elimina file" />
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="Sei sicuro di vole eliminare il file?"
TargetControlID="imgDelete">
</asp:ConfirmButtonExtender>
</ItemTemplate>
<FooterStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="tabellaFiles" TypeName="ETS_Data.fileMover">
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="tabellaFiles"
TypeName="ETS_Data.fileMover" DeleteMethod="eliminaFile"
OldValuesParameterFormatString="Original_{0}">
<DeleteParameters>
<asp:SessionParameter SessionField="UserTempPath" Name="Path" Type="String" />
<asp:Parameter Name="Original_Nome" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:SessionParameter DefaultValue="~/TempUploads/empty" Name="path" SessionField="UserTempPath"
Type="String" />
@@ -4,14 +4,54 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ETS_Data;
namespace ETS_WS.WebUserControls
{
public partial class mod_myTempFile : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// seleziona/deseleziona le righe indicate...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSelAll_Click(object sender, EventArgs e)
{
// seleziono tutti i valori visibili nel datagrid
CheckBox chkbox = ((CheckBox)sender);
bool isChecked = chkbox.Checked;
if (!isChecked)
{
chkbox.ToolTip = "Seleziona tutti";
}
else
{
chkbox.ToolTip = "Deseleziona tutti";
}
foreach (GridViewRow riga in grView.Rows)
{
((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked;
}
}
/// <summary>
/// modalità di editing metadati attiva/disattiva
/// </summary>
public bool editMode
{
get
{
return utils.obj.BoolSessionObj("editMyDocsMetadata");
}
set
{
utils.obj.setSessionVal("editMyDocsMetadata", value);
grView.DataBind();
}
}
}
}
+15 -10
View File
@@ -8,14 +8,19 @@
<link href="../css/MasterPage.css" rel="stylesheet" type="text/css" />
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
<% } %>
<div class="divCenter areaTitolo">
<div class="divSx fontPiccolo" style="padding: 20px 0px 2px 4px;">
<asp:Label runat="server" ID="lblUser" />
<asp:HyperLink runat="server" ID="hlHome" NavigateUrl="~/Menu.aspx">
<div class="divCenter areaTitolo">
<div class="divSx fontPiccolo" style="padding: 20px 0px 2px 4px;">
<asp:Label runat="server" ID="lblUser" />
</div>
<div class="divDx fontPiccolo" style="padding: 20px 4px 2px 0px;">
<asp:Label runat="server" ID="lblDataOra" />
</div>
<div class="divCenter fontTitolo">
<asp:Image runat="server" ID="ibHome" ImageUrl="~/images/home.png" Width="32px" Height="32px" />
<b>
<asp:Label runat="server" ID="lblTitolo" Text="ETS-WebScip" />
</b>
</div>
</div>
<div class="divDx fontPiccolo" style="padding: 20px 4px 2px 0px;">
<asp:Label runat="server" ID="lblDataOra" />
</div>
<div class="fontTitolo">
<b>ETS-WebScip</b>
</div>
</div>
</asp:HyperLink>
@@ -12,6 +12,15 @@ namespace ETS_WS.WebUserControls {
public partial class mod_testata {
/// <summary>
/// hlHome 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.HyperLink hlHome;
/// <summary>
/// lblUser control.
/// </summary>
@@ -29,5 +38,23 @@ namespace ETS_WS.WebUserControls {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblDataOra;
/// <summary>
/// ibHome 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.Image ibHome;
/// <summary>
/// lblTitolo 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 lblTitolo;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 978 B

+1
View File
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\..\ETS_Data\packages.config" />
<repository path="..\ETS-WS\packages.config" />
</repositories>
+10
View File
@@ -47,6 +47,9 @@
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog">
<HintPath>..\ETS-WS\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
@@ -118,6 +121,13 @@
<None Include="DS_WebScip.xss">
<DependentUpon>DS_WebScip.xsd</DependentUpon>
</None>
<Content Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
+24
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using NLog;
namespace ETS_Data
{
@@ -18,6 +19,8 @@ namespace ETS_Data
/// </summary>
public static fileMover obj = new fileMover();
protected Logger lg = LogManager.GetCurrentClassLogger();
#endregion
/// <summary>
@@ -83,5 +86,26 @@ namespace ETS_Data
}
return _di;
}
/// <summary>
/// elimina un file dato path e nomefile
/// </summary>
/// <param name="Path"></param>
/// <param name="Original_Nome"></param>
/// <returns></returns>
public bool eliminaFile(string Path, string Original_Nome)
{
bool answ = false;
try
{
//elimino file!
FileInfo _fi = new FileInfo(System.Web.HttpContext.Current.Server.MapPath(Path + Original_Nome));
_fi.Delete();
lg.Info("Eliminazione file: {0}/{1}", Path, Original_Nome);
answ = true;
}
catch
{ }
return answ;
}
}
}