alternar elseif para alternar
Como podemos mudar as instruções if -else abaixo para mudar a declaração de caso ... alguém pode ajudar nisso ...
if (Webcc1.Contains(licensePartID))
{
dtExpiryDate = dtActivatedDate.AddYears(1);
int isExpiry = DateTime.Compare(dtActivatedDate, dtExpiryDate);
if (isExpiry >= 0)
{
setError(lblSystemErr, "This action cannot be performed. The subscription period of the license key has expired");
return;
}
}
else if (Webcc3.Contains(licensePartID))
{
dtExpiryDate = dtActivatedDate.AddYears(3);
int isExpiry = DateTime.Compare(dtActivatedDate, dtExpiryDate);
if (isExpiry >= 0)
{
setError(lblSystemErr, "This action cannot be performed. The subscription period of the license key has expired");
return;
}
}
else if (Webcc5.Contains(licensePartID))
{
dtExpiryDate = dtActivatedDate.AddYears(5);
int isExpiry = DateTime.Compare(dtActivatedDate, dtExpiryDate);
if (isExpiry >= 0)
{
setError(lblSystemErr, "This action cannot be performed. The subscription period of the license key has expired");
return;
}
}
Muito obrigado antecipadamente ....