//Methods
        #region Page_PreRender
        protected void Page_PreRender(object sender, EventArgs e)
        {
            this.CreateNewEntryLink.NavigateUrl = PageUrlAttribute.Get <MailingCosts.EditDpd>(new MailingCosts.EditDpd.Query());

            this.MailingCostRepeater.DataSource = MailingCostsDpd.LoadAll();
            this.MailingCostRepeater.DataBind();
        }
        public static void PrintToPdf(
            PdfDocument document,
            ESolutions.Web.UI.Page parentPage,
            Invoice invoice,
            DocumentTypes documentType,
            Boolean isCopy)
        {
            String url = PageUrlAttribute.GetAbsolute <Invoices.Print>(parentPage, new Invoices.Print.Query()
            {
                Invoice      = invoice,
                DocumentType = documentType,
                IsCopy       = isCopy
            });

            HtmlToPdf.Options.PageSize   = EO.Pdf.PdfPageSizes.A4;
            HtmlToPdf.Options.OutputArea = new RectangleF(0.0f, 0.0f, HtmlToPdf.Options.PageSize.Width, HtmlToPdf.Options.PageSize.Height);
            HtmlToPdf.Options.UserName   = ShopperConfiguration.Default.Printing.User;
            HtmlToPdf.Options.Password   = ShopperConfiguration.Default.Printing.Password;
            HtmlToPdf.ConvertUrl(url, document);

            FileInfo invoicePdfFile = invoice.CreateArchiveFileFullname();

#if !DEBUG
            if (!invoicePdfFile.Exists && documentType == DocumentTypes.Invoice)
            {
                invoice.Printed = true;
                MyDataContext.Default.SaveChanges();
                Print.WriteToDisk(document, invoicePdfFile);
            }
#endif
        }
Exemple #3
0
        protected void Page_PreRender(Object sender, EventArgs e)
        {
            Mailing current = this.RequestAddOn.Query.Mailing;

            if (current != null)
            {
                this.MailingTypeList.SelectedIndex      = (Int32)current.ShippingMethod;
                this.MailingCostsSenderTextBox.Text     = current.MailingCostsSender.ToString("C");
                this.MailingCostsRecepientTextBox.Text  = current.MailingCostsRecepient.ToString("C");
                this.TotalPriceTextBox.Text             = current.TotalPriceGross.ToString("C");
                this.RecepientCountryTextBox.Text       = current.RecepientCountry;
                this.RecepientNameTextBox.Text          = current.RecepientName;
                this.RecepientStreet1TextBox.Text       = current.RecepientStreet1;
                this.RecepientStreet2TextBox.Text       = current.RecepientStreet2;
                this.RecepientPostcodeTextBox.Text      = current.RecepientPostcode;
                this.RecepientCityTextBox.Text          = current.RecepientCity;
                this.RecepientCountryList.SelectedValue = current.RecepientCountry;
                this.TrackingNumberTextBox.Text         = current.TrackingNumber;

                this.SaleItemRepeater.DataSource = current.GetAllSaleItemsOfAllSalesGrouped(false);
                this.SaleItemRepeater.DataBind();
            }

            this.BackToListLink.NavigateUrl = PageUrlAttribute.Get <Mailings.Default>(new Mailings.Default.Query()
            {
                SearchTerm = this.RequestAddOn.Query.SearchTerm
            });
        }
Exemple #4
0
        protected void ArticleRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            try
            {
                var ee = new ArticleRepeaterItemEventArgs(e);

                if (ee.Data != null)
                {
                    ee.MaterialGroupLiteral.Text  = ee.Data.Article.MaterialGroup.Name;
                    ee.ArticleNumberLiteral.Text  = ee.Data.Article.ArticleNumber;
                    ee.NameInternLink.Text        = ee.Data.Article.NameIntern;
                    ee.NameInternLink.NavigateUrl = PageUrlAttribute.Get <Articles.Edit>(new Articles.Edit.Query()
                    {
                        Article = ee.Data.Article
                    });
                    ee.AmountMonthLiteral.Text   = ee.Data.AmountMonth.ToString("0");
                    ee.SalesMonthLiteral.Text    = ee.Data.SalesMonth.ToString("C");
                    ee.AmountYearLiteral.Text    = ee.Data.AmountYear.ToString("0");
                    ee.SalesYearLiteral.Text     = ee.Data.SalesYear.ToString("C");
                    ee.StockAmountLiteral.Text   = ee.Data.Article.AmountOnStock.ToString("0");
                    ee.AmountOrderedLiteral.Text = ee.Data.Article.GetAmountOrdered().ToString("0");
                    DateTime?nearestDeliveryDate = ee.Data.Article.GetNearestDeliveryDate();
                    ee.NextDeliveryDateLiteral.Text  = nearestDeliveryDate.HasValue ? nearestDeliveryDate.Value.ToShortDateString() : String.Empty;
                    ee.PercentageLiteral.Text        = ee.Data.GetPercentage().ToString("0 %");
                    ee.MinimumStockLevelLiteral.Text = ee.Data.GetMinimumStockLevel.ToString("0");
                }
            }
            catch (Exception ex)
            {
                this.Master.ShowError(ex);
            }
        }
