public void SetMail(string mail) { TypeCheck.IsNullOrEmpty(mail); CommonPolicy.CheckMail(mail); //TODO: Fire event to notify supplier about updated mail address Email = mail; }
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); }
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); }
public void SetName(string name) { TypeCheck.IsNullOrEmpty(name); Name = name; }
public void SetId(string id) { TypeCheck.IsNullOrEmpty(id); Id = id; }
public void SetTitle(string title) { Title = TypeCheck.IsNullOrEmpty(title); }
public void ChangeCustomerCode(string code) { //TODO: check whether customer code exists on database (it is unique) CustomerId = CustomerPolicy.CheckCustomerCode(TypeCheck.IsNullOrEmpty(code)); }
public void SetEMail(string email) { CommonPolicy.CheckMail(TypeCheck.IsNullOrEmpty(email)); EMail = email; }
public void SetLastName(string lastname) { EmployeePolicy.CheckLastNameRequirement(lastname); LastName = TypeCheck.IsNullOrEmpty(lastname); }
public void SetName(string name) { EmployeePolicy.CheckNameRequirement(name); FirstName = TypeCheck.IsNullOrEmpty(name); }