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

C#

 
AnswerRe: show form Pin
_Erik_4-Feb-11 5:32
_Erik_4-Feb-11 5:32 
AnswerRe: show form Pin
DaveyM694-Feb-11 6:23
professionalDaveyM694-Feb-11 6:23 
AnswerRe: show form Pin
Anubhava Dimri4-Feb-11 21:34
Anubhava Dimri4-Feb-11 21:34 
Questionchange the shape of the tab header in tab control Pin
NarVish4-Feb-11 1:39
NarVish4-Feb-11 1:39 
AnswerRe: change the shape of the tab header in tab control PinPopular
Luc Pattyn4-Feb-11 2:06
sitebuilderLuc Pattyn4-Feb-11 2:06 
GeneralRe: change the shape of the tab header in tab control Pin
NarVish6-Feb-11 17:41
NarVish6-Feb-11 17:41 
GeneralRe: change the shape of the tab header in tab control Pin
Luc Pattyn6-Feb-11 21:15
sitebuilderLuc Pattyn6-Feb-11 21:15 
Questionc# Client Server Application Pin
LAPEC4-Feb-11 1:35
LAPEC4-Feb-11 1:35 
Hello Everyone

I have created a Client/Server application on C# on WPF IDE and I have a little problem on my UserClient property class...
Within this class I have a method called:
public override bool Equals(object obj)
{
     UserClient temp = obj as UserClient;
     if (temp != null)
     {
          return (userId == temp.userId);
     }
     if (temp != null)
     {
          return (userPass == temp.userPass);
     }
     return false;
}

The problem I'm having is:
The class UserClient is highlighted with a green line under-neath where when I place MouseOver it sas:

UserClient overrides Object.Equals but does not override Object.GetHashCode

Here is the entire UserClient class code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;

namespace DtposClient
{
    public class UserClient
    {
        // User Client Global variables
	    // ====================================
        private string UserFullName;
        private string UserAccessLevel;
        private int UserId;
        private int UserPassword;

	    public string fullName
        {
            get { return UserFullName; }
            set { UserFullName = value; }
	    }

        public string accLevel
        {
            get { return UserAccessLevel; }
            set { UserAccessLevel = value; }
        }

        public int userId
        {
            get { return UserId; }
            set { UserId = value; }
        }
	    
	    public int userPass 
        {
            get { return UserPassword; }
            set { UserPassword = value; }
	    }
	    
	    public override bool Equals(object obj)
	    {
            UserClient temp = obj as UserClient;
            if (temp != null)
            {
                return (userId == temp.userId);
            }
            if (temp != null)
            {
                return (userPass == temp.userPass);
            }
            return false;
	    }

        public UserClient(string fullNam, string aLevel, int usId, int pass)
	    {
		    fullName = fullNam;
            accLevel = aLevel;
            userId = usId;
            userPass = pass;
	    }
    }
}


Could someone please help me crack this problem....

thanks in advance

kind regards

lapeci
AnswerRe: c# Client Server Application Pin
RobCroll4-Feb-11 1:49
RobCroll4-Feb-11 1:49 
AnswerRe: c# Client Server Application Pin
phil.o4-Feb-11 2:21
professionalphil.o4-Feb-11 2:21 
AnswerRe: c# Client Server Application Pin
_Erik_4-Feb-11 5:39
_Erik_4-Feb-11 5:39 
QuestionInput details in cmd via Process Pin
All Time Programming4-Feb-11 0:10
All Time Programming4-Feb-11 0:10 
AnswerRe: Input details in cmd via Process Pin
Xmen Real 4-Feb-11 1:23
professional Xmen Real 4-Feb-11 1:23 
GeneralRe: Input details in cmd via Process Pin
All Time Programming4-Feb-11 1:42
All Time Programming4-Feb-11 1:42 
AnswerRe: Input details in cmd via Process Pin
PIEBALDconsult4-Feb-11 1:48
mvePIEBALDconsult4-Feb-11 1:48 
GeneralRe: Input details in cmd via Process Pin
All Time Programming4-Feb-11 2:44
All Time Programming4-Feb-11 2:44 
AnswerRe: Input details in cmd via Process Pin
_Erik_4-Feb-11 6:09
_Erik_4-Feb-11 6:09 
QuestionPreserve stack trace after Exception rethrow? Pin
Chesnokov Yuriy3-Feb-11 22:57
professionalChesnokov Yuriy3-Feb-11 22:57 
AnswerRe: Preserve stack trace after Exception rethrow? Pin
Wayne Gaylard3-Feb-11 23:03
professionalWayne Gaylard3-Feb-11 23:03 
QuestionRe: Preserve stack trace after Exception rethrow? Pin
Chesnokov Yuriy4-Feb-11 0:38
professionalChesnokov Yuriy4-Feb-11 0:38 
AnswerRe: Preserve stack trace after Exception rethrow? Pin
Luc Pattyn4-Feb-11 0:48
sitebuilderLuc Pattyn4-Feb-11 0:48 
QuestionTeechart - change color of bar in bar chart based on values Pin
PleaseHelpCP3-Feb-11 22:49
PleaseHelpCP3-Feb-11 22:49 
QuestionEfficient way to handle search page Pin
Umair Feroze3-Feb-11 22:34
Umair Feroze3-Feb-11 22:34 
QuestionWindows program responding to win + d Pin
ayandelhi3-Feb-11 21:57
ayandelhi3-Feb-11 21:57 
AnswerRe: Windows program responding to win + d Pin
Luc Pattyn3-Feb-11 22:23
sitebuilderLuc Pattyn3-Feb-11 22:23 

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.