Exemple #5
0
 protected void Page_PreRender(object sender, EventArgs e)
 {
     this.CreateLink1.NavigateUrl      = PageUrlAttribute.Get <Suppliers.Edit>(new Suppliers.Edit.Query());
     this.CreateLink2.NavigateUrl      = PageUrlAttribute.Get <Suppliers.Edit>(new Suppliers.Edit.Query());
     this.SuppliersRepeater.DataSource = Supplier.LoadAll();
     this.SuppliersRepeater.DataBind();
 }
        //Methods
        #region Page_PreRender
        protected void Page_PreRender(Object sender, EventArgs e)
        {
            Invoice current = this.RequestAddOn.Query.Invoice;

            if (current != null)
            {
                this.RecepientNameLabel.Text        = current.InvoiceName;
                this.RecepientStreet1Label.Text     = current.InvoiceStreet1;
                this.RecepientStreet2Label.Text     = current.InvoiceStreet2;
                this.RecepientCountryLabel.Text     = current.InvoiceCountry;
                this.RecepientPostcodeLabel.Text    = current.InvoicePostcode;
                this.RecepientCityLabel.Text        = current.InvoiceCity;
                this.RecepientEmailLabel.Text       = current.EmailAddress;
                this.RecepientPhoneLabel.Text       = current.InvoicePhone;
                this.InvoiceNumberLabel.Text        = current.InvoiceNumber;
                this.InvoiceDateLabel.Text          = current.InvoiceDate.ToShortDateString();
                this.DeliveryDateLabel.Text         = current.DeliveryDate.ToShortDateString();
                this.PrintedCheckBox.Checked        = current.Printed;
                this.MailingCostsLabel.Text         = current.MailingCosts.ToString("C");
                this.HideNetPricesCheckBox.Checked  = current.HideNetPrices;
                this.InvoiceItemRepeater.DataSource = current.InvoiceItems;
                this.InvoiceItemRepeater.DataBind();
            }

            this.BackToListLink.NavigateUrl = PageUrlAttribute.Get <Invoices.Default>(new Invoices.Default.Query()
            {
                SearchTerm = this.RequestAddOn.Query.SearchTerm
            });
        }
