diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index 13a217ba7..8eb2f1dbd 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -1056,6 +1056,10 @@ namespace BeWo.ServiceProxy [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetOrganisationsForPersonBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] System.Collections.Generic.List GetOrganisationsForPerson(long personoid); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetPersonForOrganisations", ReplyAction="http://tempuri.org/ICustomerService/GetPersonForOrganisationsResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetPersonForOrganisationsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetPersonForOrganisations(long organisationoid); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/UpdateOrganisation", ReplyAction="http://tempuri.org/ICustomerService/UpdateOrganisationResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/UpdateOrganisationBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] long UpdateOrganisation(BS.Shared.DataContracts.OrganisationDC pOrganisationDC); @@ -1776,6 +1780,11 @@ namespace BeWo.ServiceProxy return base.Channel.GetOrganisationsForPerson(personoid); } + public System.Collections.Generic.List GetPersonForOrganisations(long organisationoid) + { + return base.Channel.GetPersonForOrganisations(organisationoid); + } + public long UpdateOrganisation(BS.Shared.DataContracts.OrganisationDC pOrganisationDC) { return base.Channel.UpdateOrganisation(pOrganisationDC); diff --git a/BeWo/View/Detail/CustomerView.xaml.cs b/BeWo/View/Detail/CustomerView.xaml.cs index e10ffb46f..e6cba8bbd 100644 --- a/BeWo/View/Detail/CustomerView.xaml.cs +++ b/BeWo/View/Detail/CustomerView.xaml.cs @@ -855,6 +855,10 @@ namespace BeWo.View.Detail popup_organisation.IsOpen = false; organisationsearchview.ItemSelected -= organisationsearchview_EnvironmentOrganisationSelected; ViewModel.EnvironmentOrganisations.NewVM.Organisation = e.Data; + + var orgList = ServiceFacade.DoCustomerServiceSync(s => s.GetPersonForOrganisations(e.Data.OrganisationOid)); + ansprechpartnersearchview.ObjectList = orgList; + popupedit_environmentOrganisationSearch.Focus(); } @@ -863,7 +867,7 @@ namespace BeWo.View.Detail { popup_ansprechpartner.IsOpen = false; ansprechpartnersearchview.ItemSelected -= ansprechpartnersearchview_EnvironmentPersonSelected; - ViewModel.EnvironmentOrganisations.NewVM.Person = e.Data; + ViewModel.EnvironmentPersons.NewVM.Person = e.Data; popupedit_environmentAnsprechpartnerSearch.Focus(); } @@ -1155,7 +1159,7 @@ namespace BeWo.View.Detail { VMFactory.CreatePersonVMAsync((pDC as CompactPersonDC).PersonOid, cb => this.Dispatch( - () => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch( + () => BeWoUtils.OpenModalViewWindow(cb, this, () => this.Dispatch( () => BeWoUtils.UpdateAllViews(ViewModel.EnvironmentPersons.NewVM.Person ?? (pDC as CompactPersonDC))), personSavedOrUpdated: (s, args) => this.Dispatch(delegate{})))); } diff --git a/BeWo/View/Detail/ServiceRecordView2.xaml.cs b/BeWo/View/Detail/ServiceRecordView2.xaml.cs index 15368f19d..417645601 100644 --- a/BeWo/View/Detail/ServiceRecordView2.xaml.cs +++ b/BeWo/View/Detail/ServiceRecordView2.xaml.cs @@ -76,7 +76,7 @@ namespace BeWo.View.Detail private bool _IgnoreGroupMultiCheck; - private int i = 0; + private int lastPosition = 0; public static double DocumentationTextBoxFontSize { @@ -688,23 +688,45 @@ namespace BeWo.View.Detail return (ServiceRecordVM) srListBox.SelectedItem; } - public void SetSelectedServiceRecordVM(ServiceRecordVM vm) + public void SetSelectedServiceRecordVM(ServiceRecordVM vm, bool isOnDelet) { if (vm != null) { ServiceRecordVM existingVm = null; - foreach (var serviceRecordVm in ViewModel.VMList) - { - if (serviceRecordVm.Id == vm.Id) - { - existingVm = serviceRecordVm; - } - } + + if (!isOnDelet) + { + foreach (var serviceRecordVm in ViewModel.VMList) //Originbal Fassung + { + if (serviceRecordVm.Id == vm.Id) + { + existingVm = serviceRecordVm; + } + } + } + else + { + foreach (var serviceRecordVm in ViewModel.VMList) // Nicht Originbal Fassung | lohnt trotzdem nicht + { + if (serviceRecordVm.Id == vm.Id) + { + if(ViewModel.VMList.Count > 0 && lastPosition > 0) { + var a = ViewModel.VMList[lastPosition - 1]; + + existingVm = a; + } + else + { + existingVm = serviceRecordVm; + } + } + } + } - srListBox.SelectedItem = existingVm; + srListBox.SelectedItem = existingVm; srTableView.FocusedRow = existingVm; - + } } @@ -840,7 +862,7 @@ namespace BeWo.View.Detail ClosePopupView(); // ViewModel.RefreshServiceRecordsForSelectedTreeNode(); - SetSelectedServiceRecordVM(vm); + SetSelectedServiceRecordVM(vm,false); })); @@ -902,7 +924,7 @@ namespace BeWo.View.Detail private void RefreshFinished() { - SetSelectedServiceRecordVM(lastSelectedVM); + SetSelectedServiceRecordVM(lastSelectedVM,false); } private void ShowHistory(ServiceRecordVM vm) @@ -1053,7 +1075,7 @@ namespace BeWo.View.Detail { var selected = GetSelectedServiceRecordFromListBox(); ViewModel.RefreshServiceRecordsForSelectedTreeNode(); - SetSelectedServiceRecordVM(selected); + SetSelectedServiceRecordVM(selected,true); }); } @@ -2661,14 +2683,13 @@ namespace BeWo.View.Detail var hitInfo = srTableView.CalcHitInfo(e.OriginalSource as DependencyObject); if (!hitInfo.InRow) return; - - i = hitInfo.RowHandle; - + ServiceRecordVM vm = GetSelectedServiceRecordFromGrid(); if (vm != null && vm.EditAllowed) StartEdit(vm); + lastPosition = ViewModel.VMList.IndexOf(vm); } private ServiceRecordVM GetSelectedServiceRecordFromGrid() @@ -2692,8 +2713,11 @@ namespace BeWo.View.Detail } private void DxDeleteButton_OnItemClick(object sender, ItemClickEventArgs e) - { + { ServiceRecordVM vm = GetSelectedServiceRecordFromGrid(); + + lastPosition = ViewModel.VMList.IndexOf(vm); + if (vm != null && vm.DeleteAllowed) Delete(vm); } diff --git a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs index 782583c8b..d51342b2f 100644 --- a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs +++ b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs @@ -1,5 +1,8 @@ -using System.Web.Mvc; +using System; +using System.Web; +using System.Web.Mvc; using System.Web.Security; +using System.Web.UI; using BeWo.Service.ServiceContracts; using BeWoPlanerMobil.Service; @@ -22,7 +25,8 @@ namespace BeWoPlanerMobil.Controllers { MobileSessionFacade.LogUserOut(); FormsAuthentication.SignOut(); - return RedirectToActionPermanent("Index", "Login", new {tenant = MobileSessionFacade.Tenant}); + + return RedirectToActionPermanent("Index", "Login", new {tenant = MobileSessionFacade.Tenant}); } } } diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 90eec20c9..eeecd9e5c 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -142,7 +142,7 @@ namespace BeWoPlanerMobil.Controllers [HttpPost] public new ActionResult Logout() - { + { return base.Logout(); } diff --git a/BeWoPlanerMobil/Global.asax.cs b/BeWoPlanerMobil/Global.asax.cs index b0543b6e0..589dfea11 100644 --- a/BeWoPlanerMobil/Global.asax.cs +++ b/BeWoPlanerMobil/Global.asax.cs @@ -1,8 +1,11 @@ -using System.Web.Http; +using System; +using System.Web; +using System.Web.Http; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; + namespace BeWoPlanerMobil { // Note: For instructions on enabling IIS6 or IIS7 classic mode, @@ -18,6 +21,16 @@ namespace BeWoPlanerMobil FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); - } - } + + } + + protected void Application_BeginRequest(object sender, EventArgs e) + { + Context.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); + Context.Response.Cache.SetAllowResponseInBrowserHistory(false); + Context.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); + Context.Response.Cache.SetCacheability(HttpCacheability.NoCache); + Context.Response.Cache.SetNoStore(); + } + } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Login/Index.cshtml b/BeWoPlanerMobil/Views/Login/Index.cshtml index 32220207a..b1a9caf45 100644 --- a/BeWoPlanerMobil/Views/Login/Index.cshtml +++ b/BeWoPlanerMobil/Views/Login/Index.cshtml @@ -4,10 +4,12 @@ @{ ViewBag.Title = "Login"; - var usernameDef = String.Empty; - var pwDef = String.Empty; + var usernameDef = String.Empty; + var pwDef = String.Empty; + } + BeWoPlanerMobil
@@ -40,5 +42,8 @@
\ No newline at end of file + loadGoalsUrl = ''; + + + + diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index f818aa045..70e9d064e 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -3,6 +3,7 @@ @model MainModel @{ ViewBag.Title = "Main"; + }
@@ -851,7 +852,7 @@ CheckEndDateUrl = '@Url.Action("CheckEndDate")'; CheckDokuReiterUrl = '@Url.Action("CheckDokuReiter")'; SetSaveSignatureUrl = '@Url.Action("SetSaveSignature")'; - + $(".toggle-btn").click(function () { toggleOnclick(this); diff --git a/BeWoPlanerMobil/Web.config b/BeWoPlanerMobil/Web.config index ab730e70e..5d3057b1c 100644 --- a/BeWoPlanerMobil/Web.config +++ b/BeWoPlanerMobil/Web.config @@ -51,7 +51,8 @@ - + + @@ -150,9 +151,11 @@ + - + + diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index 1f53ecac9..5758c0f87 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -1964,6 +1964,16 @@ namespace BeWo.Data.Access return c; } + + public IList GetAllPerson2OrganisationRelations(long organisationOid) + { + var c = CreateCriteriaIsActive() + .Add(Restrictions.Eq(BeWoEntityBase.PropertyName_Oid, organisationOid)).UniqueResult().Organisation2PersonList.Select(s => s.Person).ToList(); + + + return c; + } + public ServiceRecord FindServiceRecordforHistory(long? ServiceRecordOid) { var c = diff --git a/Service/ServiceContracts/ICustomerService.cs b/Service/ServiceContracts/ICustomerService.cs index b717494f6..d91ae8134 100644 --- a/Service/ServiceContracts/ICustomerService.cs +++ b/Service/ServiceContracts/ICustomerService.cs @@ -632,5 +632,9 @@ namespace BeWo.Service.ServiceContracts [FaultContract(typeof (BeWoFault))] [OperationContract] List GetOrganisationsForPerson(long personoid); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetPersonForOrganisations(long organisationoid); } } \ No newline at end of file diff --git a/Service/ServiceImplementations/CustomerServiceImp.cs b/Service/ServiceImplementations/CustomerServiceImp.cs index 8d826b572..4aa869cc2 100644 --- a/Service/ServiceImplementations/CustomerServiceImp.cs +++ b/Service/ServiceImplementations/CustomerServiceImp.cs @@ -3422,7 +3422,17 @@ namespace BeWo.Service.ServiceImplementations return items; } - } + //Erstelle Hier die Methode für get Person for Organisation + public List GetPersonForOrganisations(long organisationoid) + { + var x = DAOFactory.SearchDAO.GetAllPerson2OrganisationRelations(organisationoid); + + var items = MapperFactory.CompactPersonDC_Person.MapToNewDCs(x); + + return items; + } + + } internal struct WohnheimbuchungsIntervallStruct {