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; } } } }
protected void MaterialGroupRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { MaterialGroup current = e.Item.DataItem as MaterialGroup; if (current != null) { e.SetHyperLink("EditLink", PageUrlAttribute.Get <MaterialGroups.Edit>(new MaterialGroups.Edit.Query() { MaterialGroup = current })); e.SetLabel("NameLabel", current.Name); e.SetButton("DeleteButton", current.Id.ToString()); } }
protected void SuppliersRepeater_DataItemBound(object sender, RepeaterItemEventArgs e) { Supplier current = e.Item.DataItem as Supplier; if (current != null) { e.SetHyperLink("EditButton", PageUrlAttribute.Get <Suppliers.Edit>(new Suppliers.Edit.Query() { Supplier = current })); e.SetLabel("NameLabel", current.Name); e.SetLabel("EmailAddressLabel", current.EmailAddress); e.SetButton("DeleteButton", current.Id.ToString()); } }
protected void OrderRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { Order current = e.Item.DataItem as Order; if (current != null) { String editUrl = PageUrlAttribute.Get <Orders.Edit>(new Orders.Edit.Query() { Order = current }); e.SetHyperLink("OrderDateLink", current.OrderDate.ToShortDateString(), editUrl); e.SetLabel("AmountLabel", current.Amount.ToString("0.0")); e.SetLabel("PriceEachForeignLabel", current.Price.ToString("0.00")); e.SetLabel("CurrencyForeignLabel", current.Currency); e.SetLabel("ExchangeRatioLabel", current.ExchangeRate.ToString("0.0")); e.SetLabel("PriceEachInEuroLabel", current.PriceInEuro.ToString("C")); e.SetLabel("ArrivalDateLink", current.ArrivalDate.HasValue ? current.ArrivalDate.Value.ToShortDateString() : String.Empty); } }
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 ArticlesQARepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { ArticleQA current = e.Item.DataItem as ArticleQA; if (current != null) { e.SetHyperLink( "EditLink", PageUrlAttribute.Get <Articles.EditQA>(new Articles.EditQA.Query() { Article = current.Article, ArticleQA = current, SearchTerm = this.RequestAddOn.Query.SearchTerm })); e.SetLabel("QuestionLabel", current.Question); e.SetLabel("AnswerLabel", current.Answer); e.SetButton("DeleteArticleQAButton", current.Id.ToString()); } }
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")); } }