Exemplo n.º 1
0
        public static Customers convertCustomer(CustomerBaseRepresentation customer)
        {
            // TODO: Implement concurency checking (rowVersion)
            var convertedCustomer = new Customers()
            {
                customerID = customer.id,
                comment = customer.comment,
                customerAddress = customer.customerAddress,
                customerName = customer.customerName,
                customerPhone = customer.customerPhone,
                defaultDiscount = customer.defaultDiscount * 100,
                IDNumber = customer.IDNumber,
                isDeleted = customer.isDeleted,
                isFirm = customer.isFirm,
                problems = customer.problems,
                rentCounter = customer.rentCounter,
                serviceCounter = customer.serviceCounter
            };

            if (customer.GetType() == typeof(PersonRepresentation))
            {
                convertedCustomer.birthDate = ((PersonRepresentation)customer).birthDate;
                convertedCustomer.mothersName = ((PersonRepresentation)customer).mothersName;
                convertedCustomer.workPlace = ((PersonRepresentation)customer).workplace;
            }

            if (customer.city != null)
            {
                convertedCustomer.cityID = customer.city.id;
            }

            return convertedCustomer;
        }
Exemplo n.º 2
0
 private void addContact(CustomerBaseRepresentation c)
 {
     DataProxy.Instance.AddContact(selectedCustomer, c);
     refreshContacts();
 }
Exemplo n.º 3
0
 public static void Send(CustomerBaseRepresentation selectedCustomer)
 {
     Messenger.Default.Send(selectedCustomer, MessageTypes.customerToSelect);
 }
Exemplo n.º 4
0
 public static void Send(CustomerBaseRepresentation selectedContactPerson)
 {
     Messenger.Default.Send(selectedContactPerson, MessageTypes.contactSelected);
 }