Exemple #1
0
        public void gvJobApplyBind()
        {
            try
            {
                SearchDetails objSearch = new SearchDetails();
                objSearch.lstSkill = ddlSkillSetSel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                objSearch.lstCountry = ddlCountrySel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                objSearch.lstState = ddlStateSel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                objSearch.lstCity = ddlCitySel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                gvJobApply.DataSource = new AddJobBO().ListVacancy(objSearch);
                gvJobApply.DataBind();
                if (gvJobApply.PageCount > 0)
                {
                }
                else
                {
                    lblNoJob.Text = "No Records Found for your Search Query";
                }
            }
            catch (Exception)
            {

                lblErr.Text = "Something Went Wrong";
            }
        }
 public void bind()
 {
     try
     {
         SearchDetails objS = new SearchDetails();
         objS.EmpID = Convert.ToInt32(Session["ID"].ToString());
         //   gvJobList.DataSource = new AddJobBO().ListVacancy(objS);
         //   gvJobList.DataBind();
         gvSeekersList.DataSource = new JobAppliedBO().ListOfSeekersApplied(objS.EmpID);
         gvSeekersList.DataBind();
         if (gvSeekersList.PageCount > 0)
         {
             lblProError.Text = "";
         }
         #region Using
         //using (JobASPContext context = new JobASPContext())
         //{
         //    int Empid = Convert.ToInt32(Session["ID"].ToString());
         //    gvJobList.DataSource = context.Vacancies.Where(c => c.EmpId == Empid).ToList();
         //    gvJobList.DataBind();
         //}
         #endregion
     }
     catch (Exception)
     {
         lblProError.Text = "Something Went Wrong";
     }
 }
 public void bind()
 {
     SearchDetails objS = new SearchDetails();
     objS.JobID = Request.QueryString["JobID"] != null ? Convert.ToInt32(Request.QueryString["JobID"]) : 1;
     rptJobDetails.DataSource = new AddJobBO().ListrptVacancy(objS);
     rptJobDetails.DataBind();
 }
        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);
            }
        }
        public void AppliedBind()
        {
            try
            {
                SearchDetails objDetails = new SearchDetails();
                objDetails.ID = Convert.ToInt32(Session["ID"].ToString());
                gvAppliedJobs.DataSource = new JobAppliedBO().ListApplied(objDetails);
                gvAppliedJobs.DataBind();
            }
            catch (Exception)
            {

                lblProSeeker.Text = "Something Went Wrong";
            }
        }
Exemple #6
0
 public void GridBind()
 {
     try
     {
         SearchDetails objSearch = new SearchDetails();
        // string[] arg = ddlSkillSet.SelectedItem.Text.Split(new string[] { }, StringSplitOptions.RemoveEmptyEntries).ToArray();
         objSearch.lstSkill = ddlSkillSetSel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
         objSearch.lstCountry = ddlCountrySel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
         objSearch.lstState = ddlStateSel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
         objSearch.lstCity = ddlCitySel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
         gvListSeeker.DataSource = new AddJobBO().ListData(objSearch);
         #region Search
         //    Search objS = new Search();
     //    objS.Skill = ddlSkillSet.SelectedItem.Text;
     //    if (ddlState.SelectedItem.Text != "Select")
     //    {
     //        if (ddlCity.SelectedItem.Text != "Select")
     //        {
     //            objS.Place = ddlCity.SelectedItem.Text;
     //            gvListSeeker.DataSource = new AddJobBO().ListAllSeekersByCity(objS);
     //        }
     //        else
     //        {
     //            objS.Place = ddlState.SelectedItem.Text;
     //            gvListSeeker.DataSource = new AddJobBO().ListAllSeekersByState(objS);
     //        }
     //    }
     //    else
     //    {
     //        gvListSeeker.DataSource = new AddJobBO().ListAllSeekersBySkill(objS);
         //    }
         #endregion
         gvListSeeker.DataBind();
         if (gvListSeeker.PageCount > 0)
         {
             lblGrid.Text = "";
         }
         else
         {
             lblGrid.Text = "No data Found for your Search";
         }
     }
     catch (Exception)
     {
         lblGrid.Text = "No data Found for your Search";
     }
 }
