protected void SaleItemRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            SaleItem current = e.Item.DataItem as SaleItem;

            if (current != null)
            {
                e.SetHyperLink("EditLink", PageUrlAttribute.Get <Sales.Items.Edit>(new Sales.Items.Edit.Query()
                {
                    SaleItem   = current,
                    SearchTerm = this.RequestAddOn.Query.SearchTerm
                }));
                e.SetImage("ArticleImage", current.Article == null ? String.Empty : current.Article.GetPictureUrl(0));
                e.SetLabel("ProtocoleNumberLabel", current.ProtocoleNumber).Font.Strikeout = current.IsCanceled;
                e.SetLabel("AmountLabel", current.Amount.ToString("0.0"));
                e.SetLabel("ExternalArticleNumberLabel", current.ExternalArticleNumber);
                e.SetHyperLink("ExternalArticleNameLink", current.ExternalArticleName, PageUrlAttribute.Get <Articles.Default>(new Articles.Default.Query()
                {
                    SearchTerm = current.InternalArticleNumber
                }));
                e.SetLabel("SinglePriceLabel", current.SinglePriceGross.ToString("C"));
                e.SetLabel("TotalPriceLabel", current.TotalPriceGross.ToString("C"));
                e.SetButton("ToggleCancelButton", current.Id.ToString());

                if (current.IsCanceled)
                {
                    TableRow row = e.Item.FindControl("CurrentRow") as TableRow;
                    foreach (TableCell cell in row.Cells)
                    {
                        cell.Font.Strikeout = true;
                    }
                }
            }
        }
Beispiel #2
0
        protected void SaleItemRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var current = e.Item.DataItem as IGrouping <Article, SaleItem>;

            if (current != null)
            {
                e.SetImage("MyPicture", current.Key.PictureName1, current.Key.GetPictureUrl(0));
                e.SetLabel("AmountLabel", current.Sum(x => x.Amount).ToString("0.0"));
                e.SetLabel("ExternalArticleNumberLabel", current.First().ExternalArticleNumber);
                e.SetLabel("ExternalArticleNameLabel", current.First().ExternalArticleName);
                e.SetLabel("SinglePriceLabel", current.First().SinglePriceGross.ToString("C"));
            }
        }
Beispiel #3
0
        protected void SaleItemRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var current = e.Item.DataItem as IGrouping <Article, SaleItem>;

            if (current.Key != null)
            {
                e.SetImage("MyPicture", current.Key.PictureName1, current.Key.GetPictureUrl(0));
            }

            e.SetLabel("AmountLabel", current.Sum(x => x.Amount).ToString("0.0"));
            e.SetLabel("ExternalArticleNumberLabel", current.First().ExternalArticleNumber);
            e.SetHyperLink(
                "ExternalArticleNameLabel",
                current.First().ExternalArticleName,
                PageUrlAttribute.Get <Articles.Details>(new Articles.Details.Query()
            {
                Article = current.Key
            }));
            e.SetLabel("SinglePriceLabel", current.First().SinglePriceGross.ToString("C"));
        }
        protected void InvoiceItemRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            InvoiceItem current = e.Item.DataItem as InvoiceItem;

            if (current != null)
            {
                if (current.GetArticle() != null)
                {
                    e.SetImage("MyPicture", current.GetArticle().PictureName1, current.GetArticle().GetPictureUrl(0));
                }

                e.SetLabel("AmountLabel", current.Amount.ToString("0.0"));
                e.SetLabel("ArticleNumberLabel", current.ArticleNumber);
                e.SetHyperLink("ArticleLink", current.ArticleName, PageUrlAttribute.Get <Articles.Default>(new Articles.Default.Query()
                {
                    SearchTerm = current.StockNumber
                }));
                e.SetLabel("PriceNetSingleLabel", current.SinglePriceNet.ToString("C"));
                e.SetLabel("SalesTaxSingleLabel", current.SingleSalesTax.ToString("C"));
                e.SetLabel("PriceGrossLabel", current.SinglePriceGross.ToString("C"));
                e.SetLabel("PriceGrossTotalLabel", current.TotalPriceGross.ToString("C"));
            }
        }