Exemple #7
0
        protected void Page_PreRender(Object sender, EventArgs e)
        {
            this.BackToListLink.NavigateUrl = PageUrlAttribute.Get <Orders.Default>(new Orders.Default.Query()
            {
                SearchTerm = this.RequestAddOn.Query.SearchTerm
            });

            Order current = this.RequestAddOn.Query.Order;

            if (current != null)
            {
                this.OrderDate.Text               = current.OrderDate.ToShortDateString();
                this.SupplierList.SelectedValue   = current.SupplierId.ToString();
                this.ArticlesList.SelectedValue   = current.ArticleId.ToString();
                this.AmountTextBox.Text           = current.Amount.ToString("0");
                this.PriceTextBox.Text            = current.Price.ToString("0.00");
                this.CurrencyTextBox.Text         = current.Currency;
                this.ExchangeRateTextBox.Text     = current.ExchangeRate.ToString("0.00000000");
                this.AcquisitionCostsTextBox.Text = current.FixCostsPercentage.ToString("0.00");

                if (current.ExpectedDateOfDelivery.HasValue)
                {
                    this.ExpectedDateOfDeliveryTextBox.Text = current.ExpectedDateOfDelivery.Value.ToShortDateString();
                }
            }
        }
        protected void SaleItemRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            SaleItemRepeaterEventArgs ee = new SaleItemRepeaterEventArgs(e);

            ee.ArticleImage.ImageUrl               = ee.Data.Article == null ? String.Empty : ee.Data.Article.GetPictureUrl(0);
            ee.ProtocoleNumberLabel.Text           = ee.Data.ProtocoleNumber;
            ee.AmountLabel.Text                    = ee.Data.Amount.ToString("0.0");
            ee.ExternalArticleNumberLabel.Text     = ee.Data.ExternalArticleNumber;
            ee.ExternalArticleNameLink.Text        = ee.Data.ExternalArticleName;
            ee.ExternalArticleNameLink.NavigateUrl = ee.Data.Article == null?
                                                     PageUrlAttribute.Get <Articles.Default>(new Articles.Default.Query()
            {
                SearchTerm = ee.Data.InternalArticleNumber
            }) :
                                                         PageUrlAttribute.Get <Articles.Edit>(new Articles.Edit.Query()
            {
                Article = ee.Data.Article
            });

            ee.SinglePriceLabel.Text = ee.Data.SinglePriceGross.ToString("C");
            ee.TotalPriceLabel.Text  = ee.Data.TotalPriceGross.ToString("C");

            if (ee.Data.IsCanceled)
            {
                foreach (TableCell cell in ee.CurrentRow.Cells)
                {
                    cell.Font.Strikeout = true;
                }
            }
        }
        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 OrderRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            Order current = e.Item.DataItem as Order;
            OrderRepeaterItemEventArgs ee = new OrderRepeaterItemEventArgs(e);

            if (current != null)
            {
                ee.EditLink.NavigateUrl = PageUrlAttribute.Get <Orders.Edit>(new Orders.Edit.Query()
                {
                    Order = current, SearchTerm = this.RequestAddOn.Query.SearchTerm
                });

                ee.OrderArrivedButton.Visible         = !current.HasArrived;
                ee.OrderArrivedButton.CommandArgument = current.Id.ToString();

                ee.OrderCanceledButton.Visible         = current.HasArrived;
                ee.OrderCanceledButton.CommandArgument = current.Id.ToString();

                ee.SampleImage.ImageUrl = current.Article.GetPictureUrl(0);

                String editUrl = PageUrlAttribute.Get <Articles.Details>(new Articles.Details.Query()
                {
                    Article = current.Article
                });

                ee.ArticleNumberLink.Text        = current.Article.ArticleNumber;
                ee.ArticleNumberLink.NavigateUrl = editUrl;

                ee.EANLabel.Text = current.Article.EAN;

                ee.SupplierArticleNumberLink.Text        = current.Article.SupplierArticleNumber;
                ee.SupplierArticleNumberLink.NavigateUrl = editUrl;

                ee.NameInternLink.Text        = current.Article.NameIntern;
                ee.NameInternLink.NavigateUrl = editUrl;

                ee.OrderDateLabel.Text = current.OrderDate.ToShortDateString();

                ee.SupplierNameLabel.Text = current.Supplier.Name;

                ee.AmountLabel.Text = current.Amount.ToString("0.0");

                ee.PriceLabel.Text = String.Format("{0} {1}", current.Price.ToString("0.00"), current.Currency);

                ee.ExchangeRateLabel.Text = current.ExchangeRate.ToString("0.00000000");

                ee.PriceInEuroLabel.Text = current.PriceInEuro.ToString("C");

                ee.PriceTotalInEuroLabel.Text = current.PriceTotalInEuro.ToString("C");

                ee.OldPurchasePriceLabel.Text = current.Article.GetPurchasePriceInEuro().ToString("C");

                ee.ArriveDateLabel.Text = current.ArrivalDate.HasValue ? current.ArrivalDate.Value.ToShortDateString() : String.Empty;

                ee.ExpectedDateOfDelivery.Text = current.ExpectedDateOfDelivery.HasValue ? current.ExpectedDateOfDelivery.Value.ToShortDateString() : String.Empty;

                ee.DeleteButton.CommandArgument = current.Id.ToString();
            }
        }
