public static HtmlString CustomerEnumDisplayNameFor(this CustomerType item)
        {
            var type   = item.GetType();
            var member = type.GetMember(item.ToString());
            DisplayAttribute displayName = (DisplayAttribute)member[0].GetCustomAttributes(typeof(DisplayAttribute), false).FirstOrDefault();

            if (displayName != null)
            {
                return(new HtmlString(displayName.Name));
            }

            return(new HtmlString(item.ToString()));
        }
Example #2
0
 public static ICustomer Create(CustomerType type)
 {
     if (custs == null)
     {
         custs = new UnityContainer();
         custs.RegisterType <CustomerDbObject, Customer>("Customer", new InjectionConstructor(new CustomerValidationMethod()));
         custs.RegisterType <CustomerDbObject, Lead>("Lead", new InjectionConstructor(new LeadValidationMethod()));
     }
     return(custs.Resolve <CustomerDbObject>(type.ToString()));
 }
Example #3
0
        private void selectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Vald kund
            var selectedCustomer = comboCustomer.SelectedItem.ToString();

            // Ordervärde
            this.orderValue             = repository.Customers().Where(c => c.CustomerName == (string)comboCustomer.SelectedItem).Select(c => c.OrderValue).First();
            lblOrderValueResult.Content = string.Format("{0} kr", this.orderValue.ToString("F"));

            // Kundtyp
            this.customertype             = CalculationService.getCustomerType(this.orderValue);
            lblCustomerTypeResult.Content = customertype.ToString();

            updateView();
        }
 public string ToText() // to write a record line in a text file
 {
     return(CustomerName + "," + CustomerAC.ToString() + "," + CustomerType.ToString() + "," + CustomerCharge.ToString());
 }
 public override string ToString() // overriding toString() method to read record line from file
 {
     return(CustomerName + "," + CustomerAC.ToString() + "," + CustomerType.ToString() + "," + CustomerCharge.ToString("c"));
 }
 public string ToDisplay()
 {
     return(AccountNumber.ToString() + "\t\t" + CustomerName + "\t" +
            "\t" + CustomerType.ToString() + "\t" + ChargeAmount.ToString());
 }
 public override string ToString()
 {
     return(CustomerName + "," + AccountNumber.ToString() + "," + CustomerType.ToString() + "," + ChargeAmount.ToString());
 }
 public string ToFileString()
 {
     return(AccountNo.ToString() + "/" + CustomerName + "/" + CustomerType.ToString() + "/" + ChargeAmount.ToString());
 }
Example #9
0
 public RoleFilter(CustomerType roleType)
 {
     RoleTypes = new List <string> {
         roleType.ToString()
     };
 }