private void SetDefaults()
        {
            FundCollection funds = new FundCollection(CurrentOrganization.OrganizationID);

            ddlFund.DataSource     = funds;
            ddlFund.DataTextField  = "FundName";
            ddlFund.DataValueField = "FundId";
            ddlFund.DataBind();
            ddlFund.Items.Insert(0, new ListItem("", "-1"));

            tbName.Focus();

            btnUpdate.Enabled = _editEnabled;

            if (_pledgeId != -1)
            {
                Pledge pledge = new Pledge(_pledgeId);
                if (pledge.PledgeId != -1)
                {
                    ddlFund.SelectedValue     = pledge.FundId.ToString();
                    dtbStartDate.SelectedDate = pledge.PledgeBeginDate;
                    dtbEndDate.SelectedDate   = pledge.PledgeEndDate;
                    lblUpdated.Text           = string.Format("Added {0:c} pledge to the {1} fund for {2}", pledge.Amount, pledge.Fund.FundName, Utilities.PersonLink(pledge.Person, Convert.ToInt32(PersonDetailPageSetting)));
                }
            }

            HyperLinkColumn hpl = (HyperLinkColumn)dgPeople.Columns[2];

            hpl.DataNavigateUrlFormatString = "~/default.aspx?page=" + PersonDetailPageSetting + "&guid={0}";
        }
示例#2
0
        /// <summary>
        /// Runs upon page load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            _editEnabled = CurrentModule.Permissions.Allowed(Arena.Security.OperationType.Edit, CurrentUser);
            _pledgeId    = !string.IsNullOrEmpty(Request.QueryString["pledge"]) ? Convert.ToInt32(Request.QueryString["pledge"]) : -1;

            // Put a bit of space at the top of the <asp:Panel ID="DataPanel"> control
            DataPanel.Attributes.Add("style", "margin-top:1em;");

            // Add onfocus event to tbFrequencyCount that calculates totals
            tbFrequencyCount.Attributes.Add("onfocus", "getTimeSpans()");

            // If not postback, set up form
            if (!Page.IsPostBack)
            {
                // Construct a fund collection to populate the fund drop down list
                FundCollection funds = new FundCollection(CurrentOrganization.OrganizationID);
                ddlFund.DataSource     = funds;
                ddlFund.DataTextField  = "FundName";
                ddlFund.DataValueField = "FundId";
                ddlFund.DataBind();
                ddlFund.Items.Insert(0, new ListItem("", "-1"));

                // Set the selected fund to the defined module setting
                ddlFund.SelectedValue = DefaultFundSetting;

                // Construct campus drop down list from Arena lookup type 102, which is campus designations
                LookupCollection campuses = new LookupCollection(102);

                // Bind campus lookup key / values pairs to dropdown datasource
                ddlCampus.DataSource     = campuses;
                ddlCampus.DataValueField = "LookupID";
                ddlCampus.DataTextField  = "Value";
                ddlCampus.DataBind();
                ddlCampus.Items.Insert(0, new ListItem("", "-1"));

                // Bind frequency dictionary to frequency dropdown datasource.
                rblPledgeFrequency.DataSource     = PledgeFrequency.FrequencyNames;
                rblPledgeFrequency.DataValueField = "Key";
                rblPledgeFrequency.DataTextField  = "Value";
                rblPledgeFrequency.DataBind();
                rblPledgeFrequency.SelectedIndex = 2;

                foreach (ListItem li in rblPledgeFrequency.Items)
                {
                    //if( "RadioButton".Equals(ctrl.GetType().ToString() ) )
                    //    ((RadioButton)ctrl).Attributes["onfocus"] = "getTimeSpans()";
                    li.Attributes["onfocus"] = "getTimeSpans()";
                }

                // Initially set focus on name text box
                tbName.Focus();
            }
        }
