Click here to Skip to main content
15,905,229 members
Home / Discussions / C#
   

C#

 
AnswerRe: What do these c# lines mean???? Pin
Ravi Bhavnani9-Jun-15 6:34
professionalRavi Bhavnani9-Jun-15 6:34 
AnswerRe: What do these c# lines mean???? Pin
Gergilcan13-Jun-15 22:01
professionalGergilcan13-Jun-15 22:01 
QuestionError: Operator '>' cannot be applied to operands of type 'double' and 'System.Random' Pin
Member 117477347-Jun-15 2:37
Member 117477347-Jun-15 2:37 
AnswerRe: Error: Operator '>' cannot be applied to operands of type 'double' and 'System.Random' Pin
Sascha Lefèvre7-Jun-15 2:59
professionalSascha Lefèvre7-Jun-15 2:59 
GeneralRe: Error: Operator '>' cannot be applied to operands of type 'double' and 'System.Random' Pin
Member 117477347-Jun-15 3:00
Member 117477347-Jun-15 3:00 
AnswerRe: Error: Operator '>' cannot be applied to operands of type 'double' and 'System.Random' Pin
Dave Kreskowiak7-Jun-15 3:15
mveDave Kreskowiak7-Jun-15 3:15 
AnswerRe: Error: Operator '>' cannot be applied to operands of type 'double' and 'System.Random' Pin
Afzaal Ahmad Zeeshan7-Jun-15 4:24
professionalAfzaal Ahmad Zeeshan7-Jun-15 4:24 
QuestionHow public static declaration for Statusbar Control ? Pin
Member 24584676-Jun-15 23:41
Member 24584676-Jun-15 23:41 
AnswerRe: How public static declaration for Statusbar Control ? Pin
OriginalGriff6-Jun-15 23:57
mveOriginalGriff6-Jun-15 23:57 
QuestionHow to split UTF16 stream Pin
Super Lloyd5-Jun-15 2:22
Super Lloyd5-Jun-15 2:22 
SuggestionRe: How to split UTF16 stream Pin
Richard MacCutchan5-Jun-15 2:29
mveRichard MacCutchan5-Jun-15 2:29 
GeneralRe: How to split UTF16 stream Pin
Super Lloyd5-Jun-15 2:37
Super Lloyd5-Jun-15 2:37 
SuggestionRe: How to split UTF16 stream Pin
Sascha Lefèvre5-Jun-15 2:57
professionalSascha Lefèvre5-Jun-15 2:57 
GeneralRe: How to split UTF16 stream Pin
Super Lloyd5-Jun-15 5:06
Super Lloyd5-Jun-15 5:06 
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 

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.