spostato insert richeiste in novo modulo dedicato

This commit is contained in:
Samuele E. Locatelli
2018-07-23 11:17:40 +02:00
parent a7bcf0b626
commit 85b64f160c
12 changed files with 1252 additions and 138 deletions
+855 -2
View File
File diff suppressed because it is too large Load Diff
+86 -1
View File
@@ -307,6 +307,17 @@ SELECT idxFornitore, username, password, nome, indirizzo, p_iva, indirizzo_email
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="B2BCondConnectionString (Settings)" DbObjectName="B2BCond.dbo.stp_AF_getByKey" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getByKey" GetMethodModifier="Public" GetMethodName="getByKey" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getByKey" UserSourceName="getByKey">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_AF_getByKey</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="int" DbType="Int32" Direction="Input" ParameterName="@idxFornitore" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="AssF2ATableAdapter" GeneratorDataComponentClassName="AssF2ATableAdapter" Name="AssF2A" UserDataComponentName="AssF2ATableAdapter">
@@ -451,7 +462,7 @@ FROM v_AssF2C</CommandText>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT *
FROM v_ElencolRich</CommandText>
FROM v_ElencolRich</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
@@ -461,6 +472,7 @@ FROM v_ElencolRich</CommandText>
<Mapping SourceColumn="idxRichiesta" DataSetColumn="idxRichiesta" />
<Mapping SourceColumn="idxStato" DataSetColumn="idxStato" />
<Mapping SourceColumn="idxCond" DataSetColumn="idxCond" />
<Mapping SourceColumn="idxPriorita" DataSetColumn="idxPriorita" />
<Mapping SourceColumn="idxArea" DataSetColumn="idxArea" />
<Mapping SourceColumn="idxFornitore" DataSetColumn="idxFornitore" />
<Mapping SourceColumn="cod_fornitore" DataSetColumn="cod_fornitore" />
@@ -660,6 +672,59 @@ SELECT idxStato, stato, descrizione, cssStato FROM AnagStati WHERE (idxStato = @
</Mappings>
<Sources />
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="AnagPriorTableAdapter" GeneratorDataComponentClassName="AnagPriorTableAdapter" Name="AnagPrior" UserDataComponentName="AnagPriorTableAdapter">
<MainSource>
<DbSource ConnectionRef="B2BCondConnectionString (Settings)" DbObjectName="B2BCond.dbo.AnagPrior" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM [dbo].[AnagPrior] WHERE (([idxPriorita] = @Original_idxPriorita) AND ([descrPriorita] = @Original_descrPriorita) AND ([scadenzaGg] = @Original_scadenzaGg))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_idxPriorita" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="idxPriorita" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_descrPriorita" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="descrPriorita" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@Original_scadenzaGg" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="scadenzaGg" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [dbo].[AnagPrior] ([idxPriorita], [descrPriorita], [scadenzaGg]) VALUES (@idxPriorita, @descrPriorita, @scadenzaGg);
SELECT idxPriorita, descrPriorita, scadenzaGg FROM AnagPrior WHERE (idxPriorita = @idxPriorita)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@idxPriorita" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="idxPriorita" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@descrPriorita" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="descrPriorita" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@scadenzaGg" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="scadenzaGg" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT idxPriorita, descrPriorita, scadenzaGg FROM dbo.AnagPrior</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>UPDATE [dbo].[AnagPrior] SET [idxPriorita] = @idxPriorita, [descrPriorita] = @descrPriorita, [scadenzaGg] = @scadenzaGg WHERE (([idxPriorita] = @Original_idxPriorita) AND ([descrPriorita] = @Original_descrPriorita) AND ([scadenzaGg] = @Original_scadenzaGg));
SELECT idxPriorita, descrPriorita, scadenzaGg FROM AnagPrior WHERE (idxPriorita = @idxPriorita)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@idxPriorita" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="idxPriorita" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@descrPriorita" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="descrPriorita" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@scadenzaGg" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="scadenzaGg" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_idxPriorita" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="idxPriorita" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_descrPriorita" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="descrPriorita" SourceColumnNullMapping="false" SourceVersion="Original" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@Original_scadenzaGg" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="scadenzaGg" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="idxPriorita" DataSetColumn="idxPriorita" />
<Mapping SourceColumn="descrPriorita" DataSetColumn="descrPriorita" />
<Mapping SourceColumn="scadenzaGg" DataSetColumn="scadenzaGg" />
</Mappings>
<Sources />
</TableAdapter>
</Tables>
<Sources />
</DataSource>
@@ -950,6 +1015,7 @@ SELECT idxStato, stato, descrizione, cssStato FROM AnagStati WHERE (idxStato = @
<xs:element name="idxRichiesta" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnidxRichiesta" msprop:Generator_ColumnPropNameInRow="idxRichiesta" msprop:Generator_ColumnPropNameInTable="idxRichiestaColumn" msprop:Generator_UserColumnName="idxRichiesta" type="xs:int" />
<xs:element name="idxStato" msprop:Generator_ColumnVarNameInTable="columnidxStato" msprop:Generator_ColumnPropNameInRow="idxStato" msprop:Generator_ColumnPropNameInTable="idxStatoColumn" msprop:Generator_UserColumnName="idxStato" type="xs:int" />
<xs:element name="idxCond" msprop:Generator_ColumnVarNameInTable="columnidxCond" msprop:Generator_ColumnPropNameInRow="idxCond" msprop:Generator_ColumnPropNameInTable="idxCondColumn" msprop:Generator_UserColumnName="idxCond" type="xs:int" />
<xs:element name="idxPriorita" msprop:Generator_ColumnVarNameInTable="columnidxPriorita" msprop:Generator_ColumnPropNameInRow="idxPriorita" msprop:Generator_ColumnPropNameInTable="idxPrioritaColumn" msprop:Generator_UserColumnName="idxPriorita" type="xs:int" />
<xs:element name="idxArea" msprop:Generator_ColumnVarNameInTable="columnidxArea" msprop:Generator_ColumnPropNameInRow="idxArea" msprop:Generator_ColumnPropNameInTable="idxAreaColumn" msprop:Generator_UserColumnName="idxArea" type="xs:int" />
<xs:element name="idxFornitore" msprop:Generator_ColumnVarNameInTable="columnidxFornitore" msprop:Generator_ColumnPropNameInRow="idxFornitore" msprop:Generator_ColumnPropNameInTable="idxFornitoreColumn" msprop:Generator_UserColumnName="idxFornitore" type="xs:int" />
<xs:element name="cod_fornitore" msprop:Generator_ColumnVarNameInTable="columncod_fornitore" msprop:Generator_ColumnPropNameInRow="cod_fornitore" msprop:Generator_ColumnPropNameInTable="cod_fornitoreColumn" msprop:Generator_UserColumnName="cod_fornitore" minOccurs="0">
@@ -1112,6 +1178,21 @@ SELECT idxStato, stato, descrizione, cssStato FROM AnagStati WHERE (idxStato = @
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagPrior" msprop:Generator_TableClassName="AnagPriorDataTable" msprop:Generator_TableVarName="tableAnagPrior" msprop:Generator_TablePropName="AnagPrior" msprop:Generator_RowDeletingName="AnagPriorRowDeleting" msprop:Generator_RowChangingName="AnagPriorRowChanging" msprop:Generator_RowEvHandlerName="AnagPriorRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagPriorRowDeleted" msprop:Generator_UserTableName="AnagPrior" msprop:Generator_RowChangedName="AnagPriorRowChanged" msprop:Generator_RowEvArgName="AnagPriorRowChangeEvent" msprop:Generator_RowClassName="AnagPriorRow">
<xs:complexType>
<xs:sequence>
<xs:element name="idxPriorita" msprop:Generator_ColumnVarNameInTable="columnidxPriorita" msprop:Generator_ColumnPropNameInRow="idxPriorita" msprop:Generator_ColumnPropNameInTable="idxPrioritaColumn" msprop:Generator_UserColumnName="idxPriorita" type="xs:int" />
<xs:element name="descrPriorita" msprop:Generator_ColumnVarNameInTable="columndescrPriorita" msprop:Generator_ColumnPropNameInRow="descrPriorita" msprop:Generator_ColumnPropNameInTable="descrPrioritaColumn" msprop:Generator_UserColumnName="descrPriorita">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="scadenzaGg" msprop:Generator_ColumnVarNameInTable="columnscadenzaGg" msprop:Generator_ColumnPropNameInRow="scadenzaGg" msprop:Generator_ColumnPropNameInTable="scadenzaGgColumn" msprop:Generator_UserColumnName="scadenzaGg" type="xs:double" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
@@ -1149,6 +1230,10 @@ SELECT idxStato, stato, descrizione, cssStato FROM AnagStati WHERE (idxStato = @
<xs:selector xpath=".//mstns:AnagStati" />
<xs:field xpath="mstns:idxStato" />
</xs:unique>
<xs:unique name="AnagPrior_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:AnagPrior" />
<xs:field xpath="mstns:idxPriorita" />
</xs:unique>
</xs:element>
<xs:annotation>
<xs:appinfo>
+3
View File
@@ -23,6 +23,7 @@ namespace Data
/// </summary>
protected virtual void avvioTableAdapters()
{
taAF = new DS_appTableAdapters.AnagFornitoriTableAdapter();
taAS = new DS_appTableAdapters.AnagStatiTableAdapter();
taAssF2A = new DS_appTableAdapters.AssF2ATableAdapter();
taElRich = new DS_appTableAdapters.ElencolRichTableAdapter();
@@ -35,6 +36,7 @@ namespace Data
string connStr = memLayer.ML.confReadString("B2BCondConnectionString");
//string connStrFiles = memLayer.ML.confReadString("B2BCondFilesConnectionString");
// connections del db vocabolario
taAF.Connection.ConnectionString = connStr;
taAS.Connection.ConnectionString = connStr;
taAssF2A.Connection.ConnectionString = connStr;
taElRich.Connection.ConnectionString = connStr;
@@ -44,6 +46,7 @@ namespace Data
#region area public
public DS_appTableAdapters.AnagFornitoriTableAdapter taAF;
public DS_appTableAdapters.AnagStatiTableAdapter taAS;
public DS_appTableAdapters.AssF2ATableAdapter taAssF2A;
public DS_appTableAdapters.ElencolRichTableAdapter taElRich;
+3
View File
@@ -23,6 +23,9 @@ namespace Data
bool answ = false;
// se in modalità debug --> email solo a destinatario _debugEmail
#if DEBUG
string newEmail = memLayer.ML.CRS("_debugEmail");
//loggo sostituzione...
logger.lg.scriviLog(string.Format("Applicazione in DEBUG: sostituzione email destinatario {0} --> {1} prima dell'invio", destinatario, newEmail), tipoLog.INFO);
destinatario = memLayer.ML.CRS("_debugEmail");
#endif
// se richeisto webPush...
+1
View File
@@ -21,6 +21,7 @@ namespace PUB
// verifico richeiste NON in carico...
// invio email a B2BC / Amministratore condominio
}
}
}
+8
View File
@@ -223,6 +223,7 @@
<Content Include="WebUserContols\mod_enrollByJumperAuthKey.ascx" />
<Content Include="WebUserContols\mod_ER_conclusi.ascx" />
<Content Include="WebUserContols\mod_ER_grid.ascx" />
<Content Include="WebUserContols\mod_ER_insNew.ascx" />
<Content Include="WebUserContols\mod_ER_richieste.ascx" />
<Content Include="WebUserContols\mod_F2C.ascx" />
<Content Include="WebUserContols\mod_forn2aree.ascx" />
@@ -631,6 +632,13 @@
<Compile Include="WebUserContols\mod_ER_grid.ascx.designer.cs">
<DependentUpon>mod_ER_grid.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserContols\mod_ER_insNew.ascx.cs">
<DependentUpon>mod_ER_insNew.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebUserContols\mod_ER_insNew.ascx.designer.cs">
<DependentUpon>mod_ER_insNew.ascx</DependentUpon>
</Compile>
<Compile Include="WebUserContols\mod_ER_richieste.ascx.cs">
<DependentUpon>mod_ER_richieste.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
+53
View File
@@ -0,0 +1,53 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_ER_insNew.ascx.cs" Inherits="PUB.WebUserContols.mod_ER_insNew" %>
<h5 class="card-title">Inserimento nuova richiesta</h5>
<div class="row">
<div class="col-3">Urgenza</div>
<div class="col-9">
<asp:DropDownList runat="server" ID="ddlPrior" DataSourceID="odsPrior" DataTextField="descrPriorita" DataValueField="idxPriorita" AppendDataBoundItems="true" CssClass="form-control" AutoPostBack="True">
</asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsPrior" SelectMethod="GetData" TypeName="Data.DS_appTableAdapters.AnagPriorTableAdapter" OldValuesParameterFormatString="original_{0}"></asp:ObjectDataSource>
</div>
<div class="col-3">Area</div>
<div class="col-9">
<asp:DropDownList runat="server" ID="ddlArea" DataSourceID="odsArea" DataTextField="Area" DataValueField="idxArea" AppendDataBoundItems="true" CssClass="form-control" AutoPostBack="True" OnSelectedIndexChanged="ddlArea_SelectedIndexChanged">
<asp:ListItem Text="-- Selezionare Area --" Value="0"></asp:ListItem>
</asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsArea" SelectMethod="GetData" TypeName="Data.DS_appTableAdapters.AnagAreeTableAdapter" OldValuesParameterFormatString="original_{0}"></asp:ObjectDataSource>
</div>
<div class="col-3">Fornitore</div>
<div class="col-6">
<asp:DropDownList runat="server" ID="ddlFornitore" DataSourceID="odsFornitore" DataTextField="label" DataValueField="value" AppendDataBoundItems="true" CssClass="form-control">
<asp:ListItem Text="-- Selezionare Fornitore --" Value="0"></asp:ListItem>
</asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsFornitore" SelectMethod="getByAreaCond" TypeName="Data.DS_UtilityTableAdapters.v_selFornTableAdapter" OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:ControlParameter ControlID="ddlArea" DefaultValue="0" Name="idxArea" PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="hfCond" DefaultValue="0" Name="idxCond" PropertyName="Value" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="col-3">
<asp:HiddenField runat="server" ID="hfCond" />
<asp:HiddenField runat="server" ID="hfCondReq" />
<asp:CheckBox runat="server" ID="chkShowAll" Text="Tutti" Checked="false" AutoPostBack="True" OnCheckedChanged="chkShowAll_CheckedChanged" />
</div>
<div class="col-3">Messaggio</div>
<div class="col-9">
<asp:TextBox runat="server" ID="txtMessaggio" placeholder="messaggio" CssClass="form-control" TextMode="MultiLine" Height="6em" />
</div>
<div class="col-3">Contatto</div>
<div class="col-9">
<asp:TextBox runat="server" ID="txtContatto" placeholder="nome" CssClass="form-control" />
</div>
<div class="col-3">Tel Contatto</div>
<div class="col-9">
<asp:TextBox runat="server" ID="txtTelefono" placeholder="telefono" CssClass="form-control" />
</div>
<div class="col-12 my-2">
<asp:LinkButton runat="server" ID="lblAddNew" CssClass="btn btn-success btn-block" OnClick="lblAddNew_Click">
<i class="fas fa-plus-square"></i> Registra richiesta
</asp:LinkButton>
</div>
</div>
+101
View File
@@ -0,0 +1,101 @@
using 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 PUB.WebUserContols
{
public partial class mod_ER_insNew : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Effetua update componente
/// </summary>
public void doUpdate()
{
chkShowAll.Checked = false;
fixSelCond();
refreshFornitori();
}
private void refreshFornitori()
{
ddlFornitore.Items.Clear();
ddlFornitore.DataBind();
}
/// <summary>
/// Condominio selezionato/richeisto
/// </summary>
public string idxCond
{
set
{
hfCondReq.Value = value;
}
}
private void fixSelCond()
{
// se è selezionato imposto nell'hiddenField 0, altrimenti valore selezionato da ddlCOndomini
if (chkShowAll.Checked)
{
hfCond.Value = "0";
}
else
{
hfCond.Value = hfCondReq.Value;
}
}
protected void chkShowAll_CheckedChanged(object sender, EventArgs e)
{
fixSelCond();
refreshFornitori();
}
protected void ddlArea_SelectedIndexChanged(object sender, EventArgs e)
{
fixSelCond();
refreshFornitori();
}
/// <summary>
/// Aggiunta di una richiesta
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lblAddNew_Click(object sender, EventArgs e)
{
int idxCond = 0;
int idxForn = 0;
int.TryParse(hfCond.Value, out idxCond);
// splitto fornitre... è idxFornitore.idxArea
string[] codForn = ddlFornitore.SelectedValue.Split('.');
int.TryParse(codForn[0], out idxForn);
string codCollab = "A1.C1"; //!!!FARE!!! ora è hard coded...
// Registro richiesta...
DtProxy.man.taElRich.InsertQuery(idxCond, idxForn, DateTime.Now, codCollab, txtContatto.Text.Trim(), txtTelefono.Text.Trim(), txtMessaggio.Text.Trim());
// invio email notifica al fornitore...
string mittente = memLayer.ML.CRS("_fromEmail");
string destinatario = memLayer.ML.CRS("_adminEmail"); // parto da admin email...
try
{
destinatario = DtProxy.man.taAF.getByKey(idxForn)[0].indirizzo_email;
}
catch
{ }
string oggetto = "Nuova richiesta intervento da b2bcondomini.it";
string corpo = string.Format("Buongiorno<br>Ti è stata assegnata una nuova richiesta di intervento da b2bcondomini.it.<br/>Il condominio interessato è <b>{0}</b>, pregasi contattare <b>{1}</b> al numero <b>{2}</b>.<br/>La richiesta indicata è la seguente:<br/>{3}<br/><br/>Seguire il <a href=\"http://www.b2bcondomini.it\">link seguente</a> per maggiori informazioni.", idxCond, txtContatto.Text, txtTelefono.Text, txtMessaggio.Text);
utils.inviaEmail(mittente, destinatario, oggetto, corpo, 3); //!!!HARD CODED a 3 tutto
Response.Redirect(devicesAuthProxy.pagCorrente);
}
}
}
+132
View File
@@ -0,0 +1,132 @@
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
namespace PUB.WebUserContols {
public partial class mod_ER_insNew {
/// <summary>
/// Controllo ddlPrior.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlPrior;
/// <summary>
/// Controllo odsPrior.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsPrior;
/// <summary>
/// Controllo ddlArea.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlArea;
/// <summary>
/// Controllo odsArea.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsArea;
/// <summary>
/// Controllo ddlFornitore.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlFornitore;
/// <summary>
/// Controllo odsFornitore.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsFornitore;
/// <summary>
/// Controllo hfCond.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfCond;
/// <summary>
/// Controllo hfCondReq.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfCondReq;
/// <summary>
/// Controllo chkShowAll.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkShowAll;
/// <summary>
/// Controllo txtMessaggio.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtMessaggio;
/// <summary>
/// Controllo txtContatto.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtContatto;
/// <summary>
/// Controllo txtTelefono.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtTelefono;
/// <summary>
/// Controllo lblAddNew.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lblAddNew;
}
}
+5 -2
View File
@@ -1,5 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_ER_richieste.ascx.cs" Inherits="PUB.WebUserContols.mod_ER_richieste" %>
<%@ Register Src="~/WebUserContols/mod_ER_grid.ascx" TagPrefix="uc1" TagName="mod_ER_grid" %>
<%@ Register Src="~/WebUserContols/mod_ER_insNew.ascx" TagPrefix="uc1" TagName="mod_ER_insNew" %>
<div class="card">
<div class="card-header alert alert-danger text-uppercase align-middle">
@@ -29,7 +31,8 @@
</div>
<div class="card-body">
<div runat="server" id="divInsNew" visible="false">
<h5 class="card-title">Inserimento nuova richiesta</h5>
<uc1:mod_ER_insNew runat="server" id="mod_ER_insNew" />
<%--<h5 class="card-title">Inserimento nuova richiesta</h5>
<div class="row">
<div class="col-3">Area</div>
<div class="col-9">
@@ -71,7 +74,7 @@
<i class="fas fa-plus-square"></i> Registra richiesta
</asp:LinkButton>
</div>
</div>
</div>--%>
</div>
<div id="divElenco" runat="server">
<h5 class="card-title">Elenco Richieste Aperte Amministratore</h5>
+3 -50
View File
@@ -38,6 +38,7 @@ namespace PUB.WebUserContols
private void saveSelections()
{
mod_ER_grid.idxCond = ddlCondominio.SelectedValue;
mod_ER_insNew.idxCond = ddlCondominio.SelectedValue;
}
protected void ddlCondominio_SelectedIndexChanged(object sender, EventArgs e)
@@ -67,61 +68,13 @@ namespace PUB.WebUserContols
if (divInsNew.Visible)
{
// aggiorno
chkShowAll.Checked = false;
fixSelCond();
refreshFornitori();
mod_ER_insNew.doUpdate();
saveSelections();
}
}
protected void ddlArea_SelectedIndexChanged(object sender, EventArgs e)
{
refreshFornitori();
}
private void refreshFornitori()
{
ddlFornitore.Items.Clear();
ddlFornitore.DataBind();
saveSelections();
}
protected void chkShowAll_CheckedChanged(object sender, EventArgs e)
{
fixSelCond();
}
private void fixSelCond()
{
// se è selezionato imposto nell'hiddenField 0, altrimenti valore selezionato da ddlCOndomini
if (chkShowAll.Checked)
{
hfCond.Value = "0";
}
else
{
hfCond.Value = ddlCondominio.SelectedValue;
}
}
protected void lblAddNew_Click(object sender, EventArgs e)
{
int idxCond = 0;
int idxForn = 0;
int.TryParse(hfCond.Value, out idxCond);
// splitto fornitre... è idxFornitore.idxArea
string[] codForn = ddlFornitore.SelectedValue.Split('.');
int.TryParse(codForn[0], out idxForn);
string codCollab = "A1.C1"; //!!!FARE!!! ora è hard coded...
// Registro richiesta...
DtProxy.man.taElRich.InsertQuery(idxCond, idxForn, DateTime.Now, codCollab, txtContatto.Text.Trim(), txtTelefono.Text.Trim(), txtMessaggio.Text.Trim());
// invio email notifica al fornitore...
string mittente = memLayer.ML.CRS("_fromEmail");
string destinatario = memLayer.ML.CRS("_adminEmail"); // !!!FARE!!! deve recuperare email del fornitore...
string oggetto = "Nuova richiesta intervento da b2bcondomini.it";
string corpo = string.Format("Buongiorno<br>Ti è stata assegnata una nuova richiesta di intervento da b2bcondomini.it.<br/>Il condominio interessato è <b>{0}</b>, pregasi contattare <b>{1}</b> al numero <b>{2}</b>.<br/>La richiesta indicata è la seguente:<br/>{3}<br/><br/>Seguire il <a href=\"http://www.b2bcondomini.it\">link seguente</a> per maggiori informazioni.", idxCond, txtContatto.Text, txtTelefono.Text, txtMessaggio.Text);
utils.inviaEmail(mittente, destinatario, oggetto, corpo, 3); //!!!HARD CODED a 3 tutto
Response.Redirect(devicesAuthProxy.pagCorrente);
}
protected void lbtResetCond_Click(object sender, EventArgs e)
{
+2 -83
View File
@@ -58,94 +58,13 @@ namespace PUB.WebUserContols {
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divInsNew;
/// <summary>
/// Controllo ddlArea.
/// Controllo mod_ER_insNew.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlArea;
/// <summary>
/// Controllo odsArea.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsArea;
/// <summary>
/// Controllo ddlFornitore.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlFornitore;
/// <summary>
/// Controllo odsFornitore.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsFornitore;
/// <summary>
/// Controllo hfCond.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfCond;
/// <summary>
/// Controllo chkShowAll.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkShowAll;
/// <summary>
/// Controllo txtMessaggio.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtMessaggio;
/// <summary>
/// Controllo txtContatto.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtContatto;
/// <summary>
/// Controllo txtTelefono.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtTelefono;
/// <summary>
/// Controllo lblAddNew.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lblAddNew;
protected global::PUB.WebUserContols.mod_ER_insNew mod_ER_insNew;
/// <summary>
/// Controllo divElenco.