diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index fcdf1f4e6..5c7de565b 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -305,6 +305,7 @@ + diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user b/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user index 8d834ae6c..883ab72a1 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj.user @@ -1,4 +1,4 @@ - + false diff --git a/BeWoPlanerMobil/Controllers/ChatController.cs b/BeWoPlanerMobil/Controllers/ChatController.cs index 0b4f062cb..fa62fc68e 100644 --- a/BeWoPlanerMobil/Controllers/ChatController.cs +++ b/BeWoPlanerMobil/Controllers/ChatController.cs @@ -73,70 +73,70 @@ namespace BeWoPlanerMobil.Controllers private static bool convertInProgress = false; - public ActionResult UpdateFiles(String list, String pwd) - { - try - { - if (convertInProgress) - { - return this.Content("Schon gestartet"); - } - convertInProgress = true; - //list = "7000000000"; - //pwd = "34vteWVTwegvn9wz4vn9"; - if (pwd == "34vteWVTwegvn9wz4vn9") - { - String[] nummern = list.Split(','); + //public ActionResult UpdateFiles(String list, String pwd) + //{ + // try + // { + // if (convertInProgress) + // { + // return this.Content("Schon gestartet"); + // } + // convertInProgress = true; + // //list = "7000000000"; + // //pwd = "34vteWVTwegvn9wz4vn9"; + // if (pwd == "34vteWVTwegvn9wz4vn9") + // { + // String[] nummern = list.Split(','); - foreach (var knr in nummern) - { + // foreach (var knr in nummern) + // { - System.Web.HttpContext.Current.Items.Remove("hibernateSession"); + // System.Web.HttpContext.Current.Items.Remove("hibernateSession"); - MobileSessionFacade.Tenant = knr; + // MobileSessionFacade.Tenant = knr; - var isKundennummerVorhanden = ASPHibernateSessionManager.ConfigureHibernateSessionForWebService(); + // var isKundennummerVorhanden = ASPHibernateSessionManager.ConfigureHibernateSessionForWebService(); - if (isKundennummerVorhanden) - { - Log.Debug($"Start UpdateFiles for {knr} -----------------------------------------------------------------------------------------------------------------------"); + // if (isKundennummerVorhanden) + // { + // Log.Debug($"Start UpdateFiles for {knr} -----------------------------------------------------------------------------------------------------------------------"); - //var filePath = GetFilePath(12345678); + // //var filePath = GetFilePath(12345678); - //Log.Debug($"File Path = {filePath}"); + // //Log.Debug($"File Path = {filePath}"); - SaveAllFilesToDisk(knr); + // SaveAllFilesToDisk(knr); - Log.Debug($"Finished UpdateFiles for {knr} -----------------------------------------------------------------------------------------------------------------------"); - //var os = new OperationsServiceImp(); - //os.SaveAllFilesToDisk(); - } - else - { - Log.Debug($"Kundennummer {knr} nicht vorhanden"); + // Log.Debug($"Finished UpdateFiles for {knr} -----------------------------------------------------------------------------------------------------------------------"); + // //var os = new OperationsServiceImp(); + // //os.SaveAllFilesToDisk(); + // } + // else + // { + // Log.Debug($"Kundennummer {knr} nicht vorhanden"); - } + // } - } + // } - convertInProgress = false; - return this.Content("Erfolgreich 4"); - } + // convertInProgress = false; + // return this.Content("Erfolgreich 4"); + // } - convertInProgress = false; - return this.Content("Nicht authorisiert"); - } - catch (Exception ex) - { - convertInProgress = false; - return this.Content("ERROR " + ex.Message); - // throw(BeWo.Service.Core.Utils.ThrowBeWoFaultException(e)); - return null; - } - } + // convertInProgress = false; + // return this.Content("Nicht authorisiert"); + // } + // catch (Exception ex) + // { + // convertInProgress = false; + // return this.Content("ERROR " + ex.Message); + // // throw(BeWo.Service.Core.Utils.ThrowBeWoFaultException(e)); + // return null; + // } + //} private void SaveAllFilesToDisk(String knr) { diff --git a/BeWoPlanerMobil/Controllers/CustomerController.cs b/BeWoPlanerMobil/Controllers/CustomerController.cs index 19d89099b..b16fcf3b8 100644 --- a/BeWoPlanerMobil/Controllers/CustomerController.cs +++ b/BeWoPlanerMobil/Controllers/CustomerController.cs @@ -454,6 +454,17 @@ namespace BeWoPlanerMobil.Controllers return Logout(); } + long personOid = 0; + long customerOid = 0; + if (formCollection["PersonOid"] != null) + { + Int64.TryParse(formCollection["PersonOid"], out personOid); + } + if (formCollection["CustomerOid"] != null) + { + Int64.TryParse(formCollection["CustomerOid"], out customerOid); + } + var firstname = formCollection["vorname"]?.RemoveUppercaseEsszett(); var lastname = formCollection["nachname"]?.RemoveUppercaseEsszett(); var alias = formCollection["alias"]?.RemoveUppercaseEsszett(); @@ -483,6 +494,11 @@ namespace BeWoPlanerMobil.Controllers var customer = Model.SelectedCustomer; + if (customer.CustomerOid != customerOid) + { + Log.Info(String.Format("Fehler in UpdateCustomer: Die Oid vom SelectedCustomer stimmt nicht mit der CustomerOid aus der FormCollection überein: {0} != {1}", customer.CustomerOid, customerOid)); + throw new System.Exception("Es ist leider ein Fehler aufgetreten! Die IDs der Klienten stimmen nicht überein!"); + } if(customer is null) { return RedirectToActionPermanent("Customer"); diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 1ca715008..1f3761df6 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -13,6 +13,7 @@ using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; using BS.Shared.Services; +using DevExpress.Utils.Extensions; using DevExpress.XtraScheduler; using DevExpress.XtraScheduler.Compatibility; using Newtonsoft.Json; @@ -184,6 +185,7 @@ namespace BeWoPlanerMobil.Controllers } } //Einfachbuchung + var allCostBearerRelationsSingleBooking = new List { new MokSupportConceptListObject(-1, -1, false, false, false, false) { @@ -193,7 +195,10 @@ namespace BeWoPlanerMobil.Controllers { NameAndDateOfBirth = "Ohne Hilfeplan" }}; - + if (Model.IsInEditingMode) + { + allCostBearerRelationsSingleBooking.RemoveAt(allCostBearerRelationsSingleBooking.Count - 1); + } var allCostBearerRelationsMultiBooking = new List(); diff --git a/BeWoPlanerMobil/Controllers/SystemController.cs b/BeWoPlanerMobil/Controllers/SystemController.cs new file mode 100644 index 000000000..c96dcf19b --- /dev/null +++ b/BeWoPlanerMobil/Controllers/SystemController.cs @@ -0,0 +1,81 @@ +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Service.AI; +using BeWo.Service.ServiceImplementations; +using BeWoPlanerMobil.Service; +using BS.Shared; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.ServiceModel.Syndication; +using System.Web.Mvc; +using System.Xml; + +namespace BeWoPlanerMobil.Controllers +{ + public class SystemController : Controller + { + protected static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + + public string Index() + { + return "Das ist die Default Aktion... Sie haben hier nix verloren;-)"; + } + + + + [System.Web.Http.HttpPost] + public JsonResult GetLicenseCount(string k) + { + try + { + + + var apikey = Request["API-KEY"]; + +#if DEBUG + k = "demo"; // Test mit Autismus Köln Bonn + apikey = "SfTexuvxVGhNNyASiy43AnWa97VDcDsULyRTfxuWNC3YbNyLhzk48O7Hfzs7PNiy"; +#endif + if (k == null) + { + return Json("99", JsonRequestBehavior.AllowGet); + } + + MobileSessionFacade.Tenant = k; + + var isKundennummerVorhanden = ASPHibernateSessionManager.ConfigureHibernateSessionForWebService(); + + if (isKundennummerVorhanden) + { + //var operationsServiceImp = new OperationsServiceImp(); + + //var mandator = operationsServiceImp.GetMandator2(false); + + //if (mandator.Apikey == apikey) + //{ + + Response.AddHeader("Content-Type", "application/json"); //; charset=utf8 + + + var employees = DAOFactory.GenericDAO.GetAllActive(); + var appUser = DAOFactory.GenericDAO.GetAllActive(); + + + return Json(new { success = true, employee_count = employees.Count, user_count = appUser.Count }, JsonRequestBehavior.AllowGet); + //} + } + + return Json(new { success = false }, JsonRequestBehavior.AllowGet); + } + catch (Exception ex) + { + return Json(new { success = false, message = "Error: " + ex.Message }, JsonRequestBehavior.AllowGet); + } + } + + } +} diff --git a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs index c0b0c8ce2..8f06b5a6b 100644 --- a/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs +++ b/BeWoPlanerMobil/Service/ASPHibernateSessionManager.cs @@ -144,7 +144,7 @@ namespace BeWoPlanerMobil.Service private static bool ShouldConfigureHibernateSession(HttpApplication context) { - if(context.Request.FilePath.IndexOf("/Chat/", StringComparison.InvariantCulture) >= 0) + if(context.Request.FilePath.IndexOf("/Chat/", StringComparison.InvariantCulture) >= 0 || context.Request.FilePath.IndexOf("/System/", StringComparison.InvariantCulture) >= 0) { return false; } diff --git a/BeWoPlanerMobil/Util/JsonCustomer.cs b/BeWoPlanerMobil/Util/JsonCustomer.cs index 53e9ed0b1..33f2aa6c3 100644 --- a/BeWoPlanerMobil/Util/JsonCustomer.cs +++ b/BeWoPlanerMobil/Util/JsonCustomer.cs @@ -9,6 +9,8 @@ namespace BeWoPlanerMobil.Util { public class JsonCustomer { + public long PersonOid { get; set; } + public long CustomerOid { get; set; } public string Vorname { get; set; } public string Nachname { get; set; } @@ -116,6 +118,8 @@ namespace BeWoPlanerMobil.Util !string.IsNullOrWhiteSpace(SchwebiAusstAmt); ICD10Diagnosen = icd10Diagnosen; + PersonOid = customer.PersonOid ?? 0; + CustomerOid = customer.CustomerOid ?? 0; Vorname = customer.FirstName; Nachname = customer.LastName; Alias = customer.CustomerAlias; diff --git a/BeWoPlanerMobil/Views/Customer/Customer.cshtml b/BeWoPlanerMobil/Views/Customer/Customer.cshtml index 79fe487a2..1d5242512 100644 --- a/BeWoPlanerMobil/Views/Customer/Customer.cshtml +++ b/BeWoPlanerMobil/Views/Customer/Customer.cshtml @@ -185,10 +185,13 @@
- @using(Html.BeginForm("UpdateCustomer", "Customer", FormMethod.Post, new { id = "stammdaten-form", @class = "needs-validation", novalidate = "novalidate" })) + @using (Html.BeginForm("UpdateCustomer", "Customer", FormMethod.Post, new { id = "stammdaten-form", @class = "needs-validation", novalidate = "novalidate" })) { var inputDisabled = !Model.HasRightToEditCustomers ? "disabled" : string.Empty; + + +
@@ -196,6 +199,7 @@
Eigenschaften
+
@@ -518,7 +522,7 @@
- @if(Model.HasRightToEditCustomers) + @if (Model.HasRightToEditCustomers) {