public string Title()
 {
     var t = new TitleBuilder();
     t.Append(ProductSku != null ? Product.Title() : "Addition");
     t.Append(" for ").Append(Order != null? Order.CustomerName: "Customer");
     return t.ToString();
 }
 public override string ToString()
 {
     var t = new TitleBuilder();
     string stars = "*****".Substring(0, Rating);
     t.Append(stars);
     return t.ToString();
 }
Exemple #3
0
 public string Title()
 {
     var t = new TitleBuilder();
     if (PayeeCompoundKey != null)
     {
         t.Append(Payee.Title());
     }
     t.Append(Amount);
     return t.ToString();
 }
Exemple #4
0
 public override string ToString()
 {
     var t = new TitleBuilder();
     if (NameStyle)
     {
         t.Append(LastName).Append(FirstName);
     }
     else
     {
         t.Append(FirstName).Append(LastName);
     }
     return t.ToString();
 }
        internal override string GetTitle(object obj, string format)
        {
            object referencedObject = property.GetValue(obj, new object[0]);

            if (referencedObject == null)
            {
                return("");
            }
            else
            {
#pragma warning disable 618
                return(TitleBuilder.TitleOrToString(referencedObject, format));

#pragma warning restore 618
            }
        }
Exemple #6
0
        public SpecialOfferProduct AssociateSpecialOfferWithProduct(SpecialOffer offer, Product product) {
            //First check if association already exists
            IQueryable<SpecialOfferProduct> query = from sop in Instances<SpecialOfferProduct>()
                                                    where sop.SpecialOfferID == offer.SpecialOfferID &&
                                                          sop.ProductID == product.ProductID
                                                    select sop;

            if (query.Count() != 0) {
                var t = new TitleBuilder();
                t.Append(offer).Append(" is already associated with").Append(product);
                WarnUser(t.ToString());
                return null;
            }
            var newSop = NewTransientInstance<SpecialOfferProduct>();
            newSop.SpecialOffer = offer;
            newSop.Product = product;
            //product.SpecialOfferProduct.Add(newSop);
            Persist(ref newSop);
            return newSop;
        }
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(AddressLine1).Append("...");
     return t.ToString();
 }
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(Name).Append(",", this.AccountNumber);
     return t.ToString();
 }
        public SalesOrderDetail AddNewDetail(Product product,
                            [DefaultValue((short)1), Range(1, 999)] short quantity)
        {
            int stock = product.NumberInStock();
            if (stock < quantity)
            {
                var t = new TitleBuilder();
                t.Append("Current inventory of").Append(product).Append(" is").Append(stock);
                Container.WarnUser(t.ToString());
            }
            var sod = Container.NewTransientInstance<SalesOrderDetail>();
            sod.SalesOrderHeader = this;
            sod.SalesOrderID = SalesOrderID;
            sod.OrderQty = quantity;
            sod.SpecialOfferProduct = product.BestSpecialOfferProduct(quantity);
            sod.Recalculate();

            return sod;
        }
Exemple #10
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(Rate, "C", null).Append(" from", RateChangeDate, "d", null);
     return t.ToString();
 }
Exemple #11
0
        public void EnumAsArgumentWithMultipleWordsFormatted() {
            var t = new TitleBuilder();
            t.Append(Sex.NotSpecified);

            Assert.AreEqual("Not Specified", t.ToString());
        }
Exemple #12
0
 public void NewBuilder() {
     builder = new TitleBuilder();
 }
Exemple #13
0
 public string Title()
 {
     TitleBuilder t = new TitleBuilder();
     t.Append(Quantity).Append(" x", Product);
     return t.ToString();
 }
Exemple #14
0
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(FirstName).Append(LastName);
     return t.ToString();
 }
Exemple #15
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(StandardCost).Append(StartDate).Append("~");
     return t.ToString();
 }
Exemple #16
0
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(ContactDetails);
     return t.ToString();
 }
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(Contact).Append(",", AccountNumber);
     return t.ToString();
 }
 public void TestNewBuilderContainsUnmodifiedText()
 {
     builder = new TitleBuilder("Text");
     AssertTitleIs("Text");
 }
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(Contact).Append(":", ContactType);
     return t.ToString();
 }
Exemple #20
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(ObfuscatedNumber);
     return t.ToString();
 }
Exemple #21
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(Employee);
     return t.ToString();
 }
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(AddressType).Append(":", Address);
     return t.ToString();
 }
 public string Title()
 {
     var t = new TitleBuilder();
     t.Append(this.Description);
     return t.ToString();
 }
Exemple #24
0
        public void EnumAsArgumentWithSingleWord() {
            var t = new TitleBuilder();
            t.Append(Sex.Female);

            Assert.AreEqual("Female", t.ToString());
        }
Exemple #25
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(Quantity.ToString()).Append(" in", Location).Append(" -", Shelf);
     return t.ToString();
 }
Exemple #26
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(SalesReason);
     return t.ToString();
 }
Exemple #27
0
 public string Title()
 {
     var t = new TitleBuilder();
     t.Append(DrinkSku != null ? Drink.Title() : "Order");
     t.Append(" for ").Append(CustomerName);
     return t.ToString();
 }
Exemple #28
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(OrderQty.ToString()).Append(" x", Product);
     return t.ToString();
 }
 public void NewBuilder()
 {
     builder = new TitleBuilder("Text");
 }
Exemple #30
0
 public string Title()
 {
     var t = new TitleBuilder();
     t.Append(Name);
     return t.ToString();
 }
Exemple #31
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(QuotaDate, "d", null).Append(SalesQuota, "C", null);
     return t.ToString();
 }
Exemple #32
0
 public override string ToString() {
     var t = new TitleBuilder();
     t.Append(Description);
     return t.ToString();
 }
 public override string ToString()
 {
     var t = new TitleBuilder();
     t.Append(Department).Append(StartDate, "d", null);
     return t.ToString();
 }