переключить еще, чтобы переключить случай

Как мы можем переключить приведенные ниже операторы if -else для переключения операторов case ... Может ли кто-нибудь помочь в этом ...

        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;
             }
         }

Спасибо заранее ....

Ответы на вопрос(1)

Ваш ответ на вопрос