protected void Button3_Click(object sender, EventArgs e) { RequestAddWorkExperience requestAddWorkExperience = new RequestAddWorkExperience(); requestAddWorkExperience.Username = Session["Username"].ToString(); requestAddWorkExperience.YearStarted = int.Parse(txtYearStarted.Text); requestAddWorkExperience.YearEnded = int.Parse(txtYearEnded.Text); requestAddWorkExperience.Company = txtCompany.Text; requestAddWorkExperience.ExpPosition = txtExpPosition.Text; DAT.AddWorkExperience(requestAddWorkExperience); }
protected void ButtonAddWorkExperience_Click(object sender, EventArgs e) { RequestAddWorkExperience request = new RequestAddWorkExperience(); request.Username = Session["Username"].ToString(); request.YearStarted = int.Parse(txtYearStarted.Text); request.YearEnded = int.Parse(txtYearEnded.Text); request.Company = txtCompany.Text; request.ExpPosition = txtExpPosition.Text; try { DAT.AddWorkExperience(request); Response.Write("<script language='javascript'>alert('Successfully Added Work Experience Information!.')</script>"); Response.Redirect("Employee_ViewWorkExperience.aspx"); } catch { Response.Write("<script language='javascript'>alert('Failed to Add!.')</script>"); } }