Exemple #11
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            this.CreateLink1.NavigateUrl = PageUrlAttribute.Get <MaterialGroups.Edit>(new MaterialGroups.Edit.Query());
            this.CreateLink2.NavigateUrl = PageUrlAttribute.Get <MaterialGroups.Edit>(new MaterialGroups.Edit.Query());

            this.MaterialGroupRepeater.DataSource = MaterialGroup.LoadAll();
            this.MaterialGroupRepeater.DataBind();
        }
        //Methods
        #region Page_PreRender
        protected void Page_PreRender(object sender, EventArgs e)
        {
            this.BackLink.NavigateUrl = PageUrlAttribute.Get <Suppliers.Default>();

            if (this.RequestAddOn.Query.Supplier != null)
            {
                this.NameTextBox.Text = this.RequestAddOn.Query.Supplier.Name;
            }
        }
Exemple #13
0
 private void RenderSoul()
 {
     this.SoulLink.NavigateUrl = PageUrlAttribute.Get <Soul>();
     Models.SuccessLog soul = Models.SuccessLog.FindLatest(this.Session.GetCurrentUser());
     if (soul != null)
     {
         this.SoulLabel.Text = soul.Text;
     }
 }
        protected void Page_PreRender(Object sender, EventArgs e)
        {
            try
            {
                this.ShowOpenOrdersLink.NavigateUrl = PageUrlAttribute.Get <Orders.Default>();
                this.CreateOrderLink.NavigateUrl    = PageUrlAttribute.Get <Orders.Edit>();

                IEnumerable <Order> orders = null;

                switch (this.RequestAddOn.Query.SearchTerm)
                {
                case null:
                {
                    orders = Order.LoadOpen();
                    break;
                }

                case "*":
                {
                    orders = Order.LoadAll();
                    break;
                }

                default:
                {
                    String lowerSearchWord = this.RequestAddOn.Query.SearchTerm.ToLower();
                    orders = Order.Search(lowerSearchWord);
                    break;
                }
                }

                Int32 itemsPerPage   = 20;
                Int32 numberOfOrders = orders.Count();
                Int32 pages          = numberOfOrders % itemsPerPage == 0 ? numberOfOrders / itemsPerPage : numberOfOrders / itemsPerPage + 1;
                Int32 runner         = 0;
                var   pageList       = new List <Int32>();
                while (runner < pages)
                {
                    pageList.Add(runner);
                    runner++;
                }

                this.HeaderPagerRepeater.DataSource = pageList;
                this.HeaderPagerRepeater.DataBind();

                this.FooterPagerRepeater.DataSource = pageList;
                this.FooterPagerRepeater.DataBind();

                this.OrderRepeater.DataSource = orders.Skip(this.RequestAddOn.Query.Page * itemsPerPage).Take(itemsPerPage);
                this.OrderRepeater.DataBind();
            }
            catch (Exception ex)
            {
                this.Master.ShowError(ex);
            }
        }