示例#3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // get filtered input
            try
            {
                if (ddFundList.Items.Count != 0)
                {
                    fundId = Int32.Parse(ddFundList.SelectedValue);
                }

                if (tbFilterMinPledge.Text.Trim().Length != 0)
                {
                    minPledgeAmount = Convert.ToDouble(tbFilterMinPledge.Text);
                }

                if (tbFilterMaxPledge.Text.Trim().Length != 0)
                {
                    maxPledgeAmount = Convert.ToDouble(tbFilterMaxPledge.Text);
                }

                if (tbFilterMinPercent.Text.Trim().Length != 0)
                {
                    minPledgeComplete = Convert.ToDouble(tbFilterMinPercent.Text) / 100;
                }

                if (tbFilterMaxPercent.Text.Trim().Length != 0)
                {
                    maxPledgeComplete = Convert.ToDouble(tbFilterMaxPercent.Text) / 100;
                }

                includeNoPledge = cbIncludeNoPledge.Checked;
            }
            catch
            { }

            if (!Page.IsPostBack)
            {
                // load funds
                FundCollection funds = new FundCollection(CurrentOrganization.OrganizationID);
                foreach (Fund fund in funds)
                {
                    if (fund.Active)
                    {
                        ddFundList.Items.Add(new ListItem(fund.FundName, fund.FundId.ToString()));
                    }
                }
            }
        }
        private CheckBox newFundClassCheckbox(FundCollection fundCollection, Fund fund)
        {
            var cbox = new CheckBox()
            {
                Text = fund.ClassDescription, AutoPostBack = true, Width = 170
            };

            cbox.Attributes.Add("fundName", fund.FundName);
            cbox.Attributes.Add("masterFund", fundCollection.Name);
            cbox.Attributes.Add("isin", fund.ISIN);
            cbox.CheckedChanged += fundClassCheckbox_CheckChanged;

            _fundClasses.Add(fund.ISIN, cbox);

            return(cbox);
        }
        private CheckBox newMasterFundCheckbox(FundCollection fundCollection)
        {
            var cbox = new CheckBox()
            {
                Text = fundCollection.Name, AutoPostBack = true
            };

            // name of master fund
            cbox.Attributes.Add("fundName", fundCollection.Name);

            // related fund classes: csv list, eg "A,B,C"
            // from this, note _fundClasses["A"] gives the cbox representing fundClass A
            string relatedFundClasses = string.Join(",", fundCollection.Funds.Select(f => f.ISIN));

            cbox.Attributes.Add("relatedClasses", relatedFundClasses);

            cbox.CheckedChanged += masterFundCheckbox_CheckChanged;
            _masterFunds.Add(fundCollection.Name, cbox);

            return(cbox);
        }
示例#6
0
        public void ShowList()
        {
            bool EditEnabled = CurrentModule.Permissions.Allowed(OperationType.Edit, CurrentUser);

            // Set up the dgPledges DataGrid
            dgPledges.ItemType           = "Pledge";
            dgPledges.ItemBgColor        = CurrentPortalPage.Setting("ItemBgColor", string.Empty, false);
            dgPledges.ItemAltBgColor     = CurrentPortalPage.Setting("ItemAltBgColor", string.Empty, false);
            dgPledges.ItemMouseOverColor = CurrentPortalPage.Setting("ItemMouseOverColor", string.Empty, false);
            dgPledges.AddEnabled         = false;
            dgPledges.DeleteEnabled      = EditEnabled;
            dgPledges.EditEnabled        = EditEnabled;
            dgPledges.MergeEnabled       = false;
            dgPledges.MailEnabled        = false;
            dgPledges.ExportEnabled      = true;

            dgPledges.DataSource = new DataLayer.PledgeData().GetPledgeListByPersonID_DT(person.PersonID);
            dgPledges.DataBind();

            if (EditEnabled)
            {
                pnlAdd.Visible = true;
                FundCollection funds = new FundCollection(CurrentOrganization.OrganizationID, _useShelby);

                ddlFunds.Items.Clear();
                foreach (Fund fund in funds)
                {
                    if (fund.Active && fund.CanPledge)
                    {
                        ddlFunds.Items.Add(new ListItem(fund.FundName, fund.FundId.ToString()));
                    }
                }
            }
            else
            {
                pnlAdd.Visible = false;
            }
        }
 public ListBoxViewModel()
 {
     this.funds = new FundCollection();
     this.pinCommand = new AsyncDelegateCommand(this.Pin);
 }
 public ExpanderMenuViewModel()
 {
     this.funds = new FundCollection();
 }
示例#9
0
 public InputViewModel()
 {
     this.funds = new FundCollection();
     this.showMessageBoxCommand = new AsyncDelegateCommand <string>(this.ShowMessageBox);
 }
 public ExpanderMenuViewModel()
 {
     this.funds = new FundCollection();
 }
 public DragAndDropViewModel()
 {
     this.funds = new FundCollection();
     this.showMessageBoxCommand = new AsyncDelegateCommand<string>(this.ShowMessageBox);
 }
 public DataGridViewModel()
 {
     this.funds = new FundCollection(true);
     this.fundsView = CollectionViewSource.GetDefaultView(this.funds);
 }
示例#13
0
 public ListBoxViewModel()
 {
     this.funds      = new FundCollection();
     this.pinCommand = new AsyncDelegateCommand(this.Pin);
 }
示例#14
0
 public DataGridViewModel()
 {
     this.funds     = new FundCollection(true);
     this.fundsView = CollectionViewSource.GetDefaultView(this.funds);
 }