Esempio n. 1
0
        private decimal GetDecimalColumn(string name)
        {
            TransactionViewColumn col = view.GetColumn(name);
            string  s = col.GetValue(item);
            decimal d;

            decimal.TryParse(s, out d);
            return(d);
        }
Esempio n. 2
0
 internal void SetAmount(decimal amount)
 {
     if (amount < 0)
     {
         TransactionViewColumn col = view.GetColumn("Payment");
         amount *= -1;
         col.SetValue(item, amount == 0 ? "" : amount.ToString());
     }
     else
     {
         TransactionViewColumn col = view.GetColumn("Deposit");
         col.SetValue(item, amount == 0 ? "" : amount.ToString());
     }
 }
Esempio n. 3
0
        internal void SortBy(TransactionViewColumn column)
        {
            AutomationElement header = control.FindFirstWithRetries(TreeScope.Descendants, new AndCondition(
                                                                        new PropertyCondition(AutomationElement.ClassNameProperty, "DataGridColumnHeader"),
                                                                        new PropertyCondition(AutomationElement.NameProperty, column.Header)));

            if (header != null)
            {
                InvokePattern p = (InvokePattern)header.GetCurrentPattern(InvokePattern.Pattern);
                p.Invoke();
            }
            else
            {
                Debug.WriteLine("Could not find header for column: " + column.Name);
            }
        }
Esempio n. 4
0
        internal decimal GetAmount()
        {
            int sign = 1;
            TransactionViewColumn col = view.GetColumn("Deposit");
            string s = col.GetValue(item);

            if (string.IsNullOrEmpty(s))
            {
                sign = -1;
                col  = view.GetColumn("Payment");
                s    = col.GetValue(item);
            }
            decimal p = 0;

            decimal.TryParse(s, out p);
            return(p * sign);
        }
Esempio n. 5
0
 public TransactionViewColumn GetColumn(string name)
 {
     foreach (TransactionViewColumn tc in columns)
     {
         CompoundTransactionViewColumn cc = tc as CompoundTransactionViewColumn;
         if (cc != null)
         {
             TransactionViewColumn inner = cc.GetColumn(name);
             if (inner != null)
             {
                 return(inner);
             }
         }
         else if (tc.Name == name)
         {
             return(tc);
         }
     }
     throw new Exception("Column of name '" + name + "' not found");
 }
Esempio n. 6
0
        internal AttachmentDialogWrapper ClickAttachmentsButton()
        {
            ScrollIntoView();

            // AutomationId:	"CommandScanAttachment"
            try
            {
                TransactionViewColumn col = view.GetColumn("Attachment");
                col.Invoke(item);
            }
            catch (Exception ex)
            {
                throw new Exception("Cannot find the Attachment column: " + ex.Message);
            }

            AutomationElement dialog = view.Window.FindChildWindow("Attachments", 5);

            if (dialog == null)
            {
                throw new Exception("Cannot find the AttachmentDialog");
            }
            return(new AttachmentDialogWrapper(dialog));
        }
Esempio n. 7
0
        internal void SetSalesTax(decimal tax)
        {
            TransactionViewColumn col = view.GetColumn("SalesTax");

            col.SetValue(item, tax == 0 ? "" : tax.ToString());
        }
Esempio n. 8
0
        internal void SetUnitPrice(decimal price)
        {
            TransactionViewColumn col = view.GetColumn("UnitPrice");

            col.SetValue(item, price == 0 ? "" : price.ToString());
        }
Esempio n. 9
0
        internal void SetSecurity(string security)
        {
            TransactionViewColumn col = view.GetColumn("Security");

            col.SetValue(item, security);
        }
Esempio n. 10
0
        internal string GetCategory()
        {
            TransactionViewColumn col = view.GetColumn("Category");

            return(col.GetValue(item));
        }
Esempio n. 11
0
        internal void SetPayee(string payee)
        {
            TransactionViewColumn col = view.GetColumn("Payee");

            col.SetValue(item, payee);
        }
Esempio n. 12
0
        internal string GetPayee()
        {
            TransactionViewColumn col = view.GetColumn("Payee");

            return(col.GetValue(item));
        }
Esempio n. 13
0
        internal void SetDate(string dateTime)
        {
            TransactionViewColumn col = view.GetColumn("Date");

            col.SetValue(item, dateTime);
        }
Esempio n. 14
0
        internal void SetCheckNumber(string num)
        {
            TransactionViewColumn col = view.GetColumn("Number");

            col.SetValue(item, num);
        }
Esempio n. 15
0
        internal string GetCheckNumber()
        {
            TransactionViewColumn col = view.GetColumn("Number");

            return(col.GetValue(item));
        }
Esempio n. 16
0
        internal void SetActivity(string activity)
        {
            TransactionViewColumn col = view.GetColumn("Activity");

            col.SetValue(item, activity);
        }
Esempio n. 17
0
        internal string GetSecurity()
        {
            TransactionViewColumn col = view.GetColumn("Security");

            return(col.GetValue(item));
        }
Esempio n. 18
0
        internal void SetCategory(string category)
        {
            TransactionViewColumn col = view.GetColumn("Category");

            col.SetValue(item, category);
        }
Esempio n. 19
0
        internal void SetUnits(decimal units)
        {
            TransactionViewColumn col = view.GetColumn("Units");

            col.SetValue(item, units == 0 ? "" : units.ToString());
        }
Esempio n. 20
0
        internal string GetMemo()
        {
            TransactionViewColumn col = view.GetColumn("Memo");

            return(col.GetValue(item));
        }
Esempio n. 21
0
        internal void Focus()
        {
            TransactionViewColumn col = view.GetColumn("Payee");

            col.Focus(this.item);
        }
Esempio n. 22
0
        internal void SetMemo(string memo)
        {
            TransactionViewColumn col = view.GetColumn("Memo");

            col.SetValue(item, memo);
        }