Exemple #15
0
        public static void PrintToPdf(PdfDocument document, ESolutions.Web.UI.Page parentPage)
        {
            String url = PageUrlAttribute.GetAbsolute <Articles.PrintInventory>(parentPage);

            HtmlToPdf.Options.PageSize   = EO.Pdf.PdfPageSizes.A4;
            HtmlToPdf.Options.OutputArea = new RectangleF(0.4f, 0.2f, HtmlToPdf.Options.PageSize.Width - 0.8f, HtmlToPdf.Options.PageSize.Height - 0.4f);
            HtmlToPdf.Options.UserName   = ShopperConfiguration.Default.Printing.User;
            HtmlToPdf.Options.Password   = ShopperConfiguration.Default.Printing.Password;
            HtmlToPdf.ConvertUrl(url, document);
        }
        protected void SalesRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var ee = new SalesRepeaterItemEventArgs(e);

            if (ee.Data != null)
            {
                ee.RowCheckBox.Value = ee.Data.Id.ToString();

                ee.DetailsLink.NavigateUrl = PageUrlAttribute.Get <Sales.Details>(new Sales.Details.Query()
                {
                    Sale = ee.Data
                });

                ee.EditLink.NavigateUrl = PageUrlAttribute.Get <Sales.Edit>(new Sales.Edit.Query()
                {
                    Sale = ee.Data, SearchTerm = this.RequestAddOn.Query.SearchTerm
                });

                ee.PictureRepeater.DataSource = ee.Data.SaleItems;
                ee.PictureRepeater.DataBind();

                ee.NoteLabel.Text = ee.Data.Notes;

                ee.SaleSourceLabel.Text           = ee.Data.ProtocolNumber;
                ee.SaleSourceLabel.Font.Strikeout = ee.Data.IsCanceled;

                ee.DateOfSaleLabel.Text           = ee.Data.DateOfSale.ToShortDateString();
                ee.DateOfSaleLabel.Font.Strikeout = ee.Data.IsCanceled;

                ee.CanBeSyncedCheckBox.Checked        = ee.Data.CanBeSynced;
                ee.CanBeSyncedCheckBox.Font.Strikeout = ee.Data.IsCanceled;

                ee.IsPaidCheckBox.Checked          = ee.Data.IsPaid;
                ee.IsMailedCheckBox.Font.Strikeout = ee.Data.IsCanceled;

                ee.IsMailedCheckBox.Checked        = ee.Data.IsMailed;
                ee.IsMailedCheckBox.Font.Strikeout = ee.Data.IsCanceled;

                ee.NameOfBuyerLabel1.Text           = ee.Data.NameOfBuyer;
                ee.NameOfBuyerLabel1.Font.Strikeout = ee.Data.IsCanceled;

                ee.NameOfBuyerLabel2.Text           = ee.Data.EMailAddress;
                ee.NameOfBuyerLabel2.Font.Strikeout = ee.Data.IsCanceled;

                ee.EbayNameLabel.Text = ee.Data.EbayName;

                ee.PriceLabel.Text = ee.Data.TotalPriceGross.ToString("C");

                ee.CancelLink.CommandArgument = ee.Data.Id.ToString();

                ee.DeleteLink.CommandArgument = ee.Data.Id.ToString();

                ee.PrintConfirmationButton.CommandArgument = ee.Data.Id.ToString();
            }
        }
Exemple #17
0
        protected void ArticleRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var ee = new ArticleRepeaterItemEventArgs(e);

            String detailsUrl = PageUrlAttribute.Get <Articles.Details>(new Articles.Details.Query()
            {
                Article = ee.Data, SearchTerm = this.RequestAddOn.Query.SearchTerm
            });

            ee.DetailsLink1.NavigateUrl = detailsUrl;

            String ebayUrl = PageUrlAttribute.Get <Articles.Ebay>(new Articles.Ebay.Query()
            {
                Article = ee.Data, SearchTerm = this.RequestAddOn.Query.SearchTerm
            });

            ee.EbayLink1.NavigateUrl = ebayUrl;

            String editUrl = PageUrlAttribute.Get <Articles.Edit>(new Articles.Edit.Query()
            {
                Article = ee.Data, SearchTerm = this.RequestAddOn.Query.SearchTerm
            });

            ee.EditLink1.NavigateUrl = editUrl;

            ee.MaterialGroupLabel.Text              = ee.Data.MaterialGroup.Name;
            ee.ArticleNumberLabel.Text              = ee.Data.ArticleNumber;
            ee.EANLabel.Text                        = ee.Data.EAN;
            ee.NameInternLabel.Text                 = ee.Data.NameIntern;
            ee.Image1Picture.ImageUrl               = ee.Data.GetPictureUrl(0);
            ee.PurchasePriceLabel.Text              = ee.Data.GetPurchasePriceInEuro().ToString("C");
            ee.SellingPriceGrossLabel.Text          = ee.Data.SellingPriceGross.ToString("C");
            ee.SellingPriceWholesaleGrossLabel.Text = ee.Data.SellingPriceWholesaleGross.ToString("C");
            ee.SupplierLabel.Text                   = ee.Data.Supplier.Name;
            ee.SupplierArticleNumberLabel.Text      = ee.Data.SupplierArticleNumber;
            ee.AmountOnStockLabel.Text              = ArticleFormatter.ToStringStockAmount(ee.Data);
            ee.AmountOnStockEbayLabel.Text          = ArticleFormatter.ToStringEbayStockAmount(ee.Data);
            ee.AmountOnStockMagentoLabel.Text       = ee.Data.SyncMagento.ToString("0");
            ee.IsInEbayCheckBox.Checked             = ee.Data.IsInEbay;
            ee.IsInMagentoCheckBox.Checked          = ee.Data.IsInMagento;

            ee.DeleteButton.CommandArgument = ee.Data.Id.ToString();
            ee.DeleteButton.Text            = ee.Data.IsDeleted ? StringTable.Reactivate : StringTable.Delete;

            if (ee.Data.IsDeleted)
            {
                for (int index = 1; index < e.Item.Controls.Count - 1; index++)
                {
                    if (e.Item.Controls[index] is WebControl && !(e.Item.Controls[index] is LinkButton) && !(e.Item.Controls[index] is HyperLink))
                    {
                        (e.Item.Controls[index] as WebControl).Font.Strikeout = true;
                    }
                }
            }
        }
