예제 #1
0
        private void addNewDriver()
        {
            using (FormulaOneDataContext Data = new FormulaOneDataContext())
            {
                Driver driver = new Driver();

                driver.FirstName  = FirstNameTxt.Text;
                driver.SecondName = SecondNameTxt.Text;
                driver.TeamID     = Int32.Parse(DropDownTeams.SelectedValue);

                Data.Drivers.InsertOnSubmit(driver);
                Data.SubmitChanges();

                Response.Redirect("~/AddDriver");
            }
        }
예제 #2
0
        protected void addTeamBtn_Click(object sender, EventArgs e)
        {
            using (FormulaOneDataContext Data = new FormulaOneDataContext())
            {
                Team team = new Team();

                team.TeamName    = TeamNameTxt.Text;
                team.Constructor = ConstructorTxt.Text;
                team.Chassis     = ChassisTxt.Text;
                team.Engine      = EngineTxt.Text;

                Data.Teams.InsertOnSubmit(team);
                Data.SubmitChanges();

                Response.Redirect("~/AddTeam");
            }
        }