How to set the properties in C# [Resolved]

Posted by Kasani007 under C# on 5/11/2016 | Points: 10 | Views : 483 | Status : [Member] | Replies : 1
I Had written the property as below... even it is true it is showing false....can some one help me..

public long DeliveryStatysId { get;set; }
public bool IsDelivered = false;
public bool DeliveredStatus
{
get
{

if (DeliveryStatysId == 1 || DeliveryStatysId == 3)
IsDelivered = true;
return IsDelivered;
}
set
{
IsDelivered = value;
}
}




Responses

Posted by: Sheonarayan on: 5/11/2016 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
The above code is looking good except syntax error in the if statement. See if DeliveryStatysId variable value is set different than 1 or 3.

Or see if somehow DeliveryStatysId variable is set to 1 or 3 by some other code.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response