Пример #1
0
        public void GetConfigValuesOfIsExpired()
        {
            ConfirmLicenseManager objConfirmLicenseManager = new ConfirmLicenseManager();
            NandanaResult         getAllConfigValues       = objConfirmLicenseManager.GetAllConfigValues();

            if (getAllConfigValues.resultDS != null && getAllConfigValues.resultDS.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in getAllConfigValues.resultDS.Tables[0].Rows)
                {
                    if (dr["Config_Name"].ToString() == "IsExpired")
                    {
                        if (dr["Config_Value"].ToString() == "1")
                        {
                            ConfirmLicense obj = new ConfirmLicense();
                            obj.IsExpired = dr["Config_Value"].ToString();
                            obj.ShowDialog();
                        }
                    }
                }
            }
        }
Пример #2
0
        public void CheckScanDocCountValue()
        {
            ConfirmLicenseManager objConfirmLicenseManager = new ConfirmLicenseManager();
            NandanaResult         getAllConfigValues       = objConfirmLicenseManager.GetAllConfigValues();

            if (getAllConfigValues.resultDS != null && getAllConfigValues.resultDS.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in getAllConfigValues.resultDS.Tables[0].Rows)
                {
                    if (dr["Config_Name"].ToString() == "ScanRecordCount")
                    {
                        if (dr["Config_Value"].ToString() == "")
                        {
                            ConfirmLicense obj = new ConfirmLicense();
                            //EnterScanDocCount obj = new EnterScanDocCount();
                            obj.ShowDialog();
                        }
                    }
                }
            }
        }
Пример #3
0
        public void CheckLicenseExpired()
        {
            bool matchFound = false;

            string IntialDate = string.Empty;
            string NumOfDays  = string.Empty;
            //DateTime Givendate=DateTime.Now;

            ConfirmLicenseManager objConfirmLicenseManager = new ConfirmLicenseManager();
            NandanaResult         getAllConfigValues       = objConfirmLicenseManager.GetAllConfigValues();

            if (getAllConfigValues.resultDS != null && getAllConfigValues.resultDS.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in getAllConfigValues.resultDS.Tables[0].Rows)
                {
                    switch (Convert.ToString(dr["Config_Name"].ToString()))
                    {
                    case "SetupDate":
                        if (dr["Config_Value"].ToString() != "")
                        {
                            IntialDate = (this.Decrypt(dr["Config_Value"].ToString()));
                        }
                        else
                        {
                            IntialDate = "";
                        }
                        break;

                    case "AllowedDays":
                        if (dr["Config_Value"].ToString() != "")
                        {
                            NumOfDays = (this.Decrypt(dr["Config_Value"].ToString()));
                        }
                        else
                        {
                            NumOfDays = "0";
                        }
                        break;
                    }
                }
            }

            if (Convert.ToInt32(NumOfDays) == 0)
            {
                ConfirmLicense obj = new ConfirmLicense();
                obj.Days = NumOfDays;
                obj.ShowDialog();
            }

            //DateTime expirydate = DateTime.ParseExact(IntialDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
            if ((DateTime.Today - DateTime.Parse(IntialDate, System.Globalization.CultureInfo.InvariantCulture)).Days <= Convert.ToInt16(NumOfDays))
            {
                matchFound = true;
            }
            if (!matchFound)
            {
                ConfirmLicense obj = new ConfirmLicense();
                obj.Days           = NumOfDays;
                obj.LicenseExpired = "True";
                obj.ShowDialog();
            }
        }