Пример #1
0
        public static int serialVersion(Session paramSession)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.Version == 2)
                {
                    if (paramSession.Open)
                    {
                        paramSession.flush();
                        paramSession.close();
                    }
                    return(2);
                }
            }
            if (paramSession.Open)
            {
                paramSession.flush();
                paramSession.close();
            }
            return(1);
        }
Пример #2
0
        public static void decrementTrialDays(Session paramSession)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.Version == 2 && licenseRowItem.IsTrial)
                {
                    if (licenseRowItem.TrialDays < -1)
                    {
                        licenseRowItem.TrialDays = -1;
                    }
                    if (licenseRowItem.TrialDays != -1 && licenseRowItem.TrialDays != 0)
                    {
                        licenseRowItem.TrialDays = licenseRowItem.TrialDays - 10;
                        string str = xStream.toXML(licenseRowItem);
                        concLicenseTable.HashKey = str;
                        paramSession.update(concLicenseTable);
                    }
                }
            }
            if (paramSession.Open)
            {
                paramSession.flush();
                paramSession.close();
            }
        }
Пример #3
0
        public static bool?unRegisterUserBySerial(Session paramSession, string paramString1, string paramString2, string paramString3)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            bool? @bool = Convert.ToBoolean(false);

            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();
            License license = new License();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.hasSameSerial(paramString3).Value&& licenseRowItem.CheckedIn)
                {
                    LicenseRowItem licenseRowItem1 = createRow("NULL", "NULL", paramString3, licenseRowItem, Convert.ToBoolean(false), "NULL");
                    string         str             = xStream.toXML(licenseRowItem1);
                    concLicenseTable.HashKey = str;
                    paramSession.update(concLicenseTable);
                    paramSession.flush();
                    @bool = Convert.ToBoolean(true);
                }
            }
            if (paramSession.Open)
            {
                paramSession.flush();
            }
            return(@bool);
        }
Пример #4
0
        public static bool?registerUserBySerial(Session paramSession, string paramString1, string paramString2, string paramString3)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            bool? @bool = Convert.ToBoolean(false);

            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();
            License license = new License();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.hasSameSerial(paramString3).Value&& !licenseRowItem.CheckedIn)
                {
                    try
                    {
                        bool?bool1 = Convert.ToBoolean(false);
                        System.Collections.IEnumerator enumeration = NetworkInterface.NetworkInterfaces;
                        List <object> arrayList = new List <object>();
                        foreach (NetworkInterface networkInterface in Collections.list(enumeration))
                        {
                            foreach (InetAddress inetAddress in Collections.list(networkInterface.InetAddresses))
                            {
                                arrayList.Add(inetAddress);
                                if (inetAddress.HostAddress.equalsIgnoreCase(licenseRowItem.ServerIP))
                                {
                                    bool1 = Convert.ToBoolean(true);
                                    InetAddress inetAddress1 = inetAddress;
                                }
                            }
                        }
                        if (!bool1.Value)
                        {
                            @bool = Convert.ToBoolean(false);
                            break;
                        }
                    }
                    catch (SocketException socketException)
                    {
                        Console.WriteLine(socketException.ToString());
                        Console.Write(socketException.StackTrace);
                    }
                    DateTime         date             = DateTime.Now;
                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyyMMddHHmmssZ");
                    string           str1             = simpleDateFormat.format(date);
                    LicenseRowItem   licenseRowItem1  = createRow(paramString1, paramString2, paramString3, licenseRowItem, Convert.ToBoolean(true), str1);
                    string           str2             = xStream.toXML(licenseRowItem1);
                    concLicenseTable.HashKey = str2;
                    paramSession.update(concLicenseTable);
                    @bool = Convert.ToBoolean(true);
                }
            }
            paramSession.flush();
            return(@bool);
        }
