Ejemplo n.º 1
0
		public PhonesViewModel GetPhonesViewModel(ICollection<Phone> phones)
		{
			var phonesViewModel = new PhonesViewModel();
			phonesViewModel.PhoneItems = new List<PhoneItemViewModel>();

			if (phones != null)
			{
				foreach (var phone in phones)
				{
					var phoneItemViewModel = new PhoneItemViewModel();
					phoneItemViewModel.Id = phone.Id.ToString();
					phoneItemViewModel.Number = phone.Number;
					phoneItemViewModel.PhoneType = phone.Type;
					phonesViewModel.PhoneItems.Add(phoneItemViewModel);
				}
			}

			if (phonesViewModel.PhoneItems.Count == 0)
			{
				phonesViewModel.PhoneItems.Add(new PhoneItemViewModel() { Id = Guid.NewGuid().ToString(), PhoneType = PhoneType.Mobile });
			}

			return phonesViewModel;
		}
Ejemplo n.º 2
0
		public PartialViewResult AddEmptyPhone()
		{
			var phone = new PhoneItemViewModel { Id = Guid.NewGuid().ToString(), PhoneType = PhoneType.Mobile };
			var phonesViewModel = new PhonesViewModel { PhoneItems = new List<PhoneItemViewModel> { phone } };
			var model = new AppraisalCompanyContactViewModel { Phones = phonesViewModel };

			ViewBag.ExecuteBeginForm = true;
			ViewBag.ControllerName = CurrentControllerName;
			return PartialView("Tables/AppraisalCompanyPhones", model);
		}
Ejemplo n.º 3
0
		public PartialViewResult AddEmptyPhone()
		{
			var phone = new PhoneItemViewModel { Id = Guid.NewGuid().ToString(), PhoneType = PhoneType.Mobile };
			var phonesViewModel = new PhonesViewModel { PhoneItems = new List<PhoneItemViewModel> { phone } };
			var model = new AppraiserUserCreateViewModel();
			model.Contact.Phones = phonesViewModel;
			ViewBag.ExecuteBeginForm = true;
			ViewBag.AreaName = DVS.Logic.Constants.Areas.UserManagement;
			ViewBag.ControllerName = NameHelper.AppraiserUserAdd.Controller;
			return PartialView(Constants.Views.AppraiserPhonesPartial, model);
		}