Ok invio tickets da GPW
This commit is contained in:
@@ -659,6 +659,7 @@
|
||||
<Content Include="WebUserControls\cmp_menuTop.ascx" />
|
||||
<Content Include="WebUserControls\cmp_periodoAnalisi.ascx" />
|
||||
<Content Include="WebUserControls\cmp_righePag.ascx" />
|
||||
<Content Include="WebUserControls\cmp_ticketFreeActiv.ascx" />
|
||||
<Content Include="WebUserControls\cmp_toggle.ascx" />
|
||||
<Content Include="WebUserControls\cmp_userCard.ascx" />
|
||||
<Content Include="WebUserControls\cmp_userLicense.ascx" />
|
||||
@@ -1079,6 +1080,13 @@
|
||||
<Compile Include="WebUserControls\cmp_righePag.ascx.designer.cs">
|
||||
<DependentUpon>cmp_righePag.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_ticketFreeActiv.ascx.cs">
|
||||
<DependentUpon>cmp_ticketFreeActiv.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_ticketFreeActiv.ascx.designer.cs">
|
||||
<DependentUpon>cmp_ticketFreeActiv.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\cmp_toggle.ascx.cs">
|
||||
<DependentUpon>cmp_toggle.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_ticketFreeActiv.ascx.cs" Inherits="GPW_Admin.WebUserControls.cmp_ticketFreeActiv" %>
|
||||
|
||||
<div class="row border border-warning table-warning w-100">
|
||||
<div class="col-6">
|
||||
<asp:FormView runat="server" ID="frmView" DataSourceID="ods" DataKeyNames="idxDipendente">
|
||||
<ItemTemplate>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2 h3">
|
||||
<b>
|
||||
<asp:Label ID="CognomeLabel" runat="server" Text='<%# Eval("Cognome") %>' /></b>
|
||||
<asp:Label ID="NomeLabel" runat="server" Text='<%# Eval("Nome") %>' />
|
||||
</div>
|
||||
<div class="px-2">
|
||||
matr:
|
||||
<asp:Label ID="matricolaLabel" runat="server" Text='<%# Eval("matricola") %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
nato:
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Eval("dataNascita","{0:dd/MM/yyyy}") %>' />
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("luogoNascita") %>' />
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("provNascita") %>' />
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Eval("nazNascita") %>' />
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<asp:Label ID="CFLabel" runat="server" Text='<%# Eval("CF") %>' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
<asp:Label ID="emailLabel" runat="server" Text='<%# Eval("email") %>' />
|
||||
</div>
|
||||
<div class="px-2">
|
||||
periodo lavorativo:
|
||||
<asp:Label ID="dataAssunzioneLabel" runat="server" Text='<%# Eval("dataAssunzione","{0:dd/MM/yyyy}") %>' />
|
||||
-->
|
||||
<asp:Label ID="dataCessazioneLabel" runat="server" Text='<%# Eval("dataCessazione","{0:dd/MM/yyyy}") %>' />
|
||||
</div>
|
||||
<div class="px-2">
|
||||
Attivo:
|
||||
<asp:CheckBox ID="attivoCheckBox" runat="server" Checked='<%# Eval("attivo") %>' Enabled="false" />
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:FormView>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<b>Dati richiesta</b>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" style="width: 2.5em;"><i class="fa fa-envelope-o" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<asp:TextBox runat="server" ID="txtEmail" ToolTip="Email richiedente" placeholder="Email Richiedente" class="form-control" TextMode="Email"></asp:TextBox>
|
||||
<%--</div>
|
||||
<div class="input-group">--%>
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" style="width: 2.5em;"><i class="fa fa-phone" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<asp:TextBox runat="server" ID="txtPhone" ToolTip="Tel richiedente" placeholder="Tel Richiedente" class="form-control" TextMode="Phone"></asp:TextBox>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" style="width: 2.5em;"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<asp:TextBox runat="server" ID="txtCausale" ToolTip="Causale Richiesta" placeholder="Causale Richiesta" class="form-control" TextMode="MultiLine"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<br />
|
||||
<asp:LinkButton runat="server" ID="lbtSendReq" CssClass="btn btn-block btn-primary" OnClick="lbtSendReq_Click">Invio richiesta <i class="fa fa-paper-plane" aria-hidden="true"></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByIdx" TypeName="GPW_data.DS_ApplicazioneTableAdapters.DipendentiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfIdxDip" DefaultValue="0" Name="idxDipendente" PropertyName="Value" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfIdxDip" />
|
||||
@@ -0,0 +1,92 @@
|
||||
using GPW_data;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
public partial class cmp_ticketFreeActiv : BaseUserControl
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected string ChiaveUtente
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (currRowDip != null)
|
||||
{
|
||||
answ = currRowDip.authKey;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cod impiego calcolato
|
||||
/// </summary>
|
||||
protected string CodImpiego
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataProxy.DP.hashCodImpiego(currRowDip);
|
||||
}
|
||||
}
|
||||
|
||||
protected DS_Applicazione.DipendentiRow currRowDip
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataProxy.DP.getRowDip(idxDipSel);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public int idxDipSel
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(hfIdxDip.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfIdxDip.Value = $"{value}";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void lbtSendReq_Click(object sender, EventArgs e)
|
||||
{
|
||||
// genero nuova authKey x SMART device
|
||||
var rigaDip = DataProxy.DP.getRowDip(idxDipSel);
|
||||
if (rigaDip != null)
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
|
||||
// chiama resync dati licenza (cod impiego / codAuth)
|
||||
bool fatto = licenzeGPW.sendTicketReq(txtEmail.Text.Trim(), txtPhone.Text.Trim(), txtCausale.Text.Trim(), CodImpiego).Result;
|
||||
frmView.DataBind();
|
||||
raiseAddNew();
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GPW_Admin.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class cmp_ticketFreeActiv
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// frmView 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.FormView frmView;
|
||||
|
||||
/// <summary>
|
||||
/// txtEmail 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 txtEmail;
|
||||
|
||||
/// <summary>
|
||||
/// txtPhone 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 txtPhone;
|
||||
|
||||
/// <summary>
|
||||
/// txtCausale 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 txtCausale;
|
||||
|
||||
/// <summary>
|
||||
/// lbtSendReq 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 lbtSendReq;
|
||||
|
||||
/// <summary>
|
||||
/// ods 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.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// hfIdxDip 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.HiddenField hfIdxDip;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<asp:FormView runat="server" ID="frmView" DataSourceID="ods" DataKeyNames="idxDipendente" CssClass="border border-info table-info w-100">
|
||||
<ItemTemplate>
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
<div class="col-10">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2 h3">
|
||||
<b>
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="col-2">
|
||||
<asp:LinkButton runat="server" ID="lbtActivate" CssClass="btn btn-block btn-success" Visible='<%# canActivate(Eval("attivo"), Eval("dataAssunzione"), Eval("dataCessazione")) %>' OnClick="lbtActivate_Click">Attiva Utente <i class="fa fa-link" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbrRelease" CssClass="btn btn-block btn-danger" Visible='<%# canRemove(Eval("attivo"), Eval("dataAssunzione"), Eval("dataCessazione")) %>' OnClick="lbrRelease_Click">Cessazione Utente <i class="fa fa-unlink" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbtReissue" CssClass="btn btn-block btn-info" Visible='<%# canReissue(Eval("attivo"), Eval("dataAssunzione"), Eval("dataCessazione")) %>' OnClick="lbtReissue_Click">Assegna licenza <i class="fa fa-exclamation-triangle" aria-hidden="true"></i></asp:LinkButton>
|
||||
|
||||
@@ -41,8 +41,9 @@
|
||||
<asp:LinkButton ID="lbtReset" runat="server" CssClass="btn btn-sm btn-info" ToolTip='<%# traduci("Reset") %>' CausesValidation="False" OnClick="btnReset_Click" Visible="true"><i class="fa fa-refresh" aria-hidden="true"></i></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbtSelect" CssClass="btn btn-sm btn-info" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbtEdit" CssClass="btn btn-sm btn-primary" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'><i class="fa fa-edit" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbtSelect" OnClick="lbtSelect_Click" CssClass="btn btn-sm btn-info" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbtEdit" CssClass="btn btn-sm btn-primary" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>' Visible='<%# checkFreeEdit(Eval("idxDipendente")) %>'><i class="fa fa-edit" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbtTicket" CssClass="btn btn-sm btn-warning" CausesValidation="False" CommandName="Select" OnClick="lbtTicket_Click" ToolTip='<%# traduci("Unlock") %>' Visible='<%# !checkFreeEdit(Eval("idxDipendente")) %>'><i class="fa fa-question-circle" aria-hidden="true"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbtUpdate" CssClass="btn btn-sm btn-success" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update") %>'><i class="fa fa-check" aria-hidden="true"></i></asp:LinkButton>
|
||||
@@ -221,7 +222,7 @@
|
||||
DataValueField="value" />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="AuthKey" SortExpression="authKey"
|
||||
<%--<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="AuthKey" SortExpression="authKey"
|
||||
ItemStyle-Wrap="false">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblauthKey" runat="server" Text='<%# Eval("authKey") %>' />
|
||||
@@ -232,7 +233,7 @@
|
||||
<FooterTemplate>
|
||||
<asp:Label ID="lblauthKey" runat="server" Text='<%# Eval("authKey") %>' />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="StatoLicenza" SortExpression="attivo">
|
||||
<ItemTemplate>
|
||||
<div class="row">
|
||||
@@ -334,4 +335,5 @@
|
||||
<asp:ObjectDataSource ID="odsOrario" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selCodOrarioTableAdapter"></asp:ObjectDataSource>
|
||||
<asp:ObjectDataSource runat="server" ID="odsGruppi" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selGruppiTableAdapter"></asp:ObjectDataSource>
|
||||
TypeName="GPW_data.DS_UtilityTableAdapters.v_selGruppiTableAdapter"></asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfReqTicket" />
|
||||
@@ -33,6 +33,20 @@ namespace GPW_Admin.WebUserControls
|
||||
}
|
||||
}
|
||||
|
||||
public bool isTicketReq
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(hfReqTicket.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfReqTicket.Value = $"{value}";
|
||||
}
|
||||
}
|
||||
|
||||
public int numLicenze
|
||||
{
|
||||
get => licenzeGPW.licenzeAttive;
|
||||
@@ -104,6 +118,7 @@ namespace GPW_Admin.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
isTicketReq = false;
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
@@ -164,7 +179,7 @@ namespace GPW_Admin.WebUserControls
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// mostro gestione licenza DIP
|
||||
// altrimenti mostro gestione licenza DIP
|
||||
raiseAddNew();
|
||||
}
|
||||
|
||||
@@ -232,6 +247,26 @@ namespace GPW_Admin.WebUserControls
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta selezione utente
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
isTicketReq = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta inserimento ticket supporto
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtTicket_Click(object sender, EventArgs e)
|
||||
{
|
||||
isTicketReq = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// check licenze in fase di update...
|
||||
/// </summary>
|
||||
@@ -260,6 +295,7 @@ namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
isTicketReq = false;
|
||||
fullRefresh();
|
||||
}
|
||||
fixVisibility();
|
||||
@@ -342,6 +378,37 @@ namespace GPW_Admin.WebUserControls
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Verifica licenza (se sia libera x modifca o prima associazione)
|
||||
/// </summary>
|
||||
/// <param name="idxDIp"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkFreeEdit(object idxDip)
|
||||
{
|
||||
bool answ = false;
|
||||
int IdxDip = 0;
|
||||
int.TryParse($"{idxDip}", out IdxDip);
|
||||
if (IdxDip > 0)
|
||||
{
|
||||
var localUserList = DataProxy.DP.taDipendenti.getAttivi(false);
|
||||
// cerco!
|
||||
var currUser = localUserList.Where(x => x.idxDipendente == IdxDip).FirstOrDefault();
|
||||
|
||||
// verifico SE sia disponibile licenza...
|
||||
var activationsList = licenzeGPW.ListaAttivazioni;
|
||||
var currHash = DataProxy.DP.hashCodImpiego(currUser);
|
||||
var currAct = activationsList.Where(x => x.CodImpiego == currHash).FirstOrDefault();
|
||||
// se NON c'è licenza è ok (editabile)
|
||||
answ = (currAct == null);
|
||||
// ora verifico: se NON ha licenza OK, altrimenti deve essere scaduta...
|
||||
if (!answ)
|
||||
{
|
||||
answ = currAct.VetoUnlock < DateTime.Today;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica licenza (se sia validata/associata a quelle in memoria)
|
||||
/// </summary>
|
||||
|
||||
@@ -103,5 +103,14 @@ namespace GPW_Admin.WebUserControls
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsGruppi;
|
||||
|
||||
/// <summary>
|
||||
/// hfReqTicket 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.HiddenField hfReqTicket;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<%@ Register Src="~/WebUserControls/cmp_userCard.ascx" TagPrefix="uc1" TagName="cmp_userCard" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_toggle.ascx" TagPrefix="uc1" TagName="cmp_toggle" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_userLicense.ascx" TagPrefix="uc1" TagName="cmp_userLicense" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_ticketFreeActiv.ascx" TagPrefix="uc1" TagName="cmp_ticketFreeActiv" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="server">
|
||||
<div class="card m-2">
|
||||
@@ -23,6 +24,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<uc1:cmp_userLicense runat="server" ID="cmp_userLicense" />
|
||||
<uc1:cmp_ticketFreeActiv runat="server" id="cmp_ticketFreeActiv" />
|
||||
<uc1:mod_adminDipendenti ID="mod_adminDipendenti1" runat="server" />
|
||||
<uc1:cmp_userCard runat="server" ID="cmp_userCard" />
|
||||
</div>
|
||||
|
||||
@@ -59,17 +59,28 @@ namespace GPW_Admin
|
||||
cmp_userCard.showAll = mod_adminDipendenti1.showAll;
|
||||
cmp_userCard.showExt = cmp_toggleLinkExt.toggleValue;
|
||||
cmp_userLicense.Visible = IdxDipSel > 0;
|
||||
cmp_ticketFreeActiv.Visible = cmp_ticketFreeActiv.idxDipSel > 0;
|
||||
}
|
||||
|
||||
private void Mod_adminDipendenti1_eh_addNew(object sender, EventArgs e)
|
||||
{
|
||||
IdxDipSel = mod_adminDipendenti1.IdxDipSel;
|
||||
if (mod_adminDipendenti1.isTicketReq)
|
||||
{
|
||||
IdxDipSel = 0;
|
||||
cmp_ticketFreeActiv.idxDipSel = mod_adminDipendenti1.IdxDipSel;
|
||||
}
|
||||
else
|
||||
{
|
||||
IdxDipSel = mod_adminDipendenti1.IdxDipSel;
|
||||
cmp_ticketFreeActiv.idxDipSel = 0;
|
||||
}
|
||||
fixDisplay();
|
||||
}
|
||||
|
||||
private void Mod_adminDipendenti1_eh_doReset(object sender, EventArgs e)
|
||||
{
|
||||
IdxDipSel = 0;
|
||||
cmp_ticketFreeActiv.idxDipSel = 0;
|
||||
fixDisplay();
|
||||
}
|
||||
|
||||
|
||||
Generated
+9
@@ -41,6 +41,15 @@ namespace GPW_Admin
|
||||
/// </remarks>
|
||||
protected global::GPW_Admin.WebUserControls.cmp_userLicense cmp_userLicense;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_ticketFreeActiv control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::GPW_Admin.WebUserControls.cmp_ticketFreeActiv cmp_ticketFreeActiv;
|
||||
|
||||
/// <summary>
|
||||
/// mod_adminDipendenti1 control.
|
||||
/// </summary>
|
||||
|
||||
@@ -10,6 +10,19 @@ namespace GPW_data
|
||||
{
|
||||
#region Public Enums
|
||||
|
||||
public enum StatoRichiesta
|
||||
{
|
||||
ND = 0,
|
||||
|
||||
Richiesta,
|
||||
|
||||
Valutazione,
|
||||
|
||||
Approvata,
|
||||
|
||||
Rifiutata
|
||||
}
|
||||
|
||||
public enum TipoLicenza
|
||||
{
|
||||
ND = 0,
|
||||
@@ -95,6 +108,97 @@ namespace GPW_data
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public class SupportRequest
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string CodApp { get; set; } = "";
|
||||
public string CodImp { get; set; } = "";
|
||||
public string CodInst { get; set; } = "";
|
||||
public string ContactEmail { get; set; } = "";
|
||||
public string ContactPhone { get; set; } = "";
|
||||
public int idxSubLic { get; set; } = 0;
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get => !string.IsNullOrEmpty(MasterKey) && !string.IsNullOrEmpty(ContactEmail) && !string.IsNullOrEmpty(CodInst) && !string.IsNullOrEmpty(CodApp);
|
||||
}
|
||||
|
||||
public string MasterKey { get; set; } = "";
|
||||
public string ReqBody { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto Ticket
|
||||
/// </summary>
|
||||
public class TicketDTO
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Codice univoco della sub licenza (opzionale)
|
||||
/// </summary>
|
||||
public string CodImpiego { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Contatto email del cliente richiedente
|
||||
/// </summary>
|
||||
public string ContactEmail { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Contatto telefonico del cliente richiedente
|
||||
/// </summary>
|
||||
public string ContactPhone { get; set; } = "";
|
||||
|
||||
public DateTime DtReq { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// IDX licenza master
|
||||
/// </summary>
|
||||
public int IdxLic { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// IDX licenza child (opzionale)
|
||||
/// </summary>
|
||||
public int IdxSubLic { get; set; } = 0;
|
||||
|
||||
public int IdxTicket { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Motivazione della richiesta
|
||||
/// </summary>
|
||||
public string ReqBody { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Stato richiesta
|
||||
/// </summary>
|
||||
public StatoRichiesta Status { get; set; } = StatoRichiesta.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Risposta alla richiesta
|
||||
/// </summary>
|
||||
public string SupplAnsw { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Email del responsabile dell'azione (interno - supplier)
|
||||
/// </summary>
|
||||
public string SupplEmail { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Cod dell'user responsabile dell'azione (interno - supplier)
|
||||
/// </summary>
|
||||
public string SupplUserCode { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia di licenza gestita
|
||||
/// </summary>
|
||||
public TipoLicenza Tipo { get; set; } = TipoLicenza.UserKey;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public class UserLicenseRequest
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
@@ -680,6 +680,64 @@ namespace GPW_data
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tenta invio di un ticket x licenza indicata
|
||||
/// </summary>
|
||||
/// <param name="contEmail"></param>
|
||||
/// <param name="contPhone"></param>
|
||||
/// <param name="reqBody"></param>
|
||||
/// <param name="codImpiego"></param>
|
||||
/// <param name="idxSubLic"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<bool> sendTicketReq(string contEmail, string contPhone, string reqBody, string codImpiego, int idxSubLic = 0)
|
||||
{
|
||||
bool answ = false;
|
||||
// cerco online
|
||||
RestClient client = new RestClient(apiUrl);
|
||||
string MKeyEnc = HttpUtility.UrlEncode(MasterKey);
|
||||
var request = new RestRequest($"/api/ticket/sendReq", DataFormat.Json);
|
||||
|
||||
SupportRequest richiesta = new SupportRequest()
|
||||
{
|
||||
ContactEmail = contEmail,
|
||||
ContactPhone = contPhone,
|
||||
ReqBody = reqBody,
|
||||
CodInst = installazione,
|
||||
CodApp = applicazione,
|
||||
MasterKey = MasterKey,
|
||||
idxSubLic = idxSubLic,
|
||||
CodImp = codImpiego
|
||||
};
|
||||
|
||||
request.AddJsonBody(richiesta);
|
||||
var response = client.Post(request);
|
||||
|
||||
// controllo risposta
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
// verifico risposta
|
||||
string rawData = response.Content;
|
||||
try
|
||||
{
|
||||
if (rawData.StartsWith("["))
|
||||
{
|
||||
// deserializzo
|
||||
List<TicketDTO> tickets = JsonConvert.DeserializeObject<List<TicketDTO>>(rawData);
|
||||
answ = tickets != null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// deserializzo singolo
|
||||
TicketDTO tickets = JsonConvert.DeserializeObject<TicketDTO>(rawData);
|
||||
answ = tickets != null;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tenta attivazione licenza dato codice impiego
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user