Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: (beginner question) help with code for a project Pin
Richard MacCutchan7-Feb-18 3:31
mveRichard MacCutchan7-Feb-18 3:31 
GeneralRe: (beginner question) help with code for a project Pin
Member 136645667-Feb-18 5:00
Member 136645667-Feb-18 5:00 
GeneralRe: (beginner question) help with code for a project Pin
Richard MacCutchan7-Feb-18 5:13
mveRichard MacCutchan7-Feb-18 5:13 
GeneralRe: (beginner question) help with code for a project Pin
Gerry Schmitz7-Feb-18 5:29
mveGerry Schmitz7-Feb-18 5:29 
QuestionDesign-Question: Using ReturnValue or Throwing Exception Pin
Frygreen6-Feb-18 11:06
Frygreen6-Feb-18 11:06 
AnswerRe: Design-Question: Using ReturnValue or Throwing Exception Pin
Richard Andrew x646-Feb-18 12:17
professionalRichard Andrew x646-Feb-18 12:17 
AnswerRe: Design-Question: Using ReturnValue or Throwing Exception Pin
Eddy Vluggen6-Feb-18 15:06
professionalEddy Vluggen6-Feb-18 15:06 
AnswerRe: Design-Question: Using ReturnValue or Throwing Exception Pin
OriginalGriff6-Feb-18 23:21
mveOriginalGriff6-Feb-18 23:21 
The real question is "Is a withdrawal allowed if it results in a negative balance?" and that isn't necessarily a function of that method - for example, my current account has a "permitted overdraft" permanently attached so by balance can genuinely and acceptably go negative, up to a preset limit.

So having a Withdraw method that automatically refuses a transaction if it would result in a negative balance may be against the business logic. In addition, accounts often have "pending transactions" which may not be reflected in the balance but which could change the "approve / reject" decision.

Think about how you are doing this: you should probably divide the responsibilities up into three sections - Presentation (user interface), Business logic, and Data handling - and a withdrawal request would come from the Presentation to the Business for approval, and on then be committed to Data storage by the Business logic if approved, or rejected to the Presentation if not.

Certainly, I don't think an exception would be right - normal processing shouldn't use exceptions for flow control.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

AnswerRe: Design-Question: Using ReturnValue or Throwing Exception Pin
#realJSOP7-Feb-18 3:56
mve#realJSOP7-Feb-18 3:56 
AnswerRe: Design-Question: Using ReturnValue or Throwing Exception Pin
Gerry Schmitz7-Feb-18 5:45
mveGerry Schmitz7-Feb-18 5:45 
AnswerRe: Design-Question: Using ReturnValue or Throwing Exception Pin
Frygreen7-Feb-18 14:11
Frygreen7-Feb-18 14:11 
QuestionNunit3: Debug of Testcases. => No breakpoints hit with console-runner Pin
Frygreen6-Feb-18 9:35
Frygreen6-Feb-18 9:35 
AnswerRe: Nunit3: Debug of Testcases. => No breakpoints hit with console-runner Pin
Pete O'Hanlon6-Feb-18 10:10
mvePete O'Hanlon6-Feb-18 10:10 
GeneralRe: Nunit3: Debug of Testcases. => No breakpoints hit with console-runner Pin
Frygreen6-Feb-18 10:32
Frygreen6-Feb-18 10:32 
AnswerRe: Nunit3: Debug of Testcases. => No breakpoints hit with console-runner Pin
Gerry Schmitz7-Feb-18 5:54
mveGerry Schmitz7-Feb-18 5:54 
GeneralRe: Nunit3: Debug of Testcases. => No breakpoints hit with console-runner Pin
Frygreen7-Feb-18 14:32
Frygreen7-Feb-18 14:32 
GeneralRe: Nunit3: Debug of Testcases. => No breakpoints hit with console-runner Pin
Gerry Schmitz7-Feb-18 14:47
mveGerry Schmitz7-Feb-18 14:47 
Questionfile checker dump log in C# Pin
Member 136321716-Feb-18 4:34
Member 136321716-Feb-18 4:34 
AnswerRe: file checker dump log in C# Pin
Maciej Los6-Feb-18 5:25
mveMaciej Los6-Feb-18 5:25 
AnswerRe: file checker dump log in C# Pin
Richard MacCutchan6-Feb-18 5:26
mveRichard MacCutchan6-Feb-18 5:26 
AnswerRe: file checker dump log in C# Pin
Dave Kreskowiak6-Feb-18 16:55
mveDave Kreskowiak6-Feb-18 16:55 
QuestionHow to programmatically paste text into a specific Word document Pin
Leif Simon Goodwin6-Feb-18 4:19
Leif Simon Goodwin6-Feb-18 4:19 
AnswerRe: How to programmatically paste text into a specific Word document Pin
Eddy Vluggen6-Feb-18 5:25
professionalEddy Vluggen6-Feb-18 5:25 
GeneralRe: How to programmatically paste text into a specific Word document Pin
Leif Simon Goodwin6-Feb-18 21:51
Leif Simon Goodwin6-Feb-18 21:51 
GeneralRe: How to programmatically paste text into a specific Word document Pin
Eddy Vluggen7-Feb-18 1:31
professionalEddy Vluggen7-Feb-18 1:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.