Chat-Code Erneuern und klienigkeiten hinzugefügt
This commit is contained in:
@@ -4415,6 +4415,14 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetHandOutPdfForChatBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
BS.Shared.DataContracts.PdfChatHandoutDC GetHandOutPdfForChat(string customerId, string apikey);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeletEmloyeeChatCode", ReplyAction="http://tempuri.org/IOperationsService/DeletEmloyeeChatCodeResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeletEmloyeeChatCodeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
bool DeletEmloyeeChatCode(string apikey, string kundennummer, long userOid);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeletCustomerChatCode", ReplyAction="http://tempuri.org/IOperationsService/DeletCustomerChatCodeResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeletCustomerChatCodeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
bool DeletCustomerChatCode(string apikey, string kundennummer, long userOid);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeactivateInvoices", ReplyAction="http://tempuri.org/IOperationsService/DeactivateInvoicesResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeactivateInvoicesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
void DeactivateInvoices(System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceDC> invoices);
|
||||
@@ -5235,6 +5243,16 @@ namespace BeWo.ServiceProxy
|
||||
return base.Channel.GetHandOutPdfForChat(customerId, apikey);
|
||||
}
|
||||
|
||||
public bool DeletEmloyeeChatCode(string apikey, string kundennummer, long userOid)
|
||||
{
|
||||
return base.Channel.DeletEmloyeeChatCode(apikey, kundennummer, userOid);
|
||||
}
|
||||
|
||||
public bool DeletCustomerChatCode(string apikey, string kundennummer, long userOid)
|
||||
{
|
||||
return base.Channel.DeletCustomerChatCode(apikey, kundennummer, userOid);
|
||||
}
|
||||
|
||||
public void DeactivateInvoices(System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceDC> invoices)
|
||||
{
|
||||
base.Channel.DeactivateInvoices(invoices);
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
Height="21" x:Name="GenerateButon"/>
|
||||
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" MinWidth="120" x:Name="GeneratetTexfield" IsReadOnly="True"/>
|
||||
|
||||
|
||||
<Button Content="Chat-Code Entfernen" Grid.Row="0" Grid.Column="2" Height="23" Click="RemoveCode_OnClick"/>
|
||||
<!-- <Label x:Name="lblIsChatAktive" Grid.Column="0" Grid.Row="1" Margin="3" Content="Chat Aktivieren" />-->
|
||||
|
||||
|
||||
@@ -55,6 +55,12 @@
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Margin="3" x:Name="TXTPasswort" />
|
||||
|
||||
<Button Content="Speichern" Click="SpeicherButton_OnClick" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="3" HorizontalAlignment="Right"/>
|
||||
|
||||
|
||||
<Button Grid.Column="0" Grid.Row="4" Content="Handout PDF Anzeigen" Click="ZeigeHandoutPDF_OnClick " Margin="3" VerticalAlignment="Center" HorizontalAlignment="Left" Height="21"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- IsChecked="{Binding Path=IsChatAktiv, UpdateSourceTrigger=PropertyChanged}" -->
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
@@ -211,6 +212,10 @@ namespace BeWo.View
|
||||
|
||||
GeneratetTexfield.Text = getCustomerAppCode[getCustomerAppCode.Count - 1].CustomerCode;
|
||||
}
|
||||
|
||||
if (!GeneratetTexfield.Text.Equals("")) {
|
||||
GenerateButon.Content = "Chat-Code erneuern";
|
||||
}
|
||||
//else
|
||||
// x = 0;
|
||||
|
||||
@@ -269,5 +274,63 @@ namespace BeWo.View
|
||||
{
|
||||
ServiceFacade.DoCustomerServiceSync(s => s.SetBenutzerPasswortChatAppCode(customerOid.Value, TXTBenutzerName.Text, TXTPasswort.Text));
|
||||
}
|
||||
|
||||
private void RemoveCode_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!GeneratetTexfield.Text.Equals(""))
|
||||
{
|
||||
var isdeletet = ServiceFacade.DoOperationsServiceSync(r => r.DeletCustomerChatCode(BeWoApp.Mandator.Apikey, BeWoApp.Tenant, personOid.Value));
|
||||
|
||||
if (isdeletet)
|
||||
{
|
||||
GeneratetTexfield.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Löschen des ChatCodes Fehlgeschlagen.", "Fehler");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Sie müssen vorher einen Chat-Code generieren, bevor sie ihn löschen können", "Info",
|
||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private void ZeigeHandoutPDF_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var handout = ServiceFacade.DoOperationsServiceSync(r => r.GetHandOutPdfForChat(BeWoApp.Tenant, BeWoApp.Mandator.Apikey));
|
||||
|
||||
if (handout.File != null && !handout.File.Equals(""))
|
||||
{
|
||||
handout.Result = 0;
|
||||
}
|
||||
|
||||
switch (handout.Result)
|
||||
{
|
||||
case 0:
|
||||
//Hier die pdf anzeigen
|
||||
|
||||
Process.Start(handout.File);
|
||||
|
||||
break;
|
||||
case 11:
|
||||
MessageBox.Show("Kundennummer unbekannt.", "Fehler", MessageBoxButton.OK);
|
||||
break;
|
||||
case 12:
|
||||
MessageBox.Show("Der API-Key ist falsch -> Auth-Error.", "Fehler", MessageBoxButton.OK);
|
||||
break;
|
||||
case 13:
|
||||
MessageBox.Show("Es existiert kein API-Key für die angegebene Kundennummer.", "Fehler", MessageBoxButton.OK);
|
||||
break;
|
||||
case 40:
|
||||
MessageBox.Show("Vorlage nicht gefunden.", "Fehler", MessageBoxButton.OK);
|
||||
break;
|
||||
case 41:
|
||||
MessageBox.Show("Ungültige Custom-Logo-URL.", "Fehler", MessageBoxButton.OK);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,11 +23,10 @@
|
||||
<GroupBox Grid.ColumnSpan="2" Padding="5" Style="{StaticResource ObjectEditGroupBox}" Header="Chat Service">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -42,6 +41,8 @@
|
||||
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" MinWidth="120" x:Name="GeneratetTexfield" IsReadOnly="True" />
|
||||
|
||||
<Button Content="Chat-Code Entfernen" Grid.Row="0" Grid.Column="2" Height="23" Click="RemoveCode_OnClick"/>
|
||||
|
||||
<!--<Label x:Name="lblIsChatAktive" Grid.Column="0" Grid.Row="1" Content="Chat Aktivieren" />
|
||||
|
||||
<CheckBox x:Name="ChatAktive" Grid.Column="1" Grid.Row="1" Margin="3" Height="23" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" />
|
||||
|
||||
@@ -170,12 +170,19 @@ namespace BeWo.View
|
||||
|
||||
GeneratetTexfield.Text = getEmployeeAppCode[getEmployeeAppCode.Count - 1].EmployeeCode;
|
||||
}
|
||||
|
||||
|
||||
if (!GeneratetTexfield.Text.Equals(""))
|
||||
{
|
||||
GenerateButon.Content = "Chat-Code erneuern";
|
||||
}
|
||||
|
||||
#region Nicht mehr gebrauchter Code
|
||||
|
||||
/* String a = "";
|
||||
String b = "";
|
||||
bool c = false;
|
||||
*/
|
||||
String b = "";
|
||||
bool c = false;
|
||||
*/
|
||||
|
||||
// a = getEmployeeAppCode[getEmployeeAppCode.Count - 1].EmployeeCode;
|
||||
|
||||
@@ -199,6 +206,7 @@ namespace BeWo.View
|
||||
|
||||
|
||||
// ChatServiceBuilder builder = new ChatServiceBuilder(c,b,a);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -238,5 +246,27 @@ namespace BeWo.View
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveCode_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!GeneratetTexfield.Text.Equals(""))
|
||||
{
|
||||
var isdeletet = ServiceFacade.DoOperationsServiceSync(r => r.DeletEmloyeeChatCode(BeWoApp.Mandator.Apikey, BeWoApp.Tenant, personOid.Value));
|
||||
|
||||
if (isdeletet)
|
||||
{
|
||||
GeneratetTexfield.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Löschen des ChatCodes Fehlgeschlagen.", "Fehler");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Sie müssen vorher einen Chat-Code generieren, bevor sie ihn löschen können", "Info",
|
||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -699,5 +699,13 @@ namespace BeWo.Service.ServiceContracts
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
PdfChatHandoutDC GetHandOutPdfForChat(string customerId, string apikey);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
bool DeletEmloyeeChatCode(string apikey, string kundennummer, long userOid);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
bool DeletCustomerChatCode(string apikey, string kundennummer, long userOid);
|
||||
}
|
||||
}
|
||||
@@ -4645,9 +4645,78 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return handout;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool DeletCustomerChatCode(string apikey,string kundennummer,long userOid)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeletZufallsCode(apikey, kundennummer, "C" + userOid);
|
||||
|
||||
var customerappcode = DAOFactory.SearchDAO.FindAllCustomerAppCodes(userOid);
|
||||
|
||||
var anzahl = customerappcode.Count();
|
||||
|
||||
if (anzahl > 0)
|
||||
{
|
||||
foreach (var code in customerappcode)
|
||||
{
|
||||
code.CustomerCode = "";
|
||||
code.CustomerCodeGenDate = DateTime.Now;
|
||||
}
|
||||
|
||||
|
||||
DAOFactory.GenericDAO.Update(customerappcode);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
// throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public bool DeletEmloyeeChatCode(string apikey, string kundennummer, long userOid)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeletZufallsCode(apikey, kundennummer, "E" + userOid);
|
||||
|
||||
var employeeappcode = DAOFactory.SearchDAO.FindAllEmployeeAppCodes(userOid);
|
||||
|
||||
var anzahl = employeeappcode.Count();
|
||||
|
||||
if (anzahl > 0)
|
||||
{
|
||||
foreach (var code in employeeappcode)
|
||||
{
|
||||
code.EmployeeCode = "";
|
||||
code.EmployeeCodeGenDate = DateTime.Now;
|
||||
}
|
||||
|
||||
|
||||
DAOFactory.GenericDAO.Update(employeeappcode);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
//throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user