Exemple #7
0
 public List<JobApplied> ListApplied(SearchDetails objDetails)
 {
     var objList = _unitOfWork.Repository<JobApplied>().GetAll();
     if (objDetails.ID != 0)
     {
         objList = objList.Where(c => c.SeekerID == objDetails.ID);
     }
     if (objDetails.Country!=0)
     {
         objList = objList.Where(c => c.Country == objDetails.Country);
     }
     if (objDetails.State!=0)
     {
         objList = objList.Where(c => c.State == objDetails.State);
     }
     if (objDetails.City!=0)
     {
         objList = objList.Where(c => c.City == objDetails.City);
     }
     return objList.ToList();
 }
        //public void BindCountry()
        //{
        //    ddlProSCountry.DataSource = new DDLDataBO().GetCountries();
        //    ddlProSCountry.DataTextField = "CountryName";
        //    ddlProSCountry.DataValueField = "CountryID";
        //    ddlProSCountry.DataBind();
        //    ddlProSCountry.Items.Insert(0, "Select");
        //    #region Using
        //    //using (DataLayer.JobASPContext context = new DataLayer.JobASPContext())
        //    //{
        //    //    ddlCountry.DataSource = context.Countries.ToList();
        //    //    ddlCountry.DataTextField = "CountryName";
        //    //    ddlCountry.DataValueField = "CountryID";
        //    //    ddlCountry.DataBind();
        //    //    ddlCountry.Items.Insert(0,"Select");
        //    //}
        //    #endregion
        //}
        //public void BindState()
        //{
        //    try
        //    {
        //        if (ddlProSCountry.SelectedItem.Text != "Select")
        //        {
        //            int Val = Convert.ToInt32(ddlProSCountry.SelectedValue);
        //            ddlProSState.DataSource = new DDLDataBO().GetStates(Val);
        //            ddlProSState.DataTextField = "StateName";
        //            ddlProSState.DataValueField = "StateID";
        //            ddlProSState.DataBind();
        //            ddlProSState.Items.Insert(0, "Select");
        //        }
        //        else
        //        {
        //            ddlProSState.Items.Clear();
        //            ddlProSCity.Items.Clear();
        //        }
        //    }
        //    catch (Exception)
        //    {
        //        lblProSeeker.Text = "Something went wrong";
        //    }
        //    #region Using
        //    //using (DataLayer.JobASPContext context = new DataLayer.JobASPContext())
        //    //{
        //    //    if (ddlCountry.SelectedItem.Text != "Select")
        //    //    {
        //    //        int Val = Convert.ToInt32(ddlCountry.SelectedValue);
        //    //        ddlState.DataSource = context.States.Where(c => c.CountryID == Val).ToList();
        //    //        ddlState.DataTextField = "StateName";
        //    //        ddlState.DataValueField = "StateID";
        //    //        ddlState.DataBind();
        //    //        ddlState.Items.Insert(0, "Select");
        //    //    }
        //    //    else
        //    //    {
        //    //        ddlState.Items.Clear();
        //    //        ddlCity.Items.Clear();
        //    //    }
        //    //}
        //    #endregion
        //}
        //public void BindCity()
        //{
        //    try
        //    {
        //        if (ddlProSState.SelectedItem.Text != "Select")
        //        {
        //            int Val = Convert.ToInt32(ddlProSState.SelectedValue);
        //            ddlProSCity.DataSource = new DDLDataBO().GetCities(Val);
        //            ddlProSCity.DataTextField = "CityName";
        //            ddlProSCity.DataValueField = "CityID";
        //            ddlProSCity.DataBind();
        //            ddlProSCity.Items.Insert(0, "Select");
        //        }
        //        else
        //        {
        //            ddlProSCity.Items.Clear();
        //        }
        //    }
        //    catch (Exception)
        //    {
        //        lblProSeeker.Text = "Something went wrong";
        //    }
        //    #region Using
        //    //using (DataLayer.JobASPContext context = new DataLayer.JobASPContext())
        //    //{
        //    //    if (ddlState.SelectedItem.Text!="Select")
        //    //    {
        //    //        int Val = Convert.ToInt32(ddlState.SelectedValue);
        //    //        ddlCity.DataSource = context.Cities.Where(c => c.StateID == Val).ToList();
        //    //        ddlCity.DataTextField = "CityName";
        //    //        ddlCity.DataValueField = "CityID";
        //    //        ddlCity.DataBind();
        //    //        ddlCity.Items.Insert(0, "Select");
        //    //    }
        //    //    else
        //    //    {
        //    //        ddlCity.Items.Clear();
        //    //    }
        //    //}
        //    #endregion
        //}
        public void bind()
        {
            try
            {
                int ID = Convert.ToInt32(Session["ID"].ToString());
                SearchDetails objSearch = new SearchDetails();
                objSearch.ID = ID;
                objSearch.lstSkill = ddlSkillSetSel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                objSearch.lstCountry = ddlCountrySel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                objSearch.lstState = ddlStateSel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                objSearch.lstCity = ddlCitySel.Items.Cast<ListItem>().Where(l => l.Selected).Select(l => l.Value).ToList().Select(int.Parse).ToList();
                gvJobApply.DataSource = new AddJobBO().ListVacancy(objSearch);
                #region Code
                //Search objs = new Search();
                //objs.ID = ID;
                //objs.Skill = ddlProSSkill.SelectedItem.Text;
                //if (ddlState.SelectedItem.Text != "Select")
                //{
                //    if (ddlCity.SelectedItem.Text != "Select")
                //    {
                //        objs.Place = ddlCity.SelectedItem.Text;
                //        gvJobApply.DataSource = new AddJobBO().ListOfJobsbyCitySkill(objs);
                //    }
                //    else
                //    {
                //        objs.Place = ddlState.SelectedItem.Text;
                //        gvJobApply.DataSource = new AddJobBO().ListOfJobsbyStateSkill(objs);
                //    }
                //}
                //else
                //{
                //    gvJobApply.DataSource = new AddJobBO().ListAllJobsSkill(objs);
                //}
                #endregion
                gvJobApply.DataBind();
                if (gvJobApply.PageCount > 0)
                {
                    lblNoJob.Text = "Jobs For your Search";
                    btngvApply.Visible = true;
                }
                else
                {
                    lblNoJob.Text = "No jobs Found for your Search";
                    btngvApply.Visible = false;
                }
                #region Using
                //using (JobASPContext context = new JobASPContext())
                //{
                //int SeekerID = Convert.ToInt32(Session["ID"].ToString());
                //List<Vacancy> ObjList = context.Vacancies.ToList();
                //var objList2 = context.JobApplies.Where(c => c.SeekerID == SeekerID).ToList();
                //gvJobApply.DataSource = context.Vacancies.ToList();
                //gvJobApply.DataBind();
                //gvAppliedJobs.DataSource = context.JobApplies.Where(c => c.SeekerID == SeekerID).ToList();
                //gvAppliedJobs.DataBind();
                #region Prac
                // gvJobApply.DataSource = context.Vacancies.Join(objList2, b => b.JobID, c => c.JobID, (b, c) => b.JobID != c.JobID).Skip(3);
                // gvJobApply.DataSource = context.Vacancies.Join(context.JobApplies.Where(c => c.SeekerID == SeekerID), b => b.JobID, c => c.JobID, (b, c) => b).ToList();
                //gvJobApply.DataSource=from j in context.Vacancies
                //                      join  aj in aj.JobID !=j.JobID
                //                      on where aj.SeekerID ==  SeekerID;
                //var exceptionList = context.JobApplies.Where(c=>c.SeekerID == SeekerID)
                //                                 .Select(e=>e);
                //var query = context.Vacancies
                //                      .Select(e => e)
                //                      .Where(e => !exceptionList.Contains(e.JobID));
                //var query = from w in context.Vacancies
                //              join c in context.JobApplies
                //              on w.JobID  equals  c.JobID
                //              where
                //              select w;
                //gvJobApply.DataSource = query1.ToList();
                #endregion
                //}
                #endregion

            }
            catch (Exception)
            {
                lblProSeeker.Text = "Something Went Wrong";
            }
        }