Esempio n. 1
0
        public string GetCustomerInfoHtml()
        {
            string ret = string.Format("<b>{0}</b>", FullName);

            ret += string.Format("\r\n{1}: <b>{0:d6}</b>", CustomerId, Properties.Resources.CardNumber);
            if (BirthDate != null && BirthDate != DateTime.MinValue)
            {
                ret += string.Format("\r\n{1}: <b>{0:d}</b>", BirthDate, Properties.Resources.BirthDate);
            }
            if (!string.IsNullOrEmpty(Email))
            {
                ret += string.Format("\r\n{1}: <b>{0}</b>", Email, Properties.Resources.Email);
            }
            if (!string.IsNullOrEmpty(Phone))
            {
                ret += string.Format("\r\n{1}: <b>{0}</b>", Phone, Properties.Resources.Phone);
            }
            if (!string.IsNullOrEmpty(Address))
            {
                ret += string.Format("\r\n{1}: <b>{0}</b>", Address, Properties.Resources.Address);
            }
            ret += string.Format("\r\n{2}: <b>{0}({1:p})</b>", EnumTitlesKeeper <CustomerDiscountLevel> .GetTitle(DiscountLevel), Discount, Properties.Resources.DiscountLevel);
            if (!string.IsNullOrEmpty(Comments))
            {
                ret += string.Format("\r\n{1}: <i>{0}</i>", Comments, Properties.Resources.Comments);
            }
            return(ret);
        }
Esempio n. 2
0
        public static void TryRegisterTitles()
        {
            if (alreadyRegistered)
            {
                return;
            }
            alreadyRegistered = true;
            EnumTitlesKeeper <DBFormat> .RegisterTitle(DBFormat.Mdb, Properties.Resources.DBFormatMdb);

            EnumTitlesKeeper <DBFormat> .RegisterTitle(DBFormat.Sql, Properties.Resources.DBFormatSql);

            EnumTitlesKeeper <SqlAuthenticationType> .RegisterTitle(SqlAuthenticationType.Win, Properties.Resources.SqlAuthenticationTypeWin);

            EnumTitlesKeeper <SqlAuthenticationType> .RegisterTitle(SqlAuthenticationType.Sql, Properties.Resources.SqlAuthenticationTypeSql);

            EnumTitlesKeeper <MovieItemFormat> .RegisterTitle(MovieItemFormat.DVD, Properties.Resources.DVD);

            EnumTitlesKeeper <MovieItemFormat> .RegisterTitle(MovieItemFormat.BlueRay, Properties.Resources.BlueRay);

            EnumTitlesKeeper <MovieItemFormat> .RegisterTitle(MovieItemFormat.VideoCD, Properties.Resources.VideoCD);

            EnumTitlesKeeper <MovieItemFormat> .RegisterTitle(null, Properties.Resources.AllFormats);

            EnumTitlesKeeper <MovieRating> .RegisterTitle(MovieRating.PG13, "PG-13");

            EnumTitlesKeeper <MovieRating> .RegisterTitle(MovieRating.NC17, "NC-17");

            EnumTitlesKeeper <PersonGender> .RegisterTitle(PersonGender.Female, Properties.Resources.Female);

            EnumTitlesKeeper <PersonGender> .RegisterTitle(PersonGender.Male, Properties.Resources.Male);

            EnumTitlesKeeper <CustomerDiscountLevel> .RegisterTitle(CustomerDiscountLevel.FirstTime, Properties.Resources.RenterFirstTime);

            EnumTitlesKeeper <CustomerDiscountLevel> .RegisterTitle(CustomerDiscountLevel.Basic, Properties.Resources.RenterBasic);

            EnumTitlesKeeper <CustomerDiscountLevel> .RegisterTitle(CustomerDiscountLevel.Occasional, Properties.Resources.RenterOccasional);

            EnumTitlesKeeper <CustomerDiscountLevel> .RegisterTitle(CustomerDiscountLevel.Active, Properties.Resources.RenterActive);

            EnumTitlesKeeper <CustomerDiscountLevel> .RegisterTitle(CustomerDiscountLevel.Prodigious, Properties.Resources.RenterProdigious);

            EnumTitlesKeeper <ReceiptType> .RegisterTitle(ReceiptType.Rentals, Properties.Resources.Rentals);

            EnumTitlesKeeper <ReceiptType> .RegisterTitle(ReceiptType.Purchases, Properties.Resources.Purchases);

            EnumTitlesKeeper <ReceiptType> .RegisterTitle(ReceiptType.LateFees, Properties.Resources.LateFees);

            EnumTitlesKeeper <MovieItemStatus> .RegisterTitle(MovieItemStatus.Active, Properties.Resources.Active);

            EnumTitlesKeeper <MovieItemStatus> .RegisterTitle(MovieItemStatus.Damaged, Properties.Resources.Damaged);

            EnumTitlesKeeper <MovieItemStatus> .RegisterTitle(MovieItemStatus.Lost, Properties.Resources.Lost);

            EnumTitlesKeeper <MovieItemStatus> .RegisterTitle(MovieItemStatus.Rented, Properties.Resources.Rented);

            EnumTitlesKeeper <MovieItemStatus> .RegisterTitle(MovieItemStatus.Sold, Properties.Resources.Sold);

            EnumTitlesKeeper <ActiveRentType> .RegisterTitle(ActiveRentType.None, Properties.Resources.None);

            EnumTitlesKeeper <ActiveRentType> .RegisterTitle(ActiveRentType.Today, Properties.Resources.Today);

            EnumTitlesKeeper <ActiveRentType> .RegisterTitle(ActiveRentType.Overdue, Properties.Resources.Overdue);

            EnumTitlesKeeper <ActiveRentType> .RegisterTitle(ActiveRentType.Active, Properties.Resources.ActiveRent);
        }