protected void btnFinalUpdate_Click(object sender, EventArgs e) { //int studentNo = 213456854; HttpPostedFile profilePicture1; HttpPostedFile cv1; TypeLibrary.Models.UpdateStudentProfile up1 = new TypeLibrary.Models.UpdateStudentProfile(); try { up1.studentNo = int.Parse(txtStudentNumber.Text); up1.firstName = txtFirstName.Text; up1.lastName = txtLastName.Text; up1.dateOfBirth = DateTime.Parse(txtDateOfBirth.Text); up1.countryID = Convert.ToInt32(ddlCountries.SelectedItem.Value); up1.cityID = Convert.ToInt32(ddlCities.SelectedItem.Value); up1.email = txtEmail.Text; up1.contactNo = txtContactNumber.Text; up1.industryID = Convert.ToInt32(ddlIndustries.SelectedItem.Value); up1.qualID = 1; up1.skillID = 1; if (rbtnDriversYes.Checked == true) { up1.drivers = "yes"; } else { up1.drivers = "no"; } //profile picture!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! profilePicture1 = uploadImage.PostedFile; int profilepictureint = profilePicture1.ContentLength; byte[] bytImg = new byte[profilepictureint]; up1.profilePicture = bytImg; /////////////////////////////////////////////////////////////end image add up1.studentUsername = txtStudentUsername.Text; up1.studentPassword = txtStudentPassword.Text; //CV!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! cv1 = uploadImage.PostedFile; int cvint = cv1.ContentLength; byte[] bytCV = new byte[cvint]; up1.cv = bytCV; up1.cvDate = DateTime.Now; up1.lastUpdated = DateTime.Now; up1.statusID = 1; BLL_handler.BLL_UpdateStudentProfile(up1); Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('You have successfully updated your profile');</script>"); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('You profile was not updated');</script>"); } }
protected void btnUpdateProfile_Click(object sender, EventArgs e) { TypeLibrary.Models.UpdateStudentProfile usp = new TypeLibrary.Models.UpdateStudentProfile(); HttpPostedFile profilePicture1; HttpPostedFile cv1; int studentNo = 215333608; /////////////////////////////////////////////////////////////////////////////////////////// usp.studentNo = studentNo; usp.firstName = txtFirstName.Text; usp.lastName = txtLastName.Text; usp.dateOfBirth = DateTime.Parse(txtDateofBirth.Text); usp.countryID = int.Parse(ddlCountries.Text); usp.cityID = Convert.ToInt32(ddlCities.SelectedItem); usp.email = txtEmail.Text; usp.contactNo = txtContactNo.Text; usp.industryID = 1; usp.qualID = 1; usp.skillID = 1; if (rbtnDriversYes.Checked == true) { usp.drivers = "yes"; } else { usp.drivers = "no"; } profilePicture1 = uploadImage.PostedFile; int profilepictureint = profilePicture1.ContentLength; byte[] bytImg = new byte[profilepictureint]; usp.profilePicture = bytImg; usp.studentUsername = txtStudUsername.Text; usp.studentPassword = txtStudPassword.Text; //CV!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! cv1 = uploadCV.PostedFile; int cvint = cv1.ContentLength; byte[] bytCV = new byte[cvint]; usp.cv = bytCV; usp.cvDate = DateTime.Now; usp.lastUpdated = DateTime.Now; usp.statusID = 1; BLL_handler.BLL_UpdateStudentProfile(usp); }