Exemple #18
0
        private String GetOrderLink(Int32 index)
        {
            Boolean sortAscending = this.RequestAddOn.Query.SortColumnIndex == index ? !this.RequestAddOn.Query.SortOrderAscending : true;

            return(PageUrlAttribute.Get <Performance>(new Performance.Query()
            {
                SortColumnIndex = index,
                SortOrderAscending = sortAscending,
                Page = this.RequestAddOn.Query.Page
            }));
        }
Exemple #19
0
 protected void Page_PreRender(Object sender, EventArgs e)
 {
     try
     {
         this.HomeLink.NavigateUrl = PageUrlAttribute.Get <Default>();
     }
     catch (Exception ex)
     {
         this.Master.ShowError(ex);
     }
 }
        protected void StockMovementPaginationRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var ee = new StockMovementPaginationRepeaterItemEventArgs(e);

            ee.PageLink.Text        = (ee.Data + 1).ToString();
            ee.PageLink.NavigateUrl = PageUrlAttribute.Get <Articles.Details>(new Articles.Details.Query()
            {
                StockMovementPage = ee.Data,
                Article           = this.RequestAddOn.Query.Article,
                SearchTerm        = this.RequestAddOn.Query.SearchTerm
            });
        }
Exemple #21
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());
            }
        }
Exemple #22
0
        public static void PrintToPdf(PdfDocument document, ESolutions.Web.UI.Page parentPage, IEnumerable <Mailing> selectedMailings)
        {
            String url = PageUrlAttribute.GetAbsolute <Mailings.PickingPrint>(parentPage, new Mailings.PickingPrint.Query()
            {
                MailingIds = selectedMailings.Select(runner => runner.Id).ToList()
            });

            HtmlToPdf.Options.PageSize   = EO.Pdf.PdfPageSizes.A4;
            HtmlToPdf.Options.OutputArea = new RectangleF(0.25f, 0.25f, HtmlToPdf.Options.PageSize.Width - 0.5f, HtmlToPdf.Options.PageSize.Height - 0.5f);

            HtmlToPdf.Options.UserName = ShopperConfiguration.Default.Printing.User;
            HtmlToPdf.Options.Password = ShopperConfiguration.Default.Printing.Password;
            HtmlToPdf.ConvertUrl(url, document);
        }
        //Methods
        #region Page_PreRender
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (this.RequestAddOn.Query.ArticleQA != null)
            {
                this.QuestionTextBox.Text = this.RequestAddOn.Query.ArticleQA.Question;
                this.AnswerTextBox.Text   = this.RequestAddOn.Query.ArticleQA.Answer;
            }

            this.BackToArticleLink.NavigateUrl = PageUrlAttribute.Get <Articles.EbayPreview>(
                new Articles.Details.Query()
            {
                Article    = this.RequestAddOn.Query.Article,
                SearchTerm = this.RequestAddOn.Query.SearchTerm
            });
        }
