protected void btnCreateEProfile_Click1(object sender, EventArgs e)
        {
            AddEmployer    addEmployer = new AddEmployer();
            HttpPostedFile Logo1;

            try
            {
                addEmployer.employerName        = txtEmployerName.Text;
                addEmployer.employerDescription = txtDescription.Text;
                addEmployer.countryID           = Convert.ToInt32(ddlCountry.SelectedItem.Value);
                addEmployer.cityID     = Convert.ToInt32(ddlCity.SelectedItem.Value);
                addEmployer.industryID = Convert.ToInt32(txtChosenIndID.Text);
                addEmployer.email      = txtEmail.Text;
                addEmployer.vatNo      = txtVAT.Text;

                Logo1 = uploadLogo.PostedFile;
                int    logoint = Logo1.ContentLength;
                byte[] bytLogo = new byte[logoint];
                addEmployer.logo = bytLogo;

                addEmployer.employerUsername = txtUsername.Text;
                addEmployer.employerPassword = txtPassword.Text;
                addEmployer.contactPerson    = txtContactPerson.Text;
                addEmployer.contactEmail     = txtContactEmail.Text;
                addEmployer.statusID         = 1;
                //addEmployer.industryID = 1;

                BLL_handler.BLL_AddEmployer(addEmployer);
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('You have successfully created your profile');</script>");
                Response.Redirect("View_Employer_profile.aspx?employerEmail=" + txtEmail.Text);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('There was a problem with creating your profile. Please retype all the fields');</script>");
                txtEmployerName.Text  = "";
                txtDescription.Text   = "";
                txtEmail.Text         = "";
                txtVAT.Text           = "";
                txtUsername.Text      = "";
                txtPassword.Text      = "";
                txtContactPerson.Text = "";
                txtContactEmail.Text  = "";
            }
        }
コード例 #2
0
 public bool BLL_AddEmployer(AddEmployer addEmployer)
 {
     return(dBAccess.AddEmployer(addEmployer));
 }