public void ProcessRequest(HttpContext context) { System.Collections.Specialized.NameValueCollection forms = context.Request.Form; string strOperation = forms.Get("oper"); SearchDetails objS = new SearchDetails(); objS.EmpID =ProfileEmployer.Id; var collectionEmployee = new AddJobBO().ListVacancy(objS); var collectionCompanies = new DDLDataBO().getCompanies(ProfileEmployer.Id); string strResponse = string.Empty; var filter = context.Request.QueryString["id"]; if (strOperation == null) { if (filter == "1") { //oper = null which means its first load. var jsonSerializer = new JavaScriptSerializer(); context.Response.Write(jsonSerializer.Serialize(collectionEmployee.AsQueryable<Vacancy>().ToList<Vacancy>())); } else { var jsonSerializer = new JavaScriptSerializer(); context.Response.Write(jsonSerializer.Serialize(collectionCompanies.AsQueryable<CompanyProfile>().ToList<CompanyProfile>())); } } else if (strOperation == "del") { if (filter == "1") { // var query = Query.EQ("JobID", forms.Get("JobId").ToString()); int jobid = Convert.ToInt32(forms.Get("JobId")); new AddJobBO().RemoveJob(jobid); //collectionEmployee.Remove(query); } strResponse = "Employee record successfully removed"; context.Response.Write(strResponse); } else { string strOut = string.Empty; if (filter == "1") { AddEdit(forms, collectionEmployee, out strOut); } else { AddEditCompany(forms, collectionCompanies, out strOut); } context.Response.Write(strOut); } }
//protected void ddlJobVenue_SelectedIndexChanged(object sender, EventArgs e) //{ // if (ddlJobVenue.SelectedItem.Text != "Select") // { // tblVenue.Visible = true; // } // else // { // tblVenue.Visible = false; // } //} protected void btnVenueConfirm_Click(object sender, EventArgs e) { try { Vacancy objVac = new Vacancy(); objVac.JobID = Convert.ToInt32(ddlJobVenue.SelectedValue); objVac.VenueAddress = txtVenueAddress.Text; objVac.InterviewDate = Convert.ToDateTime(txtInterviewDate.Text); //objVac.InterviewTime = Convert.ToDateTime(txtInterviewTime.Text); int res = new AddJobBO().UpdateJobDetails(objVac); if (res == 1) { txtVenueAddress.Text = null; txtInterviewDate.Text = null; bind(); } } catch (Exception) { lblError.Text = "Something Went Wrong"; } }
protected void btnAdd_Click(object sender, EventArgs e) { try { Vacancy objVacancy = new Vacancy(); objVacancy.JobPosition = txtJobPosition.Text; objVacancy.PostedDate = DateTime.Now; objVacancy.LastDate =Convert.ToDateTime(txtCalender.Text); objVacancy.Country =Convert.ToInt32(ddlCountry.SelectedItem.Value); objVacancy.State =Convert.ToInt32(ddlState.SelectedItem.Value); objVacancy.City =Convert.ToInt32(ddlCity.SelectedItem.Value); objVacancy.Skill =Convert.ToInt32(ddlSkillSet.SelectedItem.Value); objVacancy.EmpId = Convert.ToInt32(Session["ID"].ToString()); objVacancy.VenueAddress = "Testing"; objVacancy.InterviewDate = DateTime.Now; int i = new AddJobBO().AddJob(objVacancy); if (i == 1) { Response.Redirect("ProfileEmployer.aspx"); } if (i == 0) { lblAddError.Text = "Something Went Wrong"; } else { lblAddError.Text = ""; } } catch (Exception) { lblAddError.Text = "Something Went Wrong"; } }
private void AddEdit(NameValueCollection forms, List<Vacancy> collectionEmployee, out string strResponse) { string strOperation = forms.Get("oper"); string strEmpId = string.Empty; if (strOperation == "edit") { strEmpId = forms.Get("JobId").ToString(); } else if (strOperation == "add") { strResponse = "Adding functionality not yet implemented"; // var result = collectionEmployee.AsQueryable<Vacancy>().Select(c => c.JobID).Max(); // strEmpId = (Convert.ToInt32(result) + 1).ToString(); } Vacancy objVac=new Vacancy(); objVac.JobID =Convert.ToInt32(strEmpId); objVac.JobPosition= forms.Get("JobPosition").ToString(); objVac.CompanyName = forms.Get("CompanyName").ToString(); objVac.LastDate=Convert.ToDateTime(forms.Get("LastDate").ToString()); objVac.Skill =Convert.ToInt32(forms.Get("Skill").ToString()); objVac.City =Convert.ToInt32(forms.Get("City").ToString()); objVac.Qualification = forms.Get("Qualification").ToString().Trim(); objVac.Experience = forms.Get("Experience").ToString(); objVac.Salary = forms.Get("Salary").ToString(); int res= new AddJobBO().JQGridDetailsUpdate(objVac); if (res == 1) { strResponse = "Employee record successfully updated"; } else { strResponse = "Something went wrong"; } }
protected void btnAdd_Click(object sender, EventArgs e) { try { Vacancy objVacancy = new Vacancy(); objVacancy.JobPosition = txtJobPosition.Text; objVacancy.PostedDate = DateTime.Now; objVacancy.LastDate = Convert.ToDateTime(txtCalender.Text); objVacancy.Country = Convert.ToInt32(ddlCountry.SelectedItem.Value); objVacancy.State = Convert.ToInt32(ddlState.SelectedItem.Value); objVacancy.City = Convert.ToInt32(ddlCity.SelectedItem.Value); objVacancy.Skill = Convert.ToInt32(ddlSkillSet.SelectedItem.Value); objVacancy.EmpId = Convert.ToInt32(Session["ID"].ToString()); objVacancy.Qualification = txtJobQualification.Text; objVacancy.VenueAddress = ""; objVacancy.OtherSkills = txtOtherSkills.Text; objVacancy.CompanyName = txtCompanyName.Text; objVacancy.Experience = ddlExperienceSel.Items[ddlExperienceSel.SelectedIndex].Value; objVacancy.Salary = ddlSalarySel.Items[ddlSalarySel.SelectedIndex].Value; objVacancy.CompanyUrl = txtJobCompanyUrl.Text; objVacancy.JobDescription = txtAreaJobDescription.InnerText; objVacancy.InterviewDate = DateTime.Now; int i = new AddJobBO().InsertNew<Vacancy>(objVacancy); if (i == 1) { Response.Redirect("ProfileEmployer.aspx"); } if (i == 0) { lblAddError.Text = "Something Went Wrong"; } else { lblAddError.Text = ""; } } catch (Exception) { lblAddError.Text = "Something Went Wrong"; } }
protected void AddCompany_Click(object sender, EventArgs e) { try { CompanyProfile objCompany = new CompanyProfile(); if (fuCompanyImageUrl.HasFile) { byte[] imageBytes = new byte[fuCompanyImageUrl.PostedFile.InputStream.Length + 1]; string filename = Path.GetFileName(fuCompanyImageUrl.PostedFile.FileName); string FName = txtName.Text + "_" + filename; fuCompanyImageUrl.SaveAs(Server.MapPath("~/Company_Images/" + FName)); objCompany.ImageUrl = "~/Company_Images/" + FName; } objCompany.CompanyName = txtName.Text; objCompany.Domain = txtCompanyDomain.Text; objCompany.Address = txtCompanyAddress.Text; objCompany.AboutUs = txtAboutCompany.Text; objCompany.Branches = txtBranches.Text; objCompany.UrlLink = txtCompanyUrl.Text; objCompany.NoofEmp = Convert.ToInt32(txtNoofEmp.Text); objCompany.PhNum = txtCompanyPhNum.Text; objCompany.EmailID = txtCompanyEmailID.Text; objCompany.EmployerID = Convert.ToInt32(Session["ID"].ToString()); objCompany.InsertedDate = DateTime.Now; objCompany.UpdatedDate = DateTime.Now; int i = new AddJobBO().InsertNew<CompanyProfile>(objCompany); if (i == 1) { Response.Redirect("ProfileEmployer.aspx"); } if (i == 0) { lblAddError.Text = "Something Went Wrong"; } else { lblAddError.Text = ""; } } catch (Exception) { throw; } }