protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //Creating Session Object
                //Session["UserId"] = 1001;
                //Delete the above portion

                //Populating JS Details
                JobSeekerBAL jobSeekerBal = new JobSeekerBAL();
                var          table        = jobSeekerBal.GetJobSeekerDetails(Convert.ToInt32(Session["UserId"]));
                LabelJobSeekerId.Text    = table.Rows[0][0].ToString();
                LabelJobSeekerName.Text  = table.Rows[0][1].ToString();
                LabelCity.Text           = table.Rows[0][2].ToString();
                LabelDetails.Text        = table.Rows[0][3].ToString();
                LabelJobCategory.Text    = table.Rows[0][4].ToString();
                Session["JobCategoryId"] = table.Rows[0][5].ToString();
                //populating City DropDown
                var cityBal     = new CityBAL();
                var citiesTable = cityBal.GetCities();
                foreach (DataRow row in citiesTable.Rows)
                {
                    var li = new ListItem(row[1].ToString(), row[0].ToString());
                    DropDownListCity.Items.Add(li);
                }
                //Populate Applied Jobs GridView
                PopulateGridViewAppliedJobs();
            }
        }
示例#2
0
        protected void ButtonSubmit_Click(object sender, EventArgs e)
        {
            if (new CredentialBAL().IsCredentialPresent(TextBoxUsername.Text))
            {
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "alert('Username taken!');", true);
                TextBoxUsername.BorderColor = Color.Red;
                return;
            }

            JobSeeker jobSeeker = new JobSeeker();

            jobSeeker.JobSeekerName    = TextBoxName.Text;
            jobSeeker.JobSeekerDetails = TextBoxDetails.Text;
            // To-Do: Get the CityId from the CityTable
            // Get the JobCategoryId from the JobCategoryTable

            jobSeeker.CityId        = Convert.ToInt32(DropDownListCity.SelectedValue);
            jobSeeker.JobCategoryId = Convert.ToInt32(DropDownJobCategory.SelectedValue);

            Credential credential = new Credential();

            credential.UserName = TextBoxUsername.Text;
            credential.Password = TextBoxPassword.Text;

            JobSeekerBAL jobSeekerBal = new JobSeekerBAL();

            jobSeekerBal.SaveJobSeeker(jobSeeker, credential);

            //TO-DO: Check for the validity of username from the Credentials DB
            //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "alert('Registered Successfully! Please Login.');", true);
            Response.Redirect("login.aspx");
        }