protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack == false) { TxtJobTitle.Focus(); for (int i = 1; i <= 35; i++) { DdlExperience.Items.Add(new ListItem(i.ToString(), i.ToString())); } DdlExperience.Items.Insert(0, new ListItem("--Select--", "--Select--")); DdlExperience.Items.Insert(1, new ListItem("Fresher", "Fresher")); DdlExperience.Items.Insert(2, new ListItem("6 Months", "6 Months")); DdlDepartment.DataSource = Department.GetDepartmentRecords("status='Active'"); DdlDepartment.DataBind(); DdlDepartment.Items.Insert(0, new ListItem("--Select--", "--Select--")); DdlCompany.DataSource = CompanyDetails.GetCompanyDetailsRecords("status='Active'"); DdlCompany.DataBind(); DdlCompany.Items.Insert(0, new ListItem("--Select--", "--Select--")); DdlDesignation.DataSource = Designation.GetDesignationRecords("status='Active'"); DdlDesignation.DataBind(); DdlDesignation.Items.Insert(0, new ListItem("--Select--", "--Select--")); DataTable ObjSkillTable = new DataTable(); DataColumn ObjIdColumn = new DataColumn("Id", typeof(int)); ObjIdColumn.AllowDBNull = false; ObjIdColumn.AutoIncrement = true; ObjSkillTable.Columns.Add(ObjIdColumn); DataColumn ObjSkillIdColumn = new DataColumn("SkillId", typeof(int)); ObjSkillIdColumn.AllowDBNull = false; ObjSkillTable.Columns.Add(ObjSkillIdColumn); ViewState["SkillTable"] = ObjSkillTable; } LblDuplicateSkillName.Visible = false; LblSelectBranchError.Visible = false; LblSelectCheckBoxError.Visible = false; }
/// <summary> /// actually clears each textbox in the form /// </summary> private void ClearNewEmpForm() { EpForm.Clear(); TxtID.Clear(); TxtFirstName.Clear(); TxtLastName.Clear(); TxtAddress.Clear(); TxtCity.Clear(); CBxState.SelectedIndex = -1; CBxEmpType.SelectedIndex = -1; TxtZip.Clear(); TxtHireDate.Clear(); CBxMarriageStatus.SelectedIndex = -1; TxtDept.Clear(); TxtJobTitle.Clear(); LblAfterSubmitMsg.Text = ""; TxtPayAmount.Visible = false; LblPayAmount.Visible = false; LblSecondInput.Visible = false; TxtSecondInput.Visible = false; }
protected void BtnAdJobPost_Click(object sender, EventArgs e) { if (this.IsValid == true) { bool AllOk = true; if (CheckCheckboxeList(ChkLstBranches) == false) { LblSelectBranchError.Visible = true; AllOk = false; } if (DdlAptitude.SelectedIndex != 0 && (TxtNumberOfAptitude.Text == string.Empty || int.Parse(TxtNumberOfAptitude.Text) <= 0)) { LblNumberOfAptitudeError.Visible = true; TxtNumberOfAptitude.Focus(); return; } if (DdlGD.SelectedIndex != 0 && (TxtNumberOfGD.Text == string.Empty || int.Parse(TxtNumberOfGD.Text) <= 0)) { LblNumberOfGDError.Visible = true; TxtNumberOfGD.Focus(); return; } if (DdlTechnical.SelectedIndex != 0 && (TxtNumberOfTechnical.Text == string.Empty || int.Parse(TxtNumberOfTechnical.Text) <= 0)) { LblNumberOfTechnicalError.Visible = true; TxtNumberOfTechnical.Focus(); return; } if (DdlPersonalInterview.SelectedIndex != 0 && (TxtNumberOfInterviews.Text == string.Empty || int.Parse(TxtNumberOfInterviews.Text) <= 0)) { LblNumberOfInteviewsError.Visible = true; TxtNumberOfInterviews.Focus(); return; } if (JobPost.GetJobPostRecords("JobTitle='" + TxtJobTitle.Text + "' and recruiterId=" + this.Page.User.Identity.Name).Rows.Count > 0) { LblDuplicateJobTitleError.Visible = true; TxtJobTitle.Focus(); return; } if (AllOk == false) { return; } if (AllOk == true) { int NewJobPostId = JobPost.AddJobPost(int.Parse(this.Page.User.Identity.Name), TxtJobTitle.Text, int.Parse(DdlCompany.SelectedValue), int.Parse(DdlDepartment.SelectedValue), int.Parse(DdlDesignation.SelectedValue), BtnLstJobType.SelectedValue, BtnLstGender.SelectedValue, decimal.Parse(TxtMinSalary.Text), decimal.Parse(TxtMaxSalary.Text), TxtJobDescription.Text, "Active"); foreach (ListItem ObjListItem in ChkLstBranches.Items) { if (ObjListItem.Selected == true) { JobPost_Branches.AddJobPost_Branches(NewJobPostId, int.Parse(ObjListItem.Value)); } } JobPost_Requirement.AddJobPost_Requirement(NewJobPostId, int.Parse(DdlDegree.SelectedValue), int.Parse(DdlExperience.SelectedValue)); DataTable ObjSkillTable = (DataTable)ViewState["SkillTable"]; foreach (DataRow ObjRow in ObjSkillTable.Rows) { JobPost_Skills.AddJobPost_Skills(NewJobPostId, int.Parse(ObjRow["SkillId"].ToString())); } //throw new Exception(int.Parse(TxtNumberOfGD.Text).ToString()); JobPost_InterviewProcess.AddJobPost_InterviewProcess(NewJobPostId, DdlAptitude.SelectedValue, int.Parse(TxtNumberOfAptitude.Text), DdlGD.SelectedValue, int.Parse(TxtNumberOfGD.Text), DdlTechnical.SelectedValue, int.Parse(TxtNumberOfTechnical.Text), DdlPersonalInterview.SelectedValue, int.Parse(TxtNumberOfInterviews.Text)); } } }