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

            return(item.PricePerPerson.FormattedValue);
        }
Exemple #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;
        }
        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);
            }
        }
Exemple #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);
            }
        }
Exemple #5
0
        string DescriptionConverter(Object value)
        {
            Entities.TourReceiptItem item =
                (Entities.TourReceiptItem)value;

            if (item.ParentIndex < 0)
            {
                return(item.Description);
            }
            else
            {
                return("    " + item.Description);
            }
        }
        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);
        }
Exemple #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;
            }
        }