/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = filterControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Accounts"; filterControl.Controls.Add(accountPicker); SlidingDateRangePicker slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.Help = "The date range of the transactions using the 'Sunday Date' of each transaction"; slidingDateRangePicker.Required = true; filterControl.Controls.Add(slidingDateRangePicker); RockCheckBox cbCombineGiving = new RockCheckBox(); cbCombineGiving.ID = filterControl.ID + "_cbCombineGiving"; cbCombineGiving.Label = "Combine Giving"; cbCombineGiving.CssClass = "js-combine-giving"; cbCombineGiving.Help = "Combine individuals in the same giving group when calculating first contribution date and reporting the list of individuals."; filterControl.Controls.Add(cbCombineGiving); var controls = new Control[3] { accountPicker, slidingDateRangePicker, cbCombineGiving }; return(controls); }
//when modify account button clicked, this method will be fired private void btnModifyAccount_Click(object sender, EventArgs e) { if (GetSelectCustomer() == null) { return; } var win = new AccountPicker(); win.ShowDialog(); if (win.CurrentAccount == null) { return; } try { var customer = GetSelectCustomer(); customer.Account = win.CurrentAccount; UpdateCustomer(customer); LoadData(); } catch (Exception exception) { } }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = filterControl.ID + "_accountPicker"; accountPicker.Label = "Accounts"; filterControl.Controls.Add(accountPicker); SlidingDateRangePicker slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.Help = "The date range of the transactions using the 'Sunday Date' of each transaction"; slidingDateRangePicker.Required = true; filterControl.Controls.Add(slidingDateRangePicker); RockCheckBox cbUseSundayDate = new RockCheckBox(); cbUseSundayDate.ID = filterControl.ID + "_cbUseSundayDate"; cbUseSundayDate.Label = "Use Sunday Date"; cbUseSundayDate.Help = "Use the Sunday Date instead of the actual transaction date."; cbUseSundayDate.AddCssClass("js-use-sunday-date"); filterControl.Controls.Add(cbUseSundayDate); var controls = new Control[3] { accountPicker, slidingDateRangePicker, cbUseSundayDate }; return(controls); }
/// <summary> /// Gets the selection. /// </summary> /// <param name="controls">The controls.</param> /// <returns></returns> public override string GetSelection(System.Web.UI.Control[] controls) { string delimitedAccountGuids = string.Empty; string useSundayDate = string.Empty; if (controls.Count() > 0) { AccountPicker accountPicker = controls[0] as AccountPicker; if (accountPicker != null) { var accountIds = accountPicker.SelectedValues.AsIntegerList(); var accountGuids = new FinancialAccountService(new RockContext()).GetByIds(accountIds).Select(a => a.Guid); delimitedAccountGuids = accountGuids.Select(a => a.ToString()).ToList().AsDelimited(","); } if (controls.Count() > 1) { RockCheckBox cbUseSundayDate = controls[1] as RockCheckBox; if (cbUseSundayDate != null) { useSundayDate = cbUseSundayDate.Checked.ToString(); } } if (delimitedAccountGuids != string.Empty || useSundayDate != string.Empty) { return($"{delimitedAccountGuids}|{useSundayDate}"); } } return(null); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = filterControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Accounts"; filterControl.Controls.Add(accountPicker); SlidingDateRangePicker slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.Help = "The date range of the transactions using the 'Sunday Date' of each transaction"; slidingDateRangePicker.Required = true; filterControl.Controls.Add(slidingDateRangePicker); var controls = new Control[2] { accountPicker, slidingDateRangePicker }; return(controls); }
/// <summary> /// Sets the selection. /// </summary> /// <param name="controls">The controls.</param> /// <param name="selection">The selection.</param> public override void SetSelection(System.Web.UI.Control[] controls, string selection) { string[] selections = selection.Split('|'); if (controls.Count() > 0) { AccountPicker accountPicker = controls[0] as AccountPicker; if (accountPicker != null) { string[] selectionAccountGuidValues = selections[0].Split(','); var accountList = new List <FinancialAccount>(); foreach (string accountGuid in selectionAccountGuidValues) { var account = new FinancialAccountService(new RockContext()).Get(accountGuid.AsGuid()); if (account != null) { accountList.Add(account); } } accountPicker.SetValues(accountList); } } if (controls.Count() > 1) { RockCheckBox cbUseSundayDate = controls[1] as RockCheckBox; if (cbUseSundayDate != null && selections.Count() > 1) { cbUseSundayDate.Checked = selections[1].AsBooleanOrNull() ?? false; } } }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(System.Web.UI.Control parentControl) { var comparisonControl = ComparisonHelper.ComparisonControl(ComparisonType.LessThan | ComparisonType.GreaterThanOrEqualTo | ComparisonType.EqualTo); comparisonControl.ID = parentControl.ID + "_0"; parentControl.Controls.Add(comparisonControl); var globalAttributes = GlobalAttributesCache.Get(); NumberBox numberBoxAmount = new NumberBox(); numberBoxAmount.PrependText = globalAttributes.GetValue("CurrencySymbol") ?? "$"; numberBoxAmount.NumberType = ValidationDataType.Currency; numberBoxAmount.ID = parentControl.ID + "_1"; numberBoxAmount.Label = "Amount"; parentControl.Controls.Add(numberBoxAmount); AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = parentControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Accounts"; parentControl.Controls.Add(accountPicker); SlidingDateRangePicker slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.ID = parentControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.Help = "The date range of the transactions using the transaction date of each transaction"; slidingDateRangePicker.Required = true; parentControl.Controls.Add(slidingDateRangePicker); RockCheckBox cbCombineGiving = new RockCheckBox(); cbCombineGiving.ID = parentControl.ID + "_cbCombineGiving"; cbCombineGiving.Label = "Combine Giving"; cbCombineGiving.CssClass = "js-combine-giving"; cbCombineGiving.Help = "Combine individuals in the same giving group when calculating totals and reporting the list of individuals."; parentControl.Controls.Add(cbCombineGiving); RockCheckBox cbUseAnalytics = new RockCheckBox(); cbUseAnalytics.ID = parentControl.ID + "_cbUseAnalytics"; cbUseAnalytics.Label = "Use Analytics Models"; cbUseAnalytics.CssClass = "js-use-analytics"; cbUseAnalytics.Help = "Using Analytics Data is MUCH faster than querying real-time data, but it may not include data that has been added or updated in the last 24 hours."; parentControl.Controls.Add(cbUseAnalytics); var controls = new Control[6] { comparisonControl, numberBoxAmount, accountPicker, slidingDateRangePicker, cbCombineGiving, cbUseAnalytics }; SetSelection(controls, $"{ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString()}|||||||"); return(controls); }
/// <summary> /// Sets the selection. /// </summary> /// <param name="controls">The controls.</param> /// <param name="selection">The selection.</param> public override void SetSelection(System.Web.UI.Control[] controls, string selection) { if (controls.Count() == 1) { AccountPicker accountPicker = controls[0] as AccountPicker; if (accountPicker != null) { var account = new FinancialAccountService().Get(selection.AsInteger() ?? 0); accountPicker.SetValue(account); } } }
/// <summary> /// Creates the child controls. /// </summary> /// <param name="parentControl"></param> /// <returns></returns> public override System.Web.UI.Control[] CreateChildControls(System.Web.UI.Control parentControl) { AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = parentControl.ID + "_accountPicker"; accountPicker.Label = "Account"; accountPicker.Help = "Pick accounts to show the last time the person made a contribution into any of those accounts. Leave blank if you don't want to limit it to specific accounts."; parentControl.Controls.Add(accountPicker); return(new System.Web.UI.Control[] { accountPicker }); }
/// <summary> /// Gets the selection. /// </summary> /// <param name="controls">The controls.</param> /// <returns></returns> public override string GetSelection(System.Web.UI.Control[] controls) { if (controls.Count() == 1) { AccountPicker accountPicker = controls[0] as AccountPicker; if (accountPicker != null) { return(accountPicker.SelectedValueAsId().ToString()); } } return(null); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { var comparisonControl = ComparisonHelper.ComparisonControl(ComparisonType.LessThan | ComparisonType.GreaterThanOrEqualTo | ComparisonType.EqualTo); comparisonControl.ID = filterControl.ID + "_comparisonControl"; filterControl.Controls.Add(comparisonControl); var globalAttributes = GlobalAttributesCache.Get(); NumberBox numberBoxAmount = new NumberBox(); numberBoxAmount.PrependText = globalAttributes.GetValue("CurrencySymbol") ?? "$"; numberBoxAmount.NumberType = ValidationDataType.Currency; numberBoxAmount.ID = filterControl.ID + "_numberBoxAmount"; numberBoxAmount.Label = "Amount"; filterControl.Controls.Add(numberBoxAmount); AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = filterControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Accounts"; filterControl.Controls.Add(accountPicker); SlidingDateRangePicker slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.Help = "The date range of the transactions using the transaction date of each transaction"; slidingDateRangePicker.Required = true; filterControl.Controls.Add(slidingDateRangePicker); RockCheckBox cbCombineGiving = new RockCheckBox(); cbCombineGiving.ID = filterControl.ID + "_cbCombineGiving"; cbCombineGiving.Label = "Combine Giving"; cbCombineGiving.CssClass = "js-combine-giving"; cbCombineGiving.Help = "Combine individuals in the same giving group when calculating totals and reporting the list of individuals."; filterControl.Controls.Add(cbCombineGiving); var controls = new Control[5] { comparisonControl, numberBoxAmount, accountPicker, slidingDateRangePicker, cbCombineGiving }; SetSelection(entityType, controls, string.Format("{0}||||||", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString())); return(controls); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { AccountPicker accountPicker = new AccountPicker(); // NOTE: This filter is already designed to handle either Multiselect or SingleSelect mode, so all you have to is set this to true or false accountPicker.AllowMultiSelect = true; accountPicker.ID = filterControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Account"; filterControl.Controls.Add(accountPicker); return(new Control[] { accountPicker }); }
public bool OnNavigationItemSelected(IMenuItem item) { int id = item.ItemId; if (id == Resource.Id.nav_camera) { GoogleManager.Login(this); } else if (id == Resource.Id.nav_gallery) { } else if (id == Resource.Id.nav_slideshow) { AccountManager mAccountManager = AccountManager.Get(this); Account[] accounts = mAccountManager.GetAccounts(); // "wise" = Google Spreadheets //var amf = mAccountManager.GetAuthToken(accounts[0], "wise", null, this, this, null);//"wise" var t = mAccountManager.BlockingGetAuthToken(accounts[0], "wise", true); try { //Task.Run(async () => //{ // var result = await amf.GetResultAsync(5L, TimeUnit.Seconds); // var t = result; //}); //var authToken = authTokenBundle.GetString(AccountManager.KEY_AUTHTOKEN); } catch (System.Exception e) { } } else if (id == Resource.Id.nav_manage) { } else if (id == Resource.Id.nav_share) { } else if (id == Resource.Id.nav_send) { var accountTypes = new string[] { "com.google" }; var intent = AccountPicker.NewChooseAccountIntent(null, null, null, /*accountTypes,*/ false, null, null, null, null); StartActivityForResult(intent, 1000);//REQUEST_CODE_PICK_ACCOUNT } DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); drawer.CloseDrawer(GravityCompat.Start); return(true); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(System.Web.UI.Control parentControl) { var comparisonControl = ComparisonHelper.ComparisonControl(ComparisonType.LessThan | ComparisonType.GreaterThanOrEqualTo | ComparisonType.EqualTo); comparisonControl.ID = parentControl.ID + "_0"; parentControl.Controls.Add(comparisonControl); var globalAttributes = Rock.Web.Cache.GlobalAttributesCache.Read(); NumberBox numberBoxAmount = new NumberBox(); numberBoxAmount.PrependText = globalAttributes.GetValue("CurrencySymbol") ?? "$"; numberBoxAmount.NumberType = ValidationDataType.Currency; numberBoxAmount.ID = parentControl.ID + "_1"; numberBoxAmount.Label = "Amount"; parentControl.Controls.Add(numberBoxAmount); AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = parentControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Accounts"; parentControl.Controls.Add(accountPicker); DateRangePicker dateRangePicker = new DateRangePicker(); dateRangePicker.ID = parentControl.ID + "_2"; dateRangePicker.Label = "Date Range"; dateRangePicker.Required = true; parentControl.Controls.Add(dateRangePicker); RockCheckBox cbCombineGiving = new RockCheckBox(); cbCombineGiving.ID = parentControl.ID + "_cbCombineGiving"; cbCombineGiving.Label = "Combine Giving"; cbCombineGiving.CssClass = "js-combine-giving"; cbCombineGiving.Help = "Combine individuals in the same giving group when calculating totals and reporting the list of individuals."; parentControl.Controls.Add(cbCombineGiving); var controls = new Control[5] { comparisonControl, numberBoxAmount, accountPicker, dateRangePicker, cbCombineGiving }; SetSelection(controls, string.Format("{0}|||||", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString())); return(controls); }
/// <summary> /// Gets the selection. /// </summary> /// <param name="controls">The controls.</param> /// <returns></returns> public override string GetSelection(System.Web.UI.Control[] controls) { if (controls.Count() == 1) { AccountPicker accountPicker = controls[0] as AccountPicker; if (accountPicker != null) { var accountIds = accountPicker.SelectedValues.AsIntegerList(); var accountGuids = new FinancialAccountService(new RockContext()).GetByIds(accountIds).Select(a => a.Guid); return(accountGuids.Select(a => a.ToString()).ToList().AsDelimited(",")); } } return(null); }
/// <summary> /// Creates the child controls. /// </summary> /// <param name="parentControl"></param> /// <returns></returns> public override System.Web.UI.Control[] CreateChildControls(System.Web.UI.Control parentControl) { AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = parentControl.ID + "_accountPicker"; accountPicker.Label = "Account"; accountPicker.Help = string.Format( "Pick accounts to show the {0} time the person made a contribution into any of those accounts. Leave blank if you don't want to limit it to specific accounts.", FirstOrLast.ConvertToString().ToLower()); parentControl.Controls.Add(accountPicker); RockCheckBox cbUseSundayDate = new RockCheckBox(); cbUseSundayDate.ID = parentControl.ID + "_cbUseSundayDate"; cbUseSundayDate.Label = "Use Sunday Date"; cbUseSundayDate.Help = "Use the Sunday Date instead of the actual transaction date."; parentControl.Controls.Add(cbUseSundayDate); return(new System.Web.UI.Control[] { accountPicker, cbUseSundayDate }); }
/// <summary> /// Sets the selection. /// </summary> /// <param name="controls">The controls.</param> /// <param name="selection">The selection.</param> public override void SetSelection(System.Web.UI.Control[] controls, string selection) { if (controls.Count() == 1) { AccountPicker accountPicker = controls[0] as AccountPicker; if (accountPicker != null) { string[] selectionAccountGuidValues = selection.Split(','); var accountList = new List <FinancialAccount>(); foreach (string accountGuid in selectionAccountGuidValues) { var account = new FinancialAccountService(new RockContext()).Get(accountGuid.AsGuid()); if (account != null) { accountList.Add(account); } } accountPicker.SetValues(accountList); } } }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = filterControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Accounts"; filterControl.Controls.Add(accountPicker); DateRangePicker dateRangePicker = new DateRangePicker(); dateRangePicker.ID = filterControl.ID + "_2"; dateRangePicker.Label = "Date Range"; dateRangePicker.Required = true; filterControl.Controls.Add(dateRangePicker); var controls = new Control[2] { accountPicker, dateRangePicker }; return(controls); }
private void Page_Loaded(object sender, RoutedEventArgs e) { AccountPicker.RefreshProfileContextMenuItems(); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { var comparisonControl = ComparisonHelper.ComparisonControl(ComparisonType.LessThan | ComparisonType.GreaterThanOrEqualTo | ComparisonType.EqualTo); comparisonControl.ID = filterControl.ID + "_comparisonControl"; filterControl.Controls.Add(comparisonControl); var globalAttributes = GlobalAttributesCache.Get(); CurrencyBox numberBoxAmount = new CurrencyBox(); numberBoxAmount.ID = filterControl.ID + "_numberBoxAmount"; numberBoxAmount.Label = "Amount"; filterControl.Controls.Add(numberBoxAmount); AccountPicker accountPicker = new AccountPicker(); accountPicker.AllowMultiSelect = true; accountPicker.ID = filterControl.ID + "_accountPicker"; accountPicker.AddCssClass("js-account-picker"); accountPicker.Label = "Accounts"; filterControl.Controls.Add(accountPicker); RockCheckBox cbIncludeChildAccounts = new RockCheckBox(); cbIncludeChildAccounts.ID = filterControl.ID + "_cbIncludeChildAccounts"; cbIncludeChildAccounts.Text = "Include Child Accounts"; cbIncludeChildAccounts.CssClass = "js-include-child-accounts"; filterControl.Controls.Add(cbIncludeChildAccounts); RockCheckBox cbIgnoreInactiveAccounts = new RockCheckBox(); cbIgnoreInactiveAccounts.ID = filterControl.ID + "_cbIgnoreInactiveAccounts"; cbIgnoreInactiveAccounts.Text = "Ignore Inactive Accounts"; cbIgnoreInactiveAccounts.CssClass = "js-ignore-inactive-accounts"; filterControl.Controls.Add(cbIgnoreInactiveAccounts); SlidingDateRangePicker slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.Help = "The date range of the transactions using the transaction date of each transaction"; slidingDateRangePicker.Required = true; filterControl.Controls.Add(slidingDateRangePicker); RockCheckBox cbCombineGiving = new RockCheckBox(); cbCombineGiving.ID = filterControl.ID + "_cbCombineGiving"; cbCombineGiving.Label = "Combine Giving"; cbCombineGiving.CssClass = "js-combine-giving"; cbCombineGiving.Help = "Combine individuals in the same giving group when calculating totals and reporting the list of individuals."; filterControl.Controls.Add(cbCombineGiving); RockCheckBox cbUseAnalytics = new RockCheckBox(); cbUseAnalytics.ID = filterControl.ID + "_cbUseAnalytics"; cbUseAnalytics.Label = "Use Analytics Models"; cbUseAnalytics.CssClass = "js-use-analytics"; cbUseAnalytics.Help = "Using Analytics Data might be faster than querying real-time data, but it may not include data that has been added or updated in the last 24 hours."; filterControl.Controls.Add(cbUseAnalytics); var controls = new Control[8] { comparisonControl, numberBoxAmount, accountPicker, cbIncludeChildAccounts, cbIgnoreInactiveAccounts, slidingDateRangePicker, cbCombineGiving, cbUseAnalytics }; // set an initial config for the selection var selectionConfig = new SelectionConfig { ComparisonType = ComparisonType.GreaterThanOrEqualTo }; SetSelection(entityType, controls, selectionConfig.ToJson()); return(controls); }
private void Page_Initialized(object sender, EventArgs e) { AccountPicker.RefreshProfileContextMenuItems(); }