public void SetMail(string mail)
 {
     TypeCheck.IsNullOrEmpty(mail);
     CommonPolicy.CheckMail(mail);
     //TODO: Fire event to notify supplier about updated mail address
     Email = mail;
 }
예제 #2
0
        public void SetContact(string fullName, string email)
        {
            TypeCheck.IsNullOrEmpty(fullName);
            CommonPolicy.CheckMail(TypeCheck.IsNullOrEmpty(email));
            Contact      = fullName;
            ContactEMail = email;

            //TODO: Fire an event to notify person about being customer as our customer
        }
        public static Supplier Create(string companyName, string manager, string email, string phone)
        {
            var supplier = new Supplier();

            TypeCheck.IsNullOrEmpty(companyName);
            TypeCheck.IsNullOrEmpty(manager);
            TypeCheck.IsNullOrEmpty(phone);
            supplier.CompanyName = companyName;
            supplier.Manager     = manager;
            supplier.SetMail(email);
            supplier.Phone = phone;
            return(supplier);
        }
예제 #4
0
        public static Order Create(Customer customer, Employee employee, bool isUrgent, DateTime?shipDate)
        {
            TypeCheck.IsNull(customer);
            TypeCheck.IsNullOrEmpty(customer.Id);
            TypeCheck.IsNull(employee);
            TypeCheck.IsUsableAsId(employee.Id);
            var order = new Order()
            {
                CustomerId = customer.Id, EmployeeId = employee.Id
            };

            if (isUrgent)
            {
                order.SetAsUrgent(shipDate);
            }
            return(order);
        }
예제 #5
0
 public void SetName(string name)
 {
     TypeCheck.IsNullOrEmpty(name);
     Name = name;
 }
예제 #6
0
 public void SetId(string id)
 {
     TypeCheck.IsNullOrEmpty(id);
     Id = id;
 }
예제 #7
0
 public void SetTitle(string title)
 {
     Title = TypeCheck.IsNullOrEmpty(title);
 }
예제 #8
0
 public void ChangeCustomerCode(string code)
 {
     //TODO: check whether customer code exists on database (it is unique)
     CustomerId = CustomerPolicy.CheckCustomerCode(TypeCheck.IsNullOrEmpty(code));
 }
예제 #9
0
 public void SetEMail(string email)
 {
     CommonPolicy.CheckMail(TypeCheck.IsNullOrEmpty(email));
     EMail = email;
 }
예제 #10
0
 public void SetLastName(string lastname)
 {
     EmployeePolicy.CheckLastNameRequirement(lastname);
     LastName = TypeCheck.IsNullOrEmpty(lastname);
 }
예제 #11
0
 public void SetName(string name)
 {
     EmployeePolicy.CheckNameRequirement(name);
     FirstName = TypeCheck.IsNullOrEmpty(name);
 }