예제 #1
0
 public override string GetMessage()
 {
     return(String.Format(Messages.OrderFormat,
                          DataFormatter.FormatDayDate(Order.OrderDate),
                          Order.Supplier.Name,
                          String.IsNullOrWhiteSpace(Order.Supplier.Phone) ? String.Empty : (String.Format(Messages.PhoneFormat, Order.Supplier.Phone) + "\n"),
                          String.Join("\n", Order.Items.OrderBy(i => i.Content).Select(c => String.Format("- [{0}] **{1}**", c.User.DisplayName, c.Content)).ToList()),
                          Order.Items.Count,
                          Order.Operator != null ? (String.Format(Messages.OperatorFormat, Order.Operator.DisplayName)) + "\n" : String.Empty
                          ));
 }
        public override string GetMessage()
        {
            if (User != null)
            {
                var usersList = String.Join(", ", Users.Select(u => u.DisplayName).ToArray());
                return(String.Format(Messages.RandomOperatorForOrder, Order.Supplier.Name, DataFormatter.FormatDayDate(Order.OrderDate), User.DisplayName, usersList));
            }

            return(Messages.RandomNoUsers);
        }