elimino procedure vecchie upload operatori
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true"
|
||||
Inherits="MoonPro_site.WebUserControls.mod_caricaOperatoriCSV" Codebehind="mod_caricaOperatoriCSV.ascx.cs" %>
|
||||
<h2>
|
||||
Aggiornamento dati Operatori</h2>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Panel ID="pnlUpload" Visible="false" runat="server">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
Selezionare il file da caricare:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:FileUpload ID="FileUpload1" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:CheckBox ID="CheckBox1" runat="server" Text="Con intestazioni" Checked="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Carica File" />
|
||||
<asp:Label ID="lblWarning" runat="server"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:GridView ID="GridView1" runat="server">
|
||||
</asp:GridView>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:GridView ID="GridView2" runat="server">
|
||||
</asp:GridView>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<asp:Panel ID="pnlPasswd" runat="server" Visible="true">
|
||||
Password di autorizzazione: <asp:TextBox ID="txtPwd" runat="server" TextMode="Password"
|
||||
AutoPostBack="true" OnTextChanged="txtPwd_TextChanged"></asp:TextBox>
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1,84 +0,0 @@
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
|
||||
namespace MoonPro_site.WebUserControls
|
||||
{
|
||||
public partial class mod_caricaOperatoriCSV : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
checkAuth();
|
||||
}
|
||||
|
||||
private void checkAuth()
|
||||
{
|
||||
// se in session è auth alora mostro pannello caricamento..
|
||||
if (Convert.ToBoolean(Session["isAuthUpdForced"]))
|
||||
{
|
||||
pnlUpload.Visible = true;
|
||||
pnlPasswd.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlUpload.Visible = false;
|
||||
pnlPasswd.Visible = true;
|
||||
}
|
||||
}
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
// controllo se c'è il file
|
||||
if (FileUpload1.HasFile)
|
||||
{
|
||||
// salvo file in locale...
|
||||
string _dirPath = System.Web.HttpContext.Current.Server.MapPath("./upload/");
|
||||
string _logPath = System.Web.HttpContext.Current.Server.MapPath("./logs/");
|
||||
FileUpload1.PostedFile.SaveAs(string.Format("{0}importOpr.csv", _dirPath));
|
||||
// leggo il file locale in una tabella
|
||||
fileMover fm = new fileMover(_dirPath, _dirPath);
|
||||
DataTable tabIn = CsvParser.Parse(fm.scaricaFileString("importOpr.csv"), CheckBox1.Checked);
|
||||
// svuoto vecchia tab inserting...
|
||||
DataLayer.obj.taOp2ins.DeleteAll();
|
||||
int _errori = 0;
|
||||
logger lg = new logger(_logPath);
|
||||
foreach (DataRow riga in tabIn.Rows)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataLayer.obj.taOp2ins.Insert(Convert.ToInt32(riga[0]), riga[1].ToString(), riga[2].ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
_errori++;
|
||||
lg.scriviLog(string.Format("Importazione dati operatore: errore nell'inserimento dell'operatore con matricola {0}", riga[0]));
|
||||
}
|
||||
}
|
||||
DataLayer.obj.taOp2ins.UpdateOperatori();
|
||||
lblWarning.Text = "Dati operatore caricati!";
|
||||
if (_errori > 0) lblWarning.Text = lblWarning.Text + string.Format(" - riscontrati {0} errori, vedere log!", _errori);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Text = "Indicare il file da caricare!";
|
||||
}
|
||||
}
|
||||
protected void txtPwd_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
string _pwdOk = ConfigurationManager.AppSettings.Get("_pdwUpdateForzato");
|
||||
// verifico la password ed eventualmente mostro pannello caricamento..
|
||||
if (txtPwd.Text != "" && txtPwd.Text == _pwdOk)
|
||||
{
|
||||
Session["isAuthUpdForced"] = true;
|
||||
checkAuth();
|
||||
}
|
||||
else
|
||||
{
|
||||
Session["isAuthUpdForced"] = false;
|
||||
checkAuth();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4927
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MoonPro_site.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class mod_caricaOperatoriCSV {
|
||||
|
||||
/// <summary>
|
||||
/// pnlUpload 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.Panel pnlUpload;
|
||||
|
||||
/// <summary>
|
||||
/// FileUpload1 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.FileUpload FileUpload1;
|
||||
|
||||
/// <summary>
|
||||
/// CheckBox1 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.CheckBox CheckBox1;
|
||||
|
||||
/// <summary>
|
||||
/// Button1 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.Button Button1;
|
||||
|
||||
/// <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>
|
||||
/// GridView1 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 GridView1;
|
||||
|
||||
/// <summary>
|
||||
/// GridView2 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 GridView2;
|
||||
|
||||
/// <summary>
|
||||
/// pnlPasswd 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.Panel pnlPasswd;
|
||||
|
||||
/// <summary>
|
||||
/// txtPwd 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 txtPwd;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro_noAjax.master" AutoEventWireup="true" Inherits="caricaUpdateOperatori" Codebehind="caricaUpdateOperatori.aspx.cs" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/mod_caricaOperatoriCSV.ascx" TagName="mod_caricaOperatoriCSV" TagPrefix="uc1" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<uc1:mod_caricaOperatoriCSV ID="Mod_caricaOperatoriCSV1" runat="server" />
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using System;
|
||||
|
||||
public partial class caricaUpdateOperatori : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
public partial class caricaUpdateOperatori {
|
||||
|
||||
/// <summary>
|
||||
/// Controllo Mod_caricaOperatoriCSV1.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::MoonPro_site.WebUserControls.mod_caricaOperatoriCSV Mod_caricaOperatoriCSV1;
|
||||
}
|
||||
Reference in New Issue
Block a user