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;
                    }
                }
            }
        }
예제 #2
0
        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());
            }
        }
예제 #3
0
        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 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());
            }
        }