protected void Page_Load(object sender, EventArgs e) { postage = Request.QueryString["postage"]; if (postage != null && !IsPostBack) { PostageOptions o = QueryClass.GetPostageOptionByName(postage); pricePostage.Text = o.Price.ToString("F"); namePostage.Text = o.Name; descriptionPostage.Text = o.Description; etaPostage.Text = o.ETA.ToString(); hiddenID.Text = o.ID.ToString(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { PostageOptions o = new PostageOptions(); o.Price = Convert.ToDouble(pricePostage.Text); o.Description = descriptionPostage.Text; o.Name = namePostage.Text; o.ETA = Convert.ToInt32(etaPostage.Text); // Add new postage option if (hiddenID.Text.Equals("")) { QueryClass.AddPostageOption(o); } else { //Update Postage QueryClass.UpdatePostageOption(o); } Response.Redirect("ManagePostage.aspx"); }
public Order() { Products = new List <Product>(); Status = "Processing"; PostOption = new PostageOptions(); }