Exemplo n.º 1
0
		public void DeleteContactItem(int orderId, ContactItemInfoViewModel viewModel)
		{
			var order = _orderManager.GetOrderById(orderId);
			CheckOrderAccessForClients(order, isWizardOnly: false);
			_orderManager.DeleteContact(order, viewModel.Id);
		}
Exemplo n.º 2
0
		public void SaveContact(Order order, ContactItemInfoViewModel currentContact)
		{
			if (order == null)
			{
				throw new ArgumentNullException("order");
			}
			if (currentContact == null)
			{
				throw new ArgumentNullException("ContactItemInfoViewModel");
			}

			if (order.LoanAndContactInfo.Contacts == null)
			{
				order.LoanAndContactInfo.Contacts = new List<OrderContact>();
			}
			var contact = order.LoanAndContactInfo.Contacts.SingleOrDefault(e => e.Id.ToString() == currentContact.Id);
			if (contact == null)
			{
				contact = new OrderContact();
				order.LoanAndContactInfo.Contacts.Add(contact);
			}

			contact.ContactRoleId = currentContact.ContactRole.Value;
			contact.Name = currentContact.Name;
			contact.Phone = currentContact.Phone;
			contact.Email = currentContact.Email;
		}
Exemplo n.º 3
0
		public ContactInfoViewModel(ICollection<OrderContact> model, int orderId)
		{
			if (model != null)
			{
				this.OrderId = orderId;
				foreach (OrderContact contact in model)
				{
					var contactItemInfoViewModel = new ContactItemInfoViewModel(contact);
					this.ListOfContact.Add(contactItemInfoViewModel);
				}
			}
		}