Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using EpicCars;
- namespace Customers
- {
- public partial class Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- PopulateFormWithAutomobile();
- }
- protected void submitBTN_Click(object sender, EventArgs e)
- {
- SaveBidFromForm();
- }
- private void SaveStartingBidFromFor()
- {
- throw new NotImplementedException();
- }
- void PopulateFormWithAutomobile()
- {
- var svc = new CarService();
- var automobile = svc.GetAutomobiles();
- if (automobile == null)
- return;
- colorTextBox.Text = automobile.Color;
- makeTextBox.Text = automobile.Make;
- modelTextBox.Text = automobile.Model;
- yearTextBox.Text = automobile.Year.ToString();
- amountTextBox.Text = automobile.Amount.ToString();
- }
- void SaveBidFromForm()
- {
- var bid = new Bidders();
- bid.BiddersName = BiddersNameTextBox.Text;
- int firstBid;
- if (int.TryParse(bidAmountTB.Text, out firstBid))
- bid.FirstBid = firstBid;
- var svc = new BiddersService();
- svc.SaveStartingBid(bid);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement