Ejemplo n.º 1
0
        /// <summary>
        /// Handles a new <see cref="Views.PayersEdit"/> form being opened from a <see cref="Views.PayerView"/> form
        /// </summary>
        /// <param name="sender">The sender object</param>
        /// <param name="e">Event arguments</param>
        public static void EditPayerClicked(object sender, EventArgs e)
        {
            if (PayersEdit == null)
            {
                PayersEdit             = new PayersEdit();
                PayersEdit.FormClosed += PayerEditViewOnFormClosed;
            }

            var selectedItems = PayerView.PayerListView.SelectedItems;

            if (selectedItems.Count > 0)
            {
                var selectedItem = selectedItems[0];
                var payerId      = Guid.Parse(selectedItem.SubItems[0].Text);
                var payer        = ListAccessHelper.FindPayer(payerId);

                EditedPayer = payer;
            }
            else
            {
                EditedPayer = null;
            }

            PayersEdit.Show(PayerView);
            PayerView.Hide();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles a <see cref="Views.PayersAdd"/> form being opened from a <see cref="Views.PayerView"/> form
        /// </summary>
        /// <param name="sender">The sender object</param>
        /// <param name="e">Event arguments</param>
        public static void AddPayerClicked(object sender, EventArgs e)
        {
            if (PayersAdd == null)
            {
                PayersAdd             = new PayersAdd();
                PayersAdd.FormClosed += PayerAddViewOnFormClosed;
            }

            PayersAdd.Show(PayerView);
            PayerView.Hide();
        }