Пример #1
0
        public SearchPhoneInfo(bool isExipryData = false)
        {
            InitializeComponent();
            if (viewModel == null)
            {
                viewModel = new SearchPhoneViewModel(this, isExipryData);
            }

            BindingContext = viewModel;
        }
Пример #2
0
        public ActionResult GetTableName(string phoneNumber)
        {
            var factory = new SearchPhoneFactory();
            var repo    = new SearchPhoneRepository();

            // Map the Table names from the cplx EF class to the SearchPhoneViewModel
            var data = repo
                       .GetTableName(phoneNumber)
                       .ToList()
                       .Select(x => factory.Create(x));

            var model = new SearchPhoneViewModel();

            // Put the list of Tables that the phone number was found in.
            model.TableNameList.AddRange(data);
            return(Json(model.TableNameList));
        }