private async Task ExecuteFunction(ObjectProxy instance, MethodInfo method, string methodName) { var parameters = method.GetParameters(); var parameterValueStores = parameters .Select(p => new SelfcontainedValueStore { Identifier = p.GetCustomAttribute <TitleAttribute>()?.Title ?? ObjectDisplay.Nicely(p), Value = ((p.Attributes & ParameterAttributes.HasDefault) == ParameterAttributes.HasDefault) ? p.DefaultValue : p.ParameterType == typeof(DateTime) ? (object)DateTime.Today : null, ValueType = p.ParameterType, CustomView = p.GetCustomAttribute <CustomViewAttribute>()?.ResourceKey, }).ToList <IValueStore>(); var parameterValueStoresWithoutObservableCollections = parameterValueStores .Where(vs => IsObservableCollection(vs.ValueType) == false) .ToList(); var propertiesViewModels = PropertiesViewModels.Of(parameterValueStoresWithoutObservableCollections, _Objects); if (parameterValueStoresWithoutObservableCollections.Any()) { MethodInvocationTitle = methodName; MethodInvocationParameters = propertiesViewModels; MethodInvocationContinuation = new Command(async() => await InvokeMethod(instance, method, parameterValueStores)); ShowMethodInvocationDialog(parameterValueStoresWithoutObservableCollections); } else { await InvokeMethod(instance, method, parameterValueStores); } }
protected override void OnSelectedMasterItem(object o) { var selectedObject = o as ObjectProxy; if (selectedObject != null) { var type = selectedObject.ProxiedObject.GetType(); Properties = PropertiesViewModels.Of(PropertyValueStore.ForPropertiesOf(type, selectedObject, InvokeChangedEvents), _Objects); var methods = type.GetMethods(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); var functions = GetFunctions(selectedObject, methods); DetailCommands.Clear(); foreach (var function in functions) { DetailCommands.Add(new ActionViewModel { Label = function.Item1, Icon = function.Item2, Action = function.Item3 }); } } else { Properties = new List <IPropertyViewModel>(); DetailCommands.Clear(); } System.Diagnostics.Debug.WriteLine("Properties.Count: " + Properties.Count); Changed(() => Properties); }
public ActionResult SearchByPropertyID(int PropID) { PropertiesViewModels pr = new PropertiesViewModels(); PropertyDTO res = qm.GetPropertyInfoByID(PropID); pr.ID = res.ID; pr.Parcel = res.Parcel; pr.Date = res.Date; pr.Towner = res.Towner; pr.Lsaleamt = res.Lsaleamt; pr.Number = res.Number; pr.Street = res.Street; pr.BLOCK10 = res.BLOCK10; pr.BLOCKGR10 = res.BLOCKGR10; pr.Tract10 = res.Tract10; pr.Pclass = res.Pclass; pr.Luc = res.Luc; pr.Luc_descr = res.Luc_descr; pr.Yrbuilt = res.Yrbuilt; pr.MAILNAME = res.MAILNAME; pr.Mailname1 = res.Mailname1; pr.MAIL_STREET_NUMBER = res.MAIL_STREET_NUMBER; pr.MAIL_STREET_DIRECTION = res.MAIL_STREET_DIRECTION; pr.MAIL_STREET_NAME = res.MAIL_STREET_NAME; pr.MAIL_STREET_SUFFIX = res.MAIL_STREET_SUFFIX; pr.MAIL_CITY = res.MAIL_CITY; pr.MAIL_STATE = res.MAIL_STATE; pr.MAIL_ZIPCODE = res.MAIL_ZIPCODE; pr.TOTAL_NET_DELQ_BALANCE = Convert.ToDecimal(res.TOTAL_NET_DELQ_BALANCE); return(View("Results", pr)); }
public ActionResult Search([Bind(Include = "Number,Street")] PropertiesViewModels pr) { if (ModelState.IsValid) { if (pr.Number == null || pr.Street == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } } PropertyDTO res = qm.GetPropertyInfo(pr.Number, pr.Street); if (res == null) { ViewBag.Msg = "No Record found for this property address. Please try again."; return(View("Results")); } qm.SaveSearchHistory(res.ID, User.Identity.GetUserId()); pr.ID = res.ID; pr.Parcel = res.Parcel; pr.Date = res.Date; pr.Towner = res.Towner; pr.Lsaleamt = res.Lsaleamt; pr.Number = res.Number; pr.Street = res.Street; pr.BLOCK10 = res.BLOCK10; pr.BLOCKGR10 = res.BLOCKGR10; pr.Tract10 = res.Tract10; pr.Pclass = res.Pclass; pr.Luc = res.Luc; pr.Luc_descr = res.Luc_descr; pr.Yrbuilt = res.Yrbuilt; pr.MAILNAME = res.MAILNAME; pr.Mailname1 = res.Mailname1; pr.MAIL_STREET_NUMBER = res.MAIL_STREET_NUMBER; pr.MAIL_STREET_DIRECTION = res.MAIL_STREET_DIRECTION; pr.MAIL_STREET_NAME = res.MAIL_STREET_NAME; pr.MAIL_STREET_SUFFIX = res.MAIL_STREET_SUFFIX; pr.MAIL_CITY = res.MAIL_CITY; pr.MAIL_STATE = res.MAIL_STATE; pr.MAIL_ZIPCODE = res.MAIL_ZIPCODE; pr.TOTAL_NET_DELQ_BALANCE = Convert.ToDecimal(res.TOTAL_NET_DELQ_BALANCE); return(View("Results", pr)); }
public ActionResult CompareProp() { //string ses = Session["ComparePropIDs"].ToString(); //string[] arSessions = ses.Split(','); string[] arSessions = new string[] { "100", "202", "303", "404" }; List <PropertiesViewModels> vmList = new List <PropertiesViewModels>(); QueryMethods qm = new QueryMethods(); foreach (var item in arSessions) { PropertyDTO propDTO = qm.GetPropertyInfoByID(Convert.ToInt32(item)); PropertiesViewModels propVM = new PropertiesViewModels(); propVM.Parcel = propDTO.Parcel; propVM.Date = propDTO.Date; propVM.Towner = propDTO.Towner; propVM.Lsaleamt = propDTO.Lsaleamt; propVM.Number = propDTO.Number; propVM.Street = propDTO.Street; propVM.BLOCK10 = propDTO.BLOCK10; propVM.BLOCKGR10 = propDTO.BLOCKGR10; propVM.Tract10 = propDTO.Tract10; propVM.Pclass = propDTO.Pclass; propVM.Luc = propDTO.Luc; propVM.Luc_descr = propDTO.Luc_descr; propVM.Yrbuilt = propDTO.Yrbuilt; propVM.MAILNAME = propDTO.MAILNAME; propVM.Mailname1 = propDTO.Mailname1; propVM.MAIL_STREET_NUMBER = propDTO.MAIL_STREET_NUMBER; propVM.MAIL_STREET_DIRECTION = propDTO.MAIL_STREET_DIRECTION; propVM.MAIL_STREET_NAME = propDTO.MAIL_STREET_NAME; propVM.MAIL_STREET_SUFFIX = propDTO.MAIL_STREET_SUFFIX; propVM.MAIL_CITY = propDTO.MAIL_CITY; propVM.MAIL_STATE = propDTO.MAIL_STATE; propVM.MAIL_ZIPCODE = propDTO.MAIL_ZIPCODE; propVM.TOTAL_NET_DELQ_BALANCE = Convert.ToDecimal(propDTO.TOTAL_NET_DELQ_BALANCE); vmList.Add(propVM); } return(View(vmList)); }