diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index 9506ff901..29f488136 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -3806,6 +3806,10 @@ namespace BeWo.ServiceProxy "ult", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] System.Collections.Generic.List GetIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAllUnreadChatMessages", ReplyAction="http://tempuri.org/IOperationsService/GetAllUnreadChatMessagesResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAllUnreadChatMessagesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetAllUnreadChatMessages(System.Collections.Generic.List personOid); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDCResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewEmployeeAPPCodeDCBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid); @@ -4470,6 +4474,11 @@ namespace BeWo.ServiceProxy return base.Channel.GetIsChatActiveCustomerAPPCodeDC(customerOid, activeType); } + public System.Collections.Generic.List GetAllUnreadChatMessages(System.Collections.Generic.List personOid) + { + return base.Channel.GetAllUnreadChatMessages(personOid); + } + public BS.Shared.DataContracts.EmployeeAPPCodeDC CreateNewEmployeeAPPCodeDC(long employeeOid) { return base.Channel.CreateNewEmployeeAPPCodeDC(employeeOid); diff --git a/BeWo/View/ChatView.xaml.cs b/BeWo/View/ChatView.xaml.cs index dd6260499..ed29be5d1 100644 --- a/BeWo/View/ChatView.xaml.cs +++ b/BeWo/View/ChatView.xaml.cs @@ -1112,12 +1112,6 @@ namespace BeWo.View if (x.Contains(anzeige.SenderPersonOid.Value)) { - - /* if (sx == 0) // Muss noch getestet werden !!! bzw. muss noch angepast werden. - { - Chat.Items.Add(new KontakMessageBuilder("", "------------------------ Ungelesene Nachrichten -----------------------", "", 0)); - sx++; - }*/ if (anzeige.SenderPersonOid.Value == BeWoApp.LoggedOnUser.Employee.PersonOid) { int zahl = (int)x.IndexOf(anzeige.SenderPersonOid.Value); @@ -1127,15 +1121,25 @@ namespace BeWo.View } else { + if (sx == 0 && anzeige.IstGelesen != 1 ) + { + Chat.Items.Add(new KontakMessageBuilder("","------------------------ Ungelesene Nachrichten -----------------------", "", 0,false)); + sx++; + } + int zahl = (int)x.IndexOf(anzeige.SenderPersonOid.Value); Chat.Items.Add(new KontakMessageBuilder(person[zahl].FirstName, anzeige.ChatText, anzeige.Uhrzeit.ToString(), anzeige.SenderPersonOid.Value, false)); } + if (anzeige.IstGelesen != 1) + { + ServiceFacade.DoCustomerServiceSync(s => s.UpdateIstGelesen(anzeige.EmpfängerPersonOid.Value,anzeige.SenderPersonOid.Value,true)); + } } } - + } else { @@ -1286,6 +1290,69 @@ namespace BeWo.View ChatViewName.Height = 800; } } + + + public void PruefeInDbObNeueNachrichtenVerfügbar() + { + try + { + List listeOid = new List(); + + + foreach (var count in ita) + { + if (!listeOid.Contains(count.EmpfaengerOid)) + { + listeOid.Add(count.EmpfaengerOid); + } + } + + var x = ServiceFacade.DoOperationsServiceSync(s => s.GetAllUnreadChatMessages(listeOid)); + + foreach (var ChatMessage in x) + { + if (ChatMessage.IstGelesen != 1) + { + foreach (var aktChatPersons in ita) + { + if (aktChatPersons.EmpfaengerOid == ChatMessage.SenderPersonOid && aktChatPersons.TypeChat != ChatType.Team) + { + int aktc; + bool wasdrin = int.TryParse(aktChatPersons.Receivems, out aktc); + + if (wasdrin) + { + aktc++; + aktChatPersons.Receivems = aktc.ToString(); + + } + else + aktChatPersons.Receivems = 1.ToString(); + + }else if(aktChatPersons.EmpfaengerOid == ChatMessage.TeamOid) + { + int aktt; + bool wasdrin = int.TryParse(aktChatPersons.Receivems, out aktt); + + if (wasdrin) + { + aktt++; + aktChatPersons.Receivems = aktt.ToString(); + + } + else + aktChatPersons.Receivems = 1.ToString(); + + } + } + } + } + } + catch (Exception e) + { + MessageBox.Show("Fehler :" + e.Message + "\n" + e.StackTrace, "Info", MessageBoxButton.OK); + } + } } public class KontaktlistBuilder : INotifyPropertyChanged diff --git a/BeWo/View/HomeDragPanelView.xaml.cs b/BeWo/View/HomeDragPanelView.xaml.cs index 9504278aa..ebb108cee 100644 --- a/BeWo/View/HomeDragPanelView.xaml.cs +++ b/BeWo/View/HomeDragPanelView.xaml.cs @@ -1210,7 +1210,7 @@ namespace BeWo.View (ThreadStart) delegate { chatView.SetServerStats("Verbunden"); - + chatView.StatusSetting.SelectedIndex = 0; chatView.ButtonAlarmLabel.Visibility = Visibility.Collapsed; }); @@ -1236,6 +1236,16 @@ namespace BeWo.View chatView.StatusSetting.SelectedIndex = 1; }); } + + + Dispatcher.Invoke( + DispatcherPriority.Normal, + (ThreadStart)delegate + { + //Lade alle Ungelesenen Nachrichten + chatView.PruefeInDbObNeueNachrichtenVerfügbar(); + }); + chatView.Visibility = Visibility.Visible; } //#################### neu ########## <-- else @@ -1558,7 +1568,7 @@ namespace BeWo.View case DataIdentifier.Message: - UebergebeNachricht(paket.ChatMessage, person[0].FirstName + " " + person[0].LastName, + UebergebeNachricht(paket.ChatMessage, person[0].FirstName, persoid, paket.DataIdentifier, paket.RecipientPersonOid); break; diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index cbdc6aec2..9647ca51a 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -252,7 +252,9 @@ namespace BeWoPlanerMobil.Controllers var dokutypes = ValueListService.GetAllValueListEntrysByType(ValueListEntryType.DocumentType); - return SerializeObject(dokutypes); + var sortDoctypes = dokutypes.OrderBy(s => s.ValueListEntryOid).ToList(); + + return SerializeObject(sortDoctypes); } diff --git a/BeWoPlanerMobil/Scripts/initialization.js b/BeWoPlanerMobil/Scripts/initialization.js index 8ab779b9c..bc0a757a7 100644 --- a/BeWoPlanerMobil/Scripts/initialization.js +++ b/BeWoPlanerMobil/Scripts/initialization.js @@ -261,11 +261,13 @@ function checkDokuReiter() { document.getElementById('tddokureiter').style.display = 'none'; document.getElementById('trnormalDoku').style.display = 'table-row'; document.getElementById('notiz_textbox').style.width = '100%'; // 765 - document.getElementById('trnormalDokuLabel').textContent = s[0].TypeDescription; + document.getElementById('trnormalDokuLabel').textContent = s[0].TypeDescription; + } if (x == 2) { document.getElementById('DokName1').textContent = s[0].TypeDescription; document.getElementById('DokName2').textContent = s[1].TypeDescription; + document.getElementById('notiz_textbox1').style.width = '40%';//100% document.getElementById('notiz_textbox2').style.width = '40%'; @@ -280,7 +282,8 @@ function checkDokuReiter() { document.getElementById('DokName1').textContent = s[0].TypeDescription; document.getElementById('DokName2').textContent = s[1].TypeDescription; document.getElementById('DokName3').textContent = s[2].TypeDescription; - + + document.getElementById('notiz_textbox1').style.width = '50%'; document.getElementById('notiz_textbox2').style.width = '50%'; document.getElementById('notiz_textbox3').style.width = '50%'; @@ -298,8 +301,7 @@ function checkDokuReiter() { document.getElementById('DokName2').textContent = s[1].TypeDescription; document.getElementById('DokName3').textContent = s[2].TypeDescription; document.getElementById('DokName4').textContent = s[3].TypeDescription; - - + document.getElementById('notiz_textbox1').style.width = '76.9%'; document.getElementById('notiz_textbox2').style.width = '76.9%'; document.getElementById('notiz_textbox3').style.width = '76.9%'; @@ -314,6 +316,9 @@ function checkDokuReiter() { document.getElementById('Dokumentation2').style = 'width: 130%'; document.getElementById('Dokumentation3').style = 'width: 130%'; document.getElementById('Dokumentation4').style = 'width: 130%'; + + + } if (x == 5) { document.getElementById('DokName1').textContent = s[0].TypeDescription; diff --git a/BeWoPlanerMobil/Scripts/mainView.js b/BeWoPlanerMobil/Scripts/mainView.js index 8e9b365a2..3581bad14 100644 --- a/BeWoPlanerMobil/Scripts/mainView.js +++ b/BeWoPlanerMobil/Scripts/mainView.js @@ -201,6 +201,10 @@ function getDateObj(isFromStart) { function loadGoals(actionPath) { var selectedSC = $($("#scDropDown")).find(":selected").val(); makeAjaxCall("GET", actionPath, loadGoalsOnSuccess, { pCostbearer2SupportConceptOid: selectedSC }, null); + + if (document.getElementById('DokName1').style.display != 'none'){ + document.getElementById('DokName1').click(); + } } function toggleMenu() { @@ -553,6 +557,7 @@ function validateServiceRecordBeforeSubmit() { var vonDatum = getDateTimeStringWithLeadingZeros(x); var bisDatum = getDateTimeStringWithLeadingZeros(y); + var isValidRecord = true; makeAjaxCall("POST", checkRightsUrl, function(json) { diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index 4fff05548..85be85b90 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -164,8 +164,8 @@
-
-