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

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

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