BSky.Lifetime.Services.BSkyLicService.CheckLicStatus C# (CSharp) Method

CheckLicStatus() public method

public CheckLicStatus ( bool ShowDaysLeftReminderPopup ) : int
ShowDaysLeftReminderPopup bool
return int
        public int CheckLicStatus(bool ShowDaysLeftReminderPopup)
        {
            int dayslft = 0;
            string maxver = _maxversion;
            _validLic = false;
            int statcode = -9999;


            try
            {
                statcode = RLMEZ.rlmez_checkout(maxver, ref dayslft);
                _daysleft = dayslft-1;
            }
            catch (Exception ex)
            {
                _licmessage = "Checkout Failed. Probably DLLs missing."+ ex.Message;
                return statcode;
            }
            if (_daysleft == -1 && statcode == 0)//valid permanent license. Never Expires
            {
                _licmessage = "Permanent License!!";// No Expiry Date!";
                _validLic = true;             
            }
            else if (_daysleft >= 0)//Valid License (Trial of Full Version)
            {
                _licmessage = "License will expire in " + (_daysleft)+" day(s)";
                _validLic = true;
            }
            else//Lic not valid
            {
                _licmessage = GetLicError(statcode);
            }

            //Show popup for specific number of days left, only if license is valid and popup is allowed to be displayed
            if (statcode == 0 && _validLic && ShowDaysLeftReminderPopup)//valid Lic
            {
                ShowDaysLeftReminder();
            }
            return statcode;
        }