Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
QuestionTCP Server Multiple Clients (Server Initiation Connection) Pin
MooKowMyke4-Jun-15 12:48
MooKowMyke4-Jun-15 12:48 
AnswerRe: TCP Server Multiple Clients (Server Initiation Connection) Pin
Richard Andrew x644-Jun-15 13:55
professionalRichard Andrew x644-Jun-15 13:55 
GeneralRe: TCP Server Multiple Clients (Server Initiation Connection) Pin
MooKowMyke9-Jun-15 9:04
MooKowMyke9-Jun-15 9:04 
QuestionHelp using EF with DB2 Pin
USAFHokie804-Jun-15 2:56
USAFHokie804-Jun-15 2:56 
AnswerRe: Help using EF with DB2 Pin
Richard MacCutchan4-Jun-15 4:29
mveRichard MacCutchan4-Jun-15 4:29 
QuestionC# Newbie. Need help on coding a errorcheck Pin
Setasigge4-Jun-15 2:24
Setasigge4-Jun-15 2:24 
AnswerRe: C# Newbie. Need help on coding a errorcheck Pin
Eddy Vluggen4-Jun-15 2:59
professionalEddy Vluggen4-Jun-15 2:59 
AnswerRe: C# Newbie. Need help on coding a errorcheck Pin
Richard MacCutchan4-Jun-15 4:27
mveRichard MacCutchan4-Jun-15 4:27 
You are calling the ErrorCheck method with a variable which has not been initialised, but more importantly is never used. Try changing your code to:
C#
public partial class MainWindow : Window
{
    bool errorState = false;
    // ...
    private bool ErrorCheck()
    {
        // ...
        return isError;
    }

    private void btnSave_Click(object sender, RoutedEventArgs e)
    {
        errorState = ErrorCheck();
        if (errorState)
        {
            // error processing
        }
        else
        {
            // create the PDF
        }

Also your tests look to be the wrong way round. The ErrorCheck method returns true if the information in the text boxes is not valid. But the btnSave_Click method calls the return value ISOK. But if ISOK is true then that indicates an error, which means you have to go back and try again. You could also use the String.IsNullOrEmpty Method[^] on your textboxes to check if they contain any valid data.
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Setasigge4-Jun-15 21:04
Setasigge4-Jun-15 21:04 
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Richard MacCutchan4-Jun-15 21:37
mveRichard MacCutchan4-Jun-15 21:37 
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Setasigge4-Jun-15 22:01
Setasigge4-Jun-15 22:01 
GeneralRe: C# Newbie. Need help on coding a errorcheck Pin
Richard MacCutchan5-Jun-15 0:27
mveRichard MacCutchan5-Jun-15 0:27 
QuestionImplementing PocketSphinx in C# Pin
Member 105130663-Jun-15 21:14
Member 105130663-Jun-15 21:14 
AnswerREPOST Pin
Richard Deeming3-Jun-15 21:32
mveRichard Deeming3-Jun-15 21:32 
GeneralRe: REPOST Pin
Member 105130663-Jun-15 21:54
Member 105130663-Jun-15 21:54 
SuggestionRe: Implementing PocketSphinx in C# Pin
Richard MacCutchan3-Jun-15 21:35
mveRichard MacCutchan3-Jun-15 21:35 
AnswerRe: Implementing PocketSphinx in C# Pin
Simon_Whale3-Jun-15 22:25
Simon_Whale3-Jun-15 22:25 
AnswerRe: Implementing PocketSphinx in C# Pin
Pete O'Hanlon3-Jun-15 22:31
mvePete O'Hanlon3-Jun-15 22:31 
QuestionFresher problem for getting job in asp.net? Pin
Andyweil223-Jun-15 16:58
Andyweil223-Jun-15 16:58 
AnswerRe: Fresher problem for getting job in asp.net? Pin
Richard MacCutchan3-Jun-15 21:40
mveRichard MacCutchan3-Jun-15 21:40 
AnswerRe: Fresher problem for getting job in asp.net? Pin
OriginalGriff3-Jun-15 22:30
mveOriginalGriff3-Jun-15 22:30 
QuestionHow to not display the a row based on a condition. Pin
Norris Chappell3-Jun-15 14:39
Norris Chappell3-Jun-15 14:39 
AnswerRe: How to not display the a row based on a condition. Pin
PIEBALDconsult3-Jun-15 14:47
mvePIEBALDconsult3-Jun-15 14:47 
GeneralRe: How to not display the a row based on a condition. Pin
Norris Chappell4-Jun-15 4:21
Norris Chappell4-Jun-15 4:21 
AnswerRe: How to not display the a row based on a condition. Pin
Mathi Mani3-Jun-15 15:54
Mathi Mani3-Jun-15 15:54 

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.