Exemple #24
0
        private void RenderBody()
        {
            this.BodyLink.NavigateUrl = PageUrlAttribute.Get <Body>();
            var bodyMeasures    = Models.BodyMeasure.FindAll(this.Session.GetCurrentUser());
            var ascendingValues = from current in bodyMeasures
                                  orderby current.Date ascending
                                  select current;

            foreach (Models.BodyMeasure current in ascendingValues)
            {
                this.BodyChart.Series["Weight"].Points.Add(current.Weight);
                this.BodyChart.Series["Fat"].Points.Add(current.FatAbsolute);
                this.BodyChart.Series["Weight"].Points[this.BodyChart.Series["Weight"].Points.Count - 1].AxisLabel = current.Date.ToShortDateString();
            }
        }
 //Methods
 #region Page_PreRender
 protected void Page_PreRender(object sender, EventArgs e)
 {
     this.HtmlTextBox.Text            = this.RequestAddOn.Query.Article.ToHtml();
     this.EbayPreviewLink.NavigateUrl = PageUrlAttribute.Get <Articles.EbayPreview>(
         new Articles.EbayPreview.Query()
     {
         Article    = this.RequestAddOn.Query.Article,
         SearchTerm = this.RequestAddOn.Query.SearchTerm
     });
     this.BackToListLink.NavigateUrl = PageUrlAttribute.Get <Articles.Default>(
         new Articles.Default.Query()
     {
         SearchTerm = this.RequestAddOn.Query.SearchTerm
     });
 }
 protected void Page_PreRender(object sender, EventArgs e)
 {
     this.HomeLink.NavigateUrl            = PageUrlAttribute.Get <Default>();
     this.SyncerLogLink.NavigateUrl       = PageUrlAttribute.Get <SyncerLog.Default>();
     this.MailingCostsLink.NavigateUrl    = PageUrlAttribute.Get <MailingCosts.Default>();
     this.MailingCostsDpdLink.NavigateUrl = PageUrlAttribute.Get <MailingCosts.DefaultDpd>();
     this.SuppliersLink.NavigateUrl       = PageUrlAttribute.Get <Suppliers.Default>();
     this.MaterialGroupsLink.NavigateUrl  = PageUrlAttribute.Get <MaterialGroups.Default>();
     this.VehiclesLink.NavigateUrl        = PageUrlAttribute.Get <Vehicles.Default>();
     this.ArticlesLink.NavigateUrl        = PageUrlAttribute.Get <Articles.Default>();
     this.OrdersLink.NavigateUrl          = PageUrlAttribute.Get <Orders.Default>();
     this.SalesLink.NavigateUrl           = PageUrlAttribute.Get <Sales.Default>();
     this.MailingsLink.NavigateUrl        = PageUrlAttribute.Get <Mailings.Default>();
     this.InvoicesLink.NavigateUrl        = PageUrlAttribute.Get <Invoices.Default>();
 }
Exemple #27
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 MailingCostRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var ee = new MailingCostRepeaterItemEventArgs(e);

            if (ee.Data != null)
            {
                ee.EditLink.NavigateUrl = PageUrlAttribute.Get <MailingCosts.EditDpd>(new MailingCosts.EditDpd.Query()
                {
                    MailingCostsDpd = ee.Data
                });
                ee.PostcodeLiteral.Text = ee.Data.Postcode;
                ee.CityLiteral.Text     = ee.Data.City;
                ee.CostsLiteral.Text    = ee.Data.AdditionalCosts.ToString("C");
            }
        }
Exemple #29
0
        public static void PrintToPdf(
            PdfDocument document,
            ESolutions.Web.UI.Page parentPage,
            Sale sale)
        {
            String url = PageUrlAttribute.GetAbsolute <Sales.Print>(parentPage, new Sales.Print.Query()
            {
                Sale = sale,
            });

            HtmlToPdf.Options.PageSize   = EO.Pdf.PdfPageSizes.A4;
            HtmlToPdf.Options.OutputArea = new RectangleF(0.0f, 0.0f, HtmlToPdf.Options.PageSize.Width, HtmlToPdf.Options.PageSize.Height);
            HtmlToPdf.Options.UserName   = ShopperConfiguration.Default.Printing.User;
            HtmlToPdf.Options.Password   = ShopperConfiguration.Default.Printing.Password;
            HtmlToPdf.ConvertUrl(url, document);
        }
Exemple #30
0
        protected void PagerRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var ee = new PagerRepeaterItemEventArgs(e);

            ee.PageLink.Text        = (ee.Data + 1).ToString();
            ee.PageLink.NavigateUrl = PageUrlAttribute.Get <Performance>(new Performance.Query()
            {
                SortColumnIndex = this.RequestAddOn.Query.SortColumnIndex,
                Page            = ee.Data
            });

            if (ee.Data == this.RequestAddOn.Query.Page)
            {
                ee.PageLink.ForeColor = System.Drawing.Color.Red;
            }
        }