Beispiel #1
0
        public static bool IsValid(DomainN domain, out Dictionary <string, string> validationResult)
        {
            validationResult = new Dictionary <string, string>();

            if (string.IsNullOrWhiteSpace(domain.Name))
            {
                validationResult.Add("Record.Name", ValidationMessages.REQUIRED);
            }

            if (domain.Brand == null || string.IsNullOrWhiteSpace(domain.Brand.Name))
            {
                validationResult.Add("Record.Brand.Name", ValidationMessages.REQUIRED);
            }

            return(!validationResult.Any());
        }
        public ICollection <object> ParseDataMin(MySqlDataReader dataReader)
        {
            var entities = new List <object>();

            while (dataReader.Read())
            {
                var entity = new DomainN
                {
                    ID = (int)dataReader["ID"],

                    Name           = dataReader["Name"] as string,
                    ExpirationDate = dataReader["ExpirationDate"] as string,
                };

                if (int.TryParse((dataReader["RegistrantCompanyID"] as int?)?.ToString(), out int registrantCompanyID))
                {
                    entity.RegistrantCompany = new Company {
                        ID = registrantCompanyID
                    };
                }

                if (int.TryParse((dataReader["RegistrarID"] as int?)?.ToString(), out int registrarID))
                {
                    entity.Registrar = new Register {
                        ID = registrarID, Name = dataReader["RegistrarName"] as string
                    };
                }

                if (int.TryParse((dataReader["RegistrantID"] as int?)?.ToString(), out int registrantID))
                {
                    entity.Registrant = new Company
                    {
                        ID            = registrantID,
                        DisplayName   = dataReader["RegistrantName"] as string,
                        BigFootGroup  = (dataReader["RegistrantBigFootGroup"] as sbyte? ?? 0) == 1,
                        ParentAccount = new Company
                        {
                            DisplayName = dataReader["RegistrantParentAccountName"] as string
                        }
                    };
                }

                entities.Add(entity);
            }

            return(entities);
        }
        public ICollection <object> ParseData(MySqlDataReader dataReader)
        {
            var entities = new List <object>();

            while (dataReader.Read())
            {
                var entity = new DomainN
                {
                    ID = (int)dataReader["ID"],

                    OwnerName = dataReader["OwnerName"] as string,

                    Name                 = dataReader["Name"] as string,
                    BFStrategy           = dataReader["BFStrategy"] as string,
                    BuysideFunnel        = dataReader["BuysideFunnel"] as string,
                    Remarks              = dataReader["Remarks"] as string,
                    FMVOrderOfMagnitude  = dataReader["FMVOrderOfMagnitude"] as string,
                    Status               = dataReader["Status"] as string,
                    Version              = dataReader["Version"] as string,
                    Category             = dataReader["Category"] as string,
                    AccountID            = dataReader["AccountID"] as string,
                    WebsiteCurrent       = (dataReader["WebsiteCurrent"] as sbyte? ?? 0) == 1,
                    Locked               = (dataReader["Locked"] as sbyte? ?? 0) == 1,
                    WebsiteUse           = dataReader["WebsiteUse"] as string,
                    WebsiteDescription   = dataReader["WebsiteDescription"] as string,
                    WebsiteRedirect      = dataReader["WebsiteRedirect"] as string,
                    ExpirationDate       = dataReader["ExpirationDate"] as string,
                    CompanyWebsite       = (dataReader["CompanyWebsite"] as sbyte? ?? 0) == 1,
                    AutoRenew            = (dataReader["AutoRenew"] as sbyte? ?? 0) == 1,
                    WHOIS                = dataReader["WHOIS"] as string,
                    RegistrationPriceUSD = dataReader["RegistrationPriceUSD"] as string,
                    RegistrationDate     = dataReader["RegistrationDate"] as string,
                    BigFootParkingPage   = dataReader["BigFootParkingPage"] as string,
                    PrivacyProtected     = (dataReader["PrivacyProtected"] as sbyte? ?? 0) == 1,

                    RegistrantEmail             = dataReader["RegistrantEmail"] as string,
                    PrivateRegistrationEmail    = dataReader["PrivateRegistrationEmail"] as string,
                    PreviousRegistrantChangedOn = dataReader["PreviousRegistrantChangedOn"] as string,

                    PurchasePriceUSD = dataReader["PurchasePriceUSD"] as string,
                    PurchaseDate     = dataReader["PurchaseDate"] as string,
                    SalePriceUSD     = dataReader["SalesPriceUSD"] as string,
                    SaleDate         = dataReader["SaleDate"] as string,

                    CDDateSent                    = dataReader["CDDateSent"] as string,
                    CDSentFrom                    = dataReader["CDSentFrom"] as string,
                    CDSentMethod                  = dataReader["CDSentMethod"] as string,
                    CDCourier                     = dataReader["CDCourier"] as string,
                    CDTrackingNumber              = dataReader["CDTrackingNumber"] as string,
                    TrademarkUsedInTheUDRPID      = dataReader["TrademarkUsedInTheUDRPID"] as int?,
                    UDRPFilingDate                = dataReader["UDRPFilingDate"] as string,
                    UDRPCostInUSD                 = dataReader["UDRPCostInUSD"] as string,
                    UDRPCostOtherThanUSD          = dataReader["UDRPCostOtherThanUSD"] as string,
                    UDRPCaseNumber                = dataReader["UDRPCaseNumber"] as string,
                    ArbitratorName                = dataReader["ArbitratorName"] as string,
                    UDRPJurisdiction              = dataReader["UDRPJurisdiction"] as string,
                    LanguageOfProceedings         = dataReader["LanguageOfProceedings"] as string,
                    LegalActionRelatedProceedings = (dataReader["LegalActionRelatedProceedings"] as sbyte? ?? 0) == 1,
                    UDRPOutcome                   = dataReader["UDRPOutcome"] as string,
                    UDRPComment                   = dataReader["UDRPComment"] as string,

                    DeletionRequest       = (dataReader["DeletionRequest"] as sbyte? ?? 0) == 1,
                    DeletionRequestReason = dataReader["DeletionRequestReason"] as string
                };

                if (int.TryParse((dataReader["RegistrantCompanyID"] as int?)?.ToString(), out int registrantCompanyID))
                {
                    entity.RegistrantCompany = new Company {
                        ID = registrantCompanyID
                    };
                }

                if (int.TryParse((dataReader["DomainEnquiryID"] as int?)?.ToString(), out int domainEnquiryID))
                {
                    entity.DomainEnquiry = new Enquiry {
                        ID = registrantCompanyID
                    };
                }

                if (int.TryParse((dataReader["BrandID"] as int?)?.ToString(), out int brandID))
                {
                    entity.Brand = new Brand {
                        ID = brandID
                    };
                }

                if (int.TryParse((dataReader["RegistrarID"] as int?)?.ToString(), out int registrarID))
                {
                    entity.Registrar = new Register {
                        ID = registrarID
                    };
                }

                if (int.TryParse((dataReader["RegistrantID"] as int?)?.ToString(), out int registrantID))
                {
                    entity.Registrant = new Company
                    {
                        ID            = registrantID,
                        DisplayName   = dataReader["RegistrantName"] as string,
                        Email         = dataReader["RegistrantEmail"] as string,
                        BigFootGroup  = (dataReader["RegistrantBigFootGroup"] as sbyte? ?? 0) == 1,
                        ParentAccount = new Company
                        {
                            DisplayName = dataReader["RegistrantParentAccountName"] as string
                        }
                    };
                }

                if (int.TryParse((dataReader["PreviousRegistrantID"] as int?)?.ToString(), out int previousRegistrantID))
                {
                    entity.PreviousRegistrant = new Company {
                        ID = previousRegistrantID
                    };
                }

                entities.Add(entity);
            }

            return(entities);
        }