private void BindCountries(grouponjobsdevEntities context) { foreach (Country r in context.Countries.ToList()) { ddlCountry.Items.Add(new ListItem { Value = r.CountryId.ToString(), Text = r.Name }); } }
public IQueryable<Candidate> GetRecords(int maximumRows, int startRowIndex, string candidatename, string city, string requisition, string workflow, string willtravel, string lastsalary, string expectedsalary, string disposition, string rating) { int cityint, requisitionint, willtravelint, dispositionint, ratingint; decimal lastsalaryint, expectedsalaryint; if (string.IsNullOrEmpty(lastsalary)) lastsalary = decimal.MinValue.ToString(); if (string.IsNullOrEmpty(expectedsalary)) expectedsalary = decimal.MinValue.ToString(); cityint = int.Parse(city); requisitionint = int.Parse(requisition); willtravelint = int.Parse(willtravel); lastsalaryint = decimal.Parse(lastsalary); expectedsalaryint = decimal.Parse(expectedsalary); dispositionint = int.Parse(disposition); ratingint = int.Parse(rating); grouponjobsdevEntities context = new grouponjobsdevEntities(); var query = context.Candidates.OrderBy(t => t.FirstName).Where(t => t.FirstName.Length > 1 && (t.FirstName == candidatename || string.IsNullOrEmpty(candidatename)) && (t.City.CityId == cityint || cityint == int.MinValue) && (t.RequisitionId == requisitionint || requisitionint == 0) && (t.WorkFlow == workflow || string.IsNullOrEmpty(workflow)) && (t.WillTravel == willtravelint || willtravelint == int.MinValue) && (t.LastSalary == lastsalaryint || lastsalaryint == decimal.MinValue) && (t.ExpectedSalary == expectedsalaryint || expectedsalaryint == decimal.MinValue) && (t.DispositionId == dispositionint || dispositionint == int.MinValue) && (t.RatingId == ratingint || ratingint == int.MinValue)) .Skip(startRowIndex).Take(maximumRows); return query; }
public int GetCount(string candidatename, string city, string requisition, string workflow, string willtravel, string lastsalary, string expectedsalary, string disposition, string rating) { int cityint, requisitionint, willtravelint, dispositionint, ratingint; decimal lastsalaryint, expectedsalaryint; if (string.IsNullOrEmpty(lastsalary)) lastsalary = decimal.MinValue.ToString(); if (string.IsNullOrEmpty(expectedsalary)) expectedsalary = decimal.MinValue.ToString(); cityint = int.Parse(city); requisitionint = int.Parse(requisition); willtravelint = int.Parse(willtravel); lastsalaryint = decimal.Parse(lastsalary); expectedsalaryint = decimal.Parse(expectedsalary); dispositionint = int.Parse(disposition); ratingint = int.Parse(rating); grouponjobsdevEntities context = new grouponjobsdevEntities(); return context.Candidates.Where(t => t.FirstName.Length > 1 && (t.FirstName == candidatename || string.IsNullOrEmpty(candidatename)) && (t.City.CityId == cityint || cityint == int.MinValue) && (t.RequisitionId == requisitionint || requisitionint == 0) && (t.WorkFlow == workflow || string.IsNullOrEmpty(workflow)) && (t.WillTravel == willtravelint || willtravelint == int.MinValue) && (t.LastSalary == lastsalaryint|| lastsalaryint == decimal.MinValue) && (t.ExpectedSalary == expectedsalaryint || expectedsalaryint == decimal.MinValue) && (t.DispositionId == dispositionint || dispositionint == int.MinValue) && (t.RatingId == ratingint || ratingint == int.MinValue)) .Count(); }
private void BindCategories(grouponjobsdevEntities context) { ddlCategory.Items.Add(new ListItem { Value = "", Text = "Selecione" }); foreach (Category r in context.Categories.ToList()) { ddlCategory.Items.Add(new ListItem { Value = r.CategoryId.ToString(), Text = r.Name }); } }
private void BindJobType(grouponjobsdevEntities context) { ddlJobType.Items.Add(new ListItem { Value = "", Text = "Selecione" }); foreach (Jobtype r in context.Jobtypes.Where(r => r.JobtypeId < 5).ToList()) { ddlJobType.Items.Add(new ListItem { Value = r.JobtypeId.ToString(), Text = r.Name }); } }
private void BindRecruiters(grouponjobsdevEntities context) { ddlRecruiter.Items.Add(new ListItem { Value = "", Text = "Selecione" }); foreach (Recruiter r in context.Recruiters.ToList()) { ddlRecruiter.Items.Add(new ListItem { Value = r.RecruiterId.ToString(), Text = r.Name }); } }
private void BindDisabilities(grouponjobsdevEntities context) { ddlDisability.Items.Add(new ListItem { Value = "", Text = "Selecione" }); foreach (Disability r in context.Disabilities.ToList()) { ddlDisability.Items.Add(new ListItem { Value = r.DisabilityId.ToString(), Text = r.Name }); } }
private void BindRequisitions(grouponjobsdevEntities context) { ddlRequisition.Items.Clear(); ddlRequisition.Items.Add(new ListItem { Value = "0", Text = "Selecione" }); foreach (GrouponJobsDev.DAL.Requisition r in context.Requisitions.ToList()) { ddlRequisition.Items.Add(new ListItem { Value = r.RequisitionId.ToString(), Text = r.Name }); } }
private void BindRating(grouponjobsdevEntities context) { ddlRating.Items.Clear(); ddlRating.Items.Add(new ListItem { Value = int.MinValue.ToString(), Text = "Selecione" }); foreach (GrouponJobsDev.DAL.Candidate_Rating r in context.Candidate_Rating.ToList()) { ddlRating.Items.Add(new ListItem { Value = r.RatingId.ToString(), Text = r.Name }); } }
private void BindCity(grouponjobsdevEntities context) { ddlCity.Items.Clear(); ddlCity.Items.Add(new ListItem { Value = int.MinValue.ToString(), Text = "Selecione" }); foreach (GrouponJobsDev.DAL.City r in context.Cities.OrderBy(c => c.Name).ToList()) { ddlCity.Items.Add(new ListItem { Value = r.CityId.ToString(), Text = r.Name }); } }
protected void BindDDLs() { using (grouponjobsdevEntities context = new grouponjobsdevEntities()) { if (!IsPostBack) { BindState(context); BindRecruiters(context); BindCategories(context); BindJobType(context); BindDisponibilidade(); } BindCity(context,ddlState.SelectedValue); } }
protected void Page_Load(object sender, EventArgs e) { using (grouponjobsdevEntities context = new grouponjobsdevEntities()) { if (!IsPostBack) { BindCity(context); BindDisposition(context); BindRating(context); BindRequisitions(context); BindWorkFLow(); BindWillTravel(); lblSearchResult.Text = "Todos os Candidatos:"; } else lblSearchResult.Text = "Resultado da Busca:"; } }
private void BindCity(grouponjobsdevEntities context, string StateId) { ddlCity.Items.Clear(); List<City> Cities = context.Cities.ToList(); if (!string.IsNullOrEmpty(StateId)) { ddlCity.Items.Add(new ListItem { Value = "", Text = "Selecione a Cidade" }); Cities = Cities.Where(c => c.StateId == int.Parse(StateId)).ToList(); foreach (City r in Cities) { ddlCity.Items.Add(new ListItem { Value = r.CityId.ToString(), Text = r.Name }); } } else { ddlCity.Items.Add(new ListItem { Value = "", Text = "Selecione o Estado" }); } }
protected void BindDDLs() { using (grouponjobsdevEntities context = new grouponjobsdevEntities()) { if (!IsPostBack) { BindRequisitions(context); BindCountries(context); BindState(context, ddlCountry.SelectedValue); BindMaritalStatus(context); BindDisabilities(context); BindLanguages(); BindWillTravel(); BindGender(); } BindCity(context, ddlState.SelectedValue); } }
private void BindState(grouponjobsdevEntities context) { List<State> States = context.States.ToList(); ddlState.Items.Add(new ListItem { Value = "", Text = "Selecione"}); foreach (State r in States) { ddlState.Items.Add(new ListItem { Value = r.StateId.ToString(), Text = r.Name }); } }
private void BindMaritalStatus(grouponjobsdevEntities context) { ddlMaritalStatus.Items.Add(new ListItem { Value = "", Text = "Selecione" }); foreach (MaritalStatu r in context.MaritalStatus.ToList()) { ddlMaritalStatus.Items.Add(new ListItem { Value = r.MaritalStatusId.ToString(), Text = r.Name }); } }
private void BindRequisitions(grouponjobsdevEntities context) { ddlRequisition.Items.Add(new ListItem { Value = "", Text = "Selecione" }); foreach (GrouponJobsDev.DAL.Requisition r in context.Requisitions.Where(t => t.Status == "Open").OrderBy(t => t.Name).ToList()) { ddlRequisition.Items.Add(new ListItem { Value = r.RequisitionId.ToString(), Text = r.Name }); } }
private void BindState(grouponjobsdevEntities context, string CountryId) { List<State> States = context.States.ToList(); if (!string.IsNullOrEmpty(CountryId)) { ddlState.Items.Clear(); ddlState.Items.Add(new ListItem { Value = "", Text = "Selecione o Estado" }); States = States.Where(s => s.CountryId == int.Parse(CountryId)).ToList(); foreach (State r in States) { ddlState.Items.Add(new ListItem { Value = r.StateId.ToString(), Text = r.Name }); } } else { ddlState.Items.Clear(); ddlState.Items.Add(new ListItem { Value = "", Text = "Selecione o País" }); } }