public async Task <PartialViewResult> CreateOrUpdatePhoneModal(long?ownerId, string ownerType, int tenantId, long?id = null) { long num; IGenericAppService genericAppService = this._genericAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; GetPhoneForEditOutput phoneForEdit = await genericAppService.GetPhoneForEdit(nullableIdInput); if (string.IsNullOrEmpty(phoneForEdit.Phone.OwnerType)) { phoneForEdit.Phone.OwnerType = ownerType; PhoneEditDto phone = phoneForEdit.Phone; num = (ownerId.HasValue ? ownerId.Value : (long)0); phone.OwnerId = num; } CreateOrUpdatePhoneModalViewModel createOrUpdatePhoneModalViewModel = new CreateOrUpdatePhoneModalViewModel(phoneForEdit); List <SelectListItem> selectListItems = new List <SelectListItem>(); foreach (Lookup lookupItem in (new LookupFill("PhoneTypes", tenantId)).LookupItems) { SelectListItem selectListItem = new SelectListItem() { Text = lookupItem.Text, Value = lookupItem.Value, Disabled = lookupItem.Disabled, Selected = lookupItem.Selected }; selectListItems.Add(selectListItem); } SelectListItem selectListItem1 = new SelectListItem() { Text = "", Value = "", Disabled = false }; selectListItems.Insert(0, selectListItem1); this.ViewData["PhoneTypes"] = selectListItems; return(this.PartialView("_CreateOrUpdatePhoneModal", createOrUpdatePhoneModalViewModel)); }
public CreateOrUpdatePhoneModalViewModel(GetPhoneForEditOutput output) { output.MapTo <GetPhoneForEditOutput, CreateOrUpdatePhoneModalViewModel>(this); }