Example #1
0
        protected void rpterPriceLists_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PriceList p = (e.Item.DataItem as PriceList);

                HyperLink hl = (e.Item.FindControl("lnkGo") as HyperLink);
                hl.NavigateUrl = "/pricelists/view/default.aspx?Id=" + p.ID;
                hl.Text        = p.Name;
                hl.ToolTip     = string.Format("Ingresar a la Lista de Precios {0}", p.Name);

                (e.Item.FindControl("litDiscount") as Literal).Text = StringFormat.FormatPercentage(p.Discount);
                (e.Item.FindControl("litCountry") as Literal).Text  = (p.PriceGroup != null) ? p.PriceGroup.Name : "N/D";

                (e.Item.FindControl("litDescription") as Literal).Text = StringFormat.FormatHasValue(p.Description);
                (e.Item.FindControl("litIncoterm") as Literal).Text    = (p.SaleCondition != null) ?  p.SaleCondition.Description : "N/D";
                (e.Item.FindControl("litStatus") as Literal).Text      = Resource.Business.GetString(p.PriceListStatus.ToString());
                if (p.CurrentState != null && p.CurrentState.LastPublishedOn != null)
                {
                    (e.Item.FindControl("litLastPublish") as Literal).Text = p.CurrentState.LastPublishedOn.Value.ToShortDateString();
                }
                else
                {
                    (e.Item.FindControl("litLastPublish") as Literal).Text = "N/D";
                }
            }
        }
Example #2
0
        protected void rpterCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                CategoryBase f = (e.Item.DataItem as CategoryBase);

                HyperLink hl = (e.Item.FindControl("lnkGo") as HyperLink);
                if (f != null)
                {
                    hl.NavigateUrl = "/categorys/view/default.aspx?Id=" + f.ID;
                    hl.Text        = f.Name;
                    hl.ToolTip     = string.Format("Ingresar a la categoría {0}", f.Name);

                    (e.Item.FindControl("litDescription") as Literal).Text = StringFormat.FormatHasValue(f.Description);
                    if (f.Parent != null)
                    {
                        (e.Item.FindControl("litParent") as Literal).Text = StringFormat.FormatHasValue(f.Parent.Name);
                    }
                    else
                    {
                        (e.Item.FindControl("litParent") as Literal).Text = "N/D";
                    }
                }
            }
        }
Example #3
0
        protected void rpterQuotes_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Quo q = (e.Item.DataItem as Quo);

                HyperLink hl = (e.Item.FindControl("lnkGo") as HyperLink);
                hl.NavigateUrl = "/quotes/view/default.aspx?Id=" + q.ID;
                hl.Text        = string.Format("[{0}] {1}", q.Number, q.TimeStamp.CreatedOn.ToShortDateString());
                hl.ToolTip     = string.Format("Ingresar a la cotización {0}", q.Description);

                (e.Item.FindControl("litDescription") as Literal).Text  = StringFormat.FormatHasValue(q.Description);
                (e.Item.FindControl("litObservations") as Literal).Text = StringFormat.FormatHasValue(q.Observations);
            }
        }
Example #4
0
        protected void rpterProvider_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Prov p = (e.Item.DataItem as Prov);

                HyperLink hl = (e.Item.FindControl("lnkGo") as HyperLink);
                hl.NavigateUrl = "/providers/view/default.aspx?Id=" + p.ID;
                hl.Text        = p.Name;
                hl.ToolTip     = string.Format("Ingresar al proveedor {0}", p.Name);

                (e.Item.FindControl("litCode") as Literal).Text     = p.Code;
                (e.Item.FindControl("litDiscount") as Literal).Text = StringFormat.FormatPercentage(p.Discount);
                (e.Item.FindControl("litCountry") as Literal).Text  = (p.Country != null) ? p.Country.Name : "N/D";

                (e.Item.FindControl("litPhone") as Literal).Text   = StringFormat.FormatHasValue(p.Telephone);
                (e.Item.FindControl("litFax") as Literal).Text     = StringFormat.FormatHasValue(p.Fax);
                (e.Item.FindControl("litMail") as Literal).Text    = StringFormat.FormatHasValue(p.Email);
                (e.Item.FindControl("litContact") as Literal).Text = StringFormat.FormatHasValue(p.Contact);
                (e.Item.FindControl("litAdress") as Literal).Text  = StringFormat.FormatHasValue(p.Address);
                (e.Item.FindControl("litCity") as Literal).Text    = StringFormat.FormatHasValue(p.City);
            }
        }