Aggiunta gestioen upload clienti

This commit is contained in:
Samuele E. Locatelli
2015-05-21 18:23:15 +02:00
parent e937f02392
commit b81c4854f7
21 changed files with 318 additions and 2 deletions
BIN
View File
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Client.aspx.cs" Inherits="WebSCR.Upload.Client" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
+116
View File
@@ -0,0 +1,116 @@
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebSCR_data;
namespace WebSCR.Upload
{
public partial class Client : System.Web.UI.Page
{
/// <summary>
/// recupera valore querystring
/// </summary>
/// <param name="nome"></param>
/// <returns></returns>
protected string qsVal(string nome)
{
return memLayer.ML.QSS(nome);
}
protected void Page_Load(object sender, EventArgs e)
{
string answ = "ND";
/*
* http://webscr.steamware.net/Rigamonti/Upload/Client?CodCliente=C0000&RagSoc=Cognome+Nome&CodFis=ABCDEFGH123456&Tel=035+0000000&Cell333+000000&EnableSMS=1&Email=email.address@dominio.it&Indir=via+dai+piedi&Cap=24999&Localita=Dalmine&Prov=BG&Note=note+se+presenti
*/
// legge i get x processare dati input
string CodCliente = "";
string RagSoc = "";
string CodFis = "";
string Tel = "";
string Cell = "";
bool EnableSMS = false;
string Email = "";
string Indir = "";
string Cap = "";
string Localita = "";
string Prov = "";
string Note = "";
try
{
CodCliente = qsVal("CodCliente");
RagSoc = qsVal("RagSoc");
CodFis = qsVal("CodFis");
Tel = qsVal("Tel");
Cell = qsVal("Cell");
EnableSMS = memLayer.ML.QSB("EnableSMS");
Email = qsVal("Email");
Indir = qsVal("Indir");
Cap = qsVal("Cap");
Localita = qsVal("Localita");
Prov = qsVal("Prov");
Note = qsVal("Note");
if (memLayer.ML.CRI("_logLevel") > 6)
{
logger.lg.scriviLog(string.Format("Valori letti:{0}CodCliente: {1}{0}RagSoc: {2}{0}CodFis: {3}{0}Tel: {4}{0}Cell: {5}{0}EnableSMS: {6}{0}Email: {7}{0}Indir: {8}{0}Cap: {9}{0}Localita: {10}{0}Prov: {11}{0}Note: {12}", Environment.NewLine, CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Localita, Prov, Note), tipoLog.INFO);
}
}
catch
{ }
// provo a fare insert!!!
if (CodCliente != null && RagSoc != null)
{
if (CodCliente != "" && RagSoc != "")
{
try
{
// ora processo e salvo il valore del microstato...
DtProxy.man.taAC.upsert(CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Localita, Prov, Note);
answ = "OK"; // registro in risposta che è andato tutto bene...
}
catch (Exception exc)
{
if (memLayer.ML.confReadInt("_logLevel") > 5)
{
string errore = string.Format("Errore: {0}{1}", Environment.NewLine, exc);
logger.lg.scriviLog(errore, tipoLog.EXCEPTION);
answ = errore;
}
}
}
else
{
// restituisco ultimo COD CLIENTE inserito
try
{
answ = DtProxy.man.taAC.getLast()[0].CodCliente;
}
catch
{
answ = "ko";
}
}
}
else
{
// restituisco ultimo COD CLIENTE inserito
try
{
answ = DtProxy.man.taAC.getLast()[0].CodCliente;
}
catch
{
answ = "ko";
}
}
// ripulisco pagina restituita e tolgo html (solo codice ok/NO)
Response.Clear();
Response.Write(answ);
Context.Response.End();
}
}
}
+26
View File
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <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 WebSCR.Upload
{
public partial class Client
{
/// <summary>
/// form1 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.HtmlForm form1;
}
}
-1
View File
@@ -11,7 +11,6 @@ namespace WebSCR.Upload
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.Write("OK");
Context.Response.End();
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+128 -1
View File
@@ -9293,7 +9293,7 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void InitCommandCollection() {
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT * FROM dbo.AnagClienti";
@@ -9304,6 +9304,28 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodCliente", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[2].Connection = this.Connection;
this._commandCollection[2].CommandText = "dbo.stp_AC_GetLast";
this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[3].Connection = this.Connection;
this._commandCollection[3].CommandText = "dbo.stp_AC_upsert";
this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodCliente", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RagSoc", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodFis", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Tel", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Cell", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EnableSMS", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Email", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Indir", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Cap", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Localita", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Prov", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Note", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -9347,6 +9369,17 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
return dataTable;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_Applicazione.AnagClientiDataTable getLast() {
this.Adapter.SelectCommand = this.CommandCollection[2];
DS_Applicazione.AnagClientiDataTable dataTable = new DS_Applicazione.AnagClientiDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
@@ -9797,6 +9830,100 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
string Original_Note) {
return this.Update(Original_CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Localita, Prov, Note, Original_CodCliente, Original_RagSoc, Original_CodFis, Original_Tel, Original_Cell, Original_EnableSMS, Original_Email, Original_Indir, Original_Cap, Original_Localita, Original_Prov, Original_Note);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int upsert(string CodCliente, string RagSoc, string CodFis, string Tel, string Cell, global::System.Nullable<bool> EnableSMS, string Email, string Indir, string Cap, string Localita, string Prov, string Note) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3];
if ((CodCliente == null)) {
command.Parameters[1].Value = global::System.DBNull.Value;
}
else {
command.Parameters[1].Value = ((string)(CodCliente));
}
if ((RagSoc == null)) {
command.Parameters[2].Value = global::System.DBNull.Value;
}
else {
command.Parameters[2].Value = ((string)(RagSoc));
}
if ((CodFis == null)) {
command.Parameters[3].Value = global::System.DBNull.Value;
}
else {
command.Parameters[3].Value = ((string)(CodFis));
}
if ((Tel == null)) {
command.Parameters[4].Value = global::System.DBNull.Value;
}
else {
command.Parameters[4].Value = ((string)(Tel));
}
if ((Cell == null)) {
command.Parameters[5].Value = global::System.DBNull.Value;
}
else {
command.Parameters[5].Value = ((string)(Cell));
}
if ((EnableSMS.HasValue == true)) {
command.Parameters[6].Value = ((bool)(EnableSMS.Value));
}
else {
command.Parameters[6].Value = global::System.DBNull.Value;
}
if ((Email == null)) {
command.Parameters[7].Value = global::System.DBNull.Value;
}
else {
command.Parameters[7].Value = ((string)(Email));
}
if ((Indir == null)) {
command.Parameters[8].Value = global::System.DBNull.Value;
}
else {
command.Parameters[8].Value = ((string)(Indir));
}
if ((Cap == null)) {
command.Parameters[9].Value = global::System.DBNull.Value;
}
else {
command.Parameters[9].Value = ((string)(Cap));
}
if ((Localita == null)) {
command.Parameters[10].Value = global::System.DBNull.Value;
}
else {
command.Parameters[10].Value = ((string)(Localita));
}
if ((Prov == null)) {
command.Parameters[11].Value = global::System.DBNull.Value;
}
else {
command.Parameters[11].Value = ((string)(Prov));
}
if ((Note == null)) {
command.Parameters[12].Value = global::System.DBNull.Value;
}
else {
command.Parameters[12].Value = ((string)(Note));
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
command.Connection.Open();
}
int returnValue;
try {
returnValue = command.ExecuteNonQuery();
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
command.Connection.Close();
}
}
return returnValue;
}
}
/// <summary>
+32
View File
@@ -498,6 +498,38 @@ SELECT CodCliente, RagSoc, CodFis, Tel, Cell, EnableSMS, Email, Indir, Cap, Loca
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="WebSCRConnectionString (Settings)" DbObjectName="WebSCR.dbo.stp_AC_GetLast" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getLast" GetMethodModifier="Public" GetMethodName="getLast" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getLast" UserSourceName="getLast">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_AC_GetLast</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="WebSCRConnectionString (Settings)" DbObjectName="WebSCR.dbo.stp_AC_upsert" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="upsert" Modifier="Public" Name="upsert" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="upsert">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_AC_upsert</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodCliente" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@RagSoc" Precision="0" ProviderType="NVarChar" Scale="0" Size="100" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodFis" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Tel" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Cell" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="bit" DbType="Boolean" Direction="Input" ParameterName="@EnableSMS" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Email" Precision="0" ProviderType="NVarChar" Scale="0" Size="250" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Indir" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Cap" Precision="0" ProviderType="NVarChar" Scale="0" Size="10" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Localita" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Prov" Precision="0" ProviderType="NVarChar" Scale="0" Size="10" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Note" Precision="0" ProviderType="NVarChar" Scale="0" Size="250" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ImpegniTableAdapter" GeneratorDataComponentClassName="ImpegniTableAdapter" Name="Impegni" UserDataComponentName="ImpegniTableAdapter">
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.