private void butDelete_Click(object sender, EventArgs e)
 {
     try{
         Reconciles.Delete(ReconcileCur);
         DialogResult = DialogResult.OK;
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
     }
 }
 ///<summary>Called from FormTransactionEdit.</summary>
 public static DateTime GetReconcileDate(ArrayList journalList)
 {
     for (int i = 0; i < journalList.Count; i++)
     {
         if (((JournalEntry)journalList[i]).ReconcileNum != 0)
         {
             return(Reconciles.GetOne(((JournalEntry)journalList[i]).ReconcileNum).DateReconcile);
         }
     }
     return(DateTime.MinValue);
 }
 private void FormReconcileEdit_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
     {
         return;
     }
     if (IsNew)
     {
         for (int i = 0; i < JournalList.Length; i++)
         {
             JournalList[i].ReconcileNum = 0;
         }
         SaveList();                //detaches all journal entries.
         Reconciles.Delete(ReconcileCur);
     }
 }
Beispiel #4
0
        ///<summary></summary>
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Reconcile rec = new Reconcile();

            rec.DateReconcile = DateTimeOD.Today;
            rec.AccountNum    = AccountNum;
            Reconciles.Insert(rec);
            FormReconcileEdit FormR = new FormReconcileEdit(rec);

            FormR.IsNew = true;
            FormR.ShowDialog();
            if (FormR.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrid();
        }
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDate.errorProvider1.GetError(textDate) != "" ||
         textStart.errorProvider1.GetError(textStart) != "" ||
         textEnd.errorProvider1.GetError(textEnd) != ""
         )
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     ReconcileCur.DateReconcile = PIn.PDate(textDate.Text);
     ReconcileCur.StartingBal   = PIn.PDouble(textStart.Text);
     ReconcileCur.EndingBal     = PIn.PDouble(textEnd.Text);
     ReconcileCur.IsLocked      = checkLocked.Checked;
     Reconciles.Update(ReconcileCur);
     SaveList();
     DialogResult = DialogResult.OK;
 }
        private void FormJournalEntryEdit_Load(object sender, System.EventArgs e)
        {
            if (EntryCur == null)
            {
                MessageBox.Show("Entry cannot be null.");
            }
            AccountPicked = Accounts.GetAccount(EntryCur.AccountNum);          //might be null

            /*
             * for(int i=0;i<Accounts.ListShort.Length;i++) {
             *      comboAccount.Items.Add(Accounts.ListShort[i].Description);
             *      if(Accounts.ListShort[i].AccountNum==EntryCur.AccountNum){
             *              comboAccount.SelectedIndex=i;
             *      }
             * }
             * if(EntryCur.AccountNum !=0 && comboAccount.SelectedIndex==-1){//must be an inactive account
             *
             * }*/
            FillAccount();
            if (EntryCur.DebitAmt > 0)
            {
                textDebit.Text = EntryCur.DebitAmt.ToString("n");
            }
            if (EntryCur.CreditAmt > 0)
            {
                textCredit.Text = EntryCur.CreditAmt.ToString("n");
            }
            textMemo.Text        = EntryCur.Memo;
            textCheckNumber.Text = EntryCur.CheckNumber;
            if (EntryCur.ReconcileNum == 0)          //not attached
            {
                labelReconcile.Visible = false;
                textReconcile.Visible  = false;
            }
            else             //attached
            {
                textReconcile.Text  = Reconciles.GetOne(EntryCur.ReconcileNum).DateReconcile.ToShortDateString();
                textDebit.ReadOnly  = true;
                textCredit.ReadOnly = true;
                butDelete.Enabled   = false;
                butChange.Enabled   = false;
            }
        }
Beispiel #7
0
        private void FillGrid()
        {
            RList = Reconciles.GetList(AccountNum);
            grid.BeginUpdate();
            grid.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableReconciles", "Date"), 80);

            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableReconciles", "Ending Bal"), 100, HorizontalAlignment.Right);
            grid.Columns.Add(col);
            grid.Rows.Clear();
            OpenDental.UI.ODGridRow row;
            for (int i = 0; i < RList.Length; i++)
            {
                row = new OpenDental.UI.ODGridRow();
                row.Cells.Add(RList[i].DateReconcile.ToShortDateString());
                row.Cells.Add(RList[i].EndingBal.ToString("F"));
                grid.Rows.Add(row);
            }
            grid.EndUpdate();
        }