Пример #5
0
        public static void validateTableAndFixTable(Session paramSession)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream          xStream      = new XStream();
            HashSet <object> hashSet1     = new HashSet <object>();
            bool?            @bool        = true;
            Hashtable        hashMap      = new Hashtable();
            HashSet <object> hashSet2     = new HashSet <object>();

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (hashMap.ContainsKey(licenseRowItem.Serial))
                {
                    @bool = false;
                    hashSet2.Add(concLicenseTable.Id);
                    hashSet2.Add(((ConcLicenseTable)hashMap[licenseRowItem.Serial]).Id);
                    continue;
                }
                hashMap[licenseRowItem.Serial] = concLicenseTable;
            }
            if ([email protected])
            {
                int?integer = Convert.ToInt32(hashSet2.Count);
                foreach (long?long in hashSet2)
                {
                    ConcLicenseTable concLicenseTable = (ConcLicenseTable)paramSession.load(typeof(ConcLicenseTable), long);
                    LicenseRowItem   licenseRowItem   = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                    if (integer.Value > 1)
                    {
                        paramSession.delete(concLicenseTable);
                        paramSession.flush();
                    }
                }
            }
        }
Пример #6
0
        public static License loadFromTable(Session paramSession)
        {
            validateTableAndFixTable(paramSession);
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            System.Collections.IList list = paramSession.createQuery("from ConcLicenseTable").list();
            XStream xStream = new XStream();
            License license = new License();
            bool    @bool   = false;

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                license.addRowItemToSet(licenseRowItem);
            }
            return(license);
        }
Пример #7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void loadProjects() throws Exception
        private void loadProjects()
        {
            File file = new File("templates");

            if (!file.Directory)
            {
                file.mkdir();
            }
            File[] arrayOfFile = file.listFiles(new TemplateFileFilter(this, null));
            foreach (File file1 in arrayOfFile)
            {
                File   file2        = null;
                File   file3        = null;
                File[] arrayOfFile1 = file1.listFiles();
                foreach (File file4 in arrayOfFile1)
                {
                    if (file4.Name.ToLower().Equals("template-info.xml"))
                    {
                        file2 = file4;
                    }
                    else if (file4.Name.ToLower().Equals("template.cep"))
                    {
                        file3 = file4;
                    }
                }
                XStream xStream = new XStream();
                ProjectTemplate.FieldAliases = xStream;
                StreamReader    fileReader      = new StreamReader(file2);
                ProjectTemplate projectTemplate = (ProjectTemplate)xStream.fromXML(fileReader);
                projectTemplate.ProjectCEPFile = file3;
                this.o_descMap[file1.Name]     = projectTemplate;
                fileReader.Close();
                if (!string.ReferenceEquals(projectTemplate.ProjectGroup, null) && !projectTemplate.ProjectGroup.Equals(""))
                {
                    List <object> vector = (List <object>) this.o_groupMap[projectTemplate.ProjectGroup];
                    if (vector == null)
                    {
                        vector = new List <object>();
                        this.o_groupMap[projectTemplate.ProjectGroup] = vector;
                    }
                    vector.Add(projectTemplate);
                }
            }
        }
Пример #8
0
        public static bool updateDate(PongEvent paramPongEvent, Session paramSession)
        {
            EncryptedStringUserType.Key = CryptUtil.Instance.encryptHexString("oasj419][f'ar;;34").ToCharArray();
            System.Collections.IList list     = paramSession.createQuery("from ConcLicenseTable").list();
            XStream          xStream          = new XStream();
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyyMMddHHmmssZ");
            bool             @bool            = false;

            foreach (ConcLicenseTable concLicenseTable in list)
            {
                LicenseRowItem licenseRowItem = (LicenseRowItem)xStream.fromXML(concLicenseTable.HashKey);
                if (licenseRowItem.CheckedIn && licenseRowItem.Serial.Equals(paramPongEvent.Serial) && licenseRowItem.Userid.Equals(paramPongEvent.UserId, StringComparison.OrdinalIgnoreCase))
                {
                    @bool = true;
                    string str1 = simpleDateFormat.format(DateTime.Now);
                    licenseRowItem.CheckedInDate = str1;
                    string str2 = xStream.toXML(licenseRowItem);
                    concLicenseTable.HashKey = str2;
                    paramSession.update(concLicenseTable);
                }
            }
            return(@bool);
        }