//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();
        }
Exemple #2
0
        protected void SaveButton_Click(Object sender, EventArgs e)
        {
            try
            {
                var current = this.RequestAddOn.Query.MailingCostsDpd;

                if (current == null)
                {
                    current = new MailingCostsDpd();
                    MyDataContext.Default.MailingCostsDpds.Add(current);
                }
                current.Postcode        = this.PostcodeTextBox.Text;
                current.City            = this.CityTextBox.Text;
                current.AdditionalCosts = this.CostsTextBox.Text.ToDecimal();
                MyDataContext.Default.SaveChanges();
                this.ResponseAddOn.Redirect <MailingCosts.DefaultDpd>();
            }
            catch (Exception ex)
            {
                this.Master.ShowError(ex);
            }
        }