public AccountEditForm(bool isDebit, MoneyDataSet.AccountTypesRow accountType = null, MoneyDataSet.AccountsRow account = null)
 {
     InitializeComponent();
     this.keeper      = MoneyDataKeeper.Instance;
     this.isDebit     = isDebit;
     this.accountType = accountType;
     this.account     = account;
 }
 public AccountEditForm(bool isDebit, MoneyDataSet.AccountTypesRow accountType = null, MoneyDataSet.AccountsRow account = null)
 {
     InitializeComponent();
     this.keeper = MoneyDataKeeper.Instance;
     this.isDebit = isDebit;
     this.accountType = accountType;
     this.account = account;
 }
        private void openAccountType(MoneyDataSet.AccountTypesRow accountType)
        {
            AccountTypeForm form = new AccountTypeForm(accountType);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                fillAccountTypes();
            }
        }
Exemple #4
0
 public ImportedRecord(DateTime date, MoneyDataSet.TransactionTemplatesRow template, String title,
                       Double amount, MoneyDataSet.AccountTypesRow accountType, String tags)
 {
     Date        = date;
     Template    = template;
     Title       = title;
     Amount      = amount;
     AccountType = accountType;
     Tags        = tags;
 }
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (existingItem != null)
            {
                if (existingItem.ID.StartsWith(Consts.Keeper.UserMetadataPrefix))
                {
                    existingItem.Title       = tbTitle.Text.Trim();
                    existingItem.Description = tbDescription.Text.Trim();
                    existingItem.IsDebit     = cbIsDebit.Checked;
                }
                existingItem.SortOrder = (int)numSortOrder.Value;
            }
            else
            {
                String ID = tbID.Text.Trim().ToUpper();
                if (keeper.DataSet.AccountTypes.FindByID(ID) != null)
                {
                    MessageBox.Show(String.Format(Resources.Labels.RecordExistFormat, ID),
                                    Resources.Labels.ErrorSavingTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (!ID.StartsWith(Consts.Keeper.UserMetadataPrefix))
                {
                    MessageBox.Show(String.Format(Resources.Labels.UserIDShouldHavePrefixFormat, Consts.Keeper.UserMetadataPrefix),
                                    Resources.Labels.ErrorSavingTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                MoneyDataSet.AccountTypesRow accountType = keeper.DataSet.AccountTypes.NewAccountTypesRow();
                accountType.ID          = ID;
                accountType.Title       = tbTitle.Text.Trim();
                accountType.Description = tbDescription.Text.Trim();
                accountType.SortOrder   = (int)numSortOrder.Value;
                accountType.IsDebit     = cbIsDebit.Checked;
                keeper.DataSet.AccountTypes.AddAccountTypesRow(accountType);
            }
            keeper.DataSet.AcceptChanges();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 public AccountTypeForm(MoneyDataSet.AccountTypesRow existingItem)
 {
     InitializeComponent();
     this.keeper = MoneyDataKeeper.Instance;
     this.existingItem = existingItem;
 }
 public AccountTypeForm(MoneyDataSet.AccountTypesRow existingItem)
 {
     InitializeComponent();
     this.keeper       = MoneyDataKeeper.Instance;
     this.existingItem = existingItem;
 }