From 91aa69f4bd4402aca47117b0d50dc4a5464dc121 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 24 Jan 2015 17:30:21 +0100 Subject: [PATCH] refactoring --- web/Controllers/FrontOfficeApiController.cs | 3 ++- yavscModel/RolesAndMemebers/Profile.cs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/Controllers/FrontOfficeApiController.cs b/web/Controllers/FrontOfficeApiController.cs index c3695a3c..39be81db 100644 --- a/web/Controllers/FrontOfficeApiController.cs +++ b/web/Controllers/FrontOfficeApiController.cs @@ -115,6 +115,7 @@ namespace Yavsc.ApiControllers ))}; } catch (Exception ex) { + return new HttpResponseMessage (HttpStatusCode.OK){ Content = new ObjectContent (typeof(string), ex.Message, new SimpleFormatter("text/text")) }; @@ -140,7 +141,7 @@ namespace Yavsc.ApiControllers tmpe.Session.Add ("estim", e); Profile prpro = new Profile(ProfileBase.Create(e.Responsible)); - if (!prpro.IsBankable) + if (!prpro.HasBankAccount) throw new TemplateException ("NotBankable:"+e.Responsible); Profile prcli = new Profile(ProfileBase.Create(e.Client)); diff --git a/yavscModel/RolesAndMemebers/Profile.cs b/yavscModel/RolesAndMemebers/Profile.cs index 0a128d47..620f6c02 100644 --- a/yavscModel/RolesAndMemebers/Profile.cs +++ b/yavscModel/RolesAndMemebers/Profile.cs @@ -82,12 +82,11 @@ namespace Yavsc.Model.RolesAndMembers [Display(Name="Google_calendar",ResourceType=typeof(LocalizedText))] public string GoogleCalendar { get; set; } - public bool IsBankable { get { + public bool HasBankAccount { get { return IsBillable && !string.IsNullOrWhiteSpace (BankCode) && !string.IsNullOrWhiteSpace (BIC) && !string.IsNullOrWhiteSpace (IBAN) - && !string.IsNullOrWhiteSpace (BankCode) && !string.IsNullOrWhiteSpace (WicketCode) && !string.IsNullOrWhiteSpace (AccountNumber) && BankedKey != 0; } }