Example #1
0
        string UnitPriceConverter(Object value)
        {
            Entities.TourReceiptItem item =
                (Entities.TourReceiptItem)value;

            return(item.PricePerPerson.FormattedValue);
        }
Example #2
0
        internal void CopyTo(TourReceiptItem item)
        {
            item.Description = this.Description;
            item.Quantity    = this.Quantity;
            item.Id          = this.Id;
            this.PricePerPerson.CopyTo(item.PricePerPerson);

            item.IsDirty = this.IsDirty;
        }
Example #3
0
        internal void CopyTo(TourReceipt tourReceipt)
        {
            this.total.CopyTo(tourReceipt.Total);

            tourReceipt.Items.Clear();
            foreach (TourReceiptItem item in this.items)
            {
                TourReceiptItem newitem = new TourReceiptItem();
                item.CopyTo(newitem);

                tourReceipt.Items.Add(newitem);
            }
        }
Example #4
0
        string TotalConverter(Object value)
        {
            Entities.TourReceiptItem item =
                (Entities.TourReceiptItem)value;

            if (item.Total.Value > 0)
            {
                return("+" + item.Total.FormattedValue);
            }
            else
            {
                return(item.Total.FormattedValue);
            }
        }
Example #5
0
        string DescriptionConverter(Object value)
        {
            Entities.TourReceiptItem item =
                (Entities.TourReceiptItem)value;

            if (item.ParentIndex < 0)
            {
                return(item.Description);
            }
            else
            {
                return("    " + item.Description);
            }
        }
Example #6
0
        public bool Delete(TourReceiptItem item)
        {
            bool res = true;

            if (this.items.Contains(item))
            {
                res = this.items.Remove(item);
            }
            else
            {
            }

            if (res && !this.deletedItems.Contains(item) && item.Id > 0)
            {
                this.deletedItems.Add(item);
            }

            return(res);
        }
Example #7
0
        void ListRowFormatter(OLVListItem olvItem)
        {
            if (olvItem == null || olvItem.RowObject == null)
            {
                return;
            }

            Entities.TourReceiptItem item =
                (Entities.TourReceiptItem)olvItem.RowObject;

            if (item.IsCustom)
            {
                olvItem.BackColor = Color.White;
            }
            else
            {
                olvItem.BackColor = Color.Ivory;
            }

            if (item.ParentIndex < 0)
            {
                olvItem.BackColor = Color.PapayaWhip;
            }/*
              * else
              * {
              * olvItem.BackColor = Color.White;
              * }
              */

            if (item.Total.Value < 0)
            {
                olvItem.ForeColor = Color.DarkGreen;
            }
            else if (item.Total.Value == 0)
            {
                olvItem.ForeColor = Color.Gray;
            }
            else
            {
                olvItem.ForeColor = Color.Black;
            }
        }