public Job getPublicJobById(string intJobId)
        {
            CommonFunctions cf = new CommonFunctions();
            try
            {
                Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
                Business.ApplicationService.jobs sjob = new Business.ApplicationService.jobs();
                sjob = appclient.GetJob(intJobId, "", "", "");

                Job tempjob = new Job();
                tempjob.JobId = sjob.jobid;
                tempjob.JobIDforPublisPartnersList = 0;
                tempjob.JobName = sjob.jobname;
                tempjob.Exp = CommonFunctions.MapIDtoExperience[sjob.expid.ToString()].ToString();
                tempjob.PayRate = sjob.payrate;
                tempjob.PrefSkills = sjob.preferenceskills;
                tempjob.Status = sjob.status;
                tempjob.State = sjob.cityid;
                tempjob.JobLength = sjob.additionaldetails;
                tempjob.Email = sjob.email;
                tempjob.Phone = sjob.phone;
                tempjob.jobdata = sjob.data;
                tempjob.CompanyId = sjob.objectid;
                try
                {
                    tempjob.ExpiryDate = new DateTime(Convert.ToInt32(sjob.endyear), Convert.ToInt32(sjob.endmonth), Convert.ToInt32(sjob.enddate));
                }
                catch (Exception enddatexception)
                {

                    string strdatexceptioninfo = enddatexception.Message;
                }
                try
                {
                    tempjob.StartDate = new DateTime(Convert.ToInt32(sjob.startyear), Convert.ToInt32(sjob.startmonth), Convert.ToInt32(sjob.startdate));
                }
                catch (Exception strdatexception)
                {

                    string strdatexceptioninfo = strdatexception.Message;
                }
                tempjob.jobmailstatus = sjob.emailstatus;
                try
                {
                    tempjob.createddate = DateTime.Parse(sjob.createddate);
                }
                catch (Exception createddatexception)
                {

                    string strdatexceptioninfo = createddatexception.Message;
                }
                tempjob.JobDesc = sjob.jobdescription;
                tempjob.additionaldetails = sjob.additionaldetails;
                try
                {
                    tempjob.postype = CommonFunctions.MapIDtoPosition[sjob.positiontype].ToString();
                }
                catch { }

                return tempjob;

            }

            catch { throw; }
        }
        public List<Job> getJobDetailsByJobId(string intJobId, string companyid)
        {
            CommonFunctions cf = new CommonFunctions();
            try
            {
                Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
                Business.ApplicationService.jobs sjob = new Business.ApplicationService.jobs();
                sjob = appclient.GetJob(intJobId, "", "", companyid);

                Job tempjob = new Job();

                tempjob.JobId = sjob.jobid;
                tempjob.JobIDforPublisPartnersList = 0;
                tempjob.JobName = sjob.jobname;
                tempjob.Exp = CommonFunctions.MapIDtoExperience[sjob.expid.ToString()].ToString();
                tempjob.PayRate = sjob.payrate;
                tempjob.PrefSkills = sjob.preferenceskills;
                tempjob.Status = sjob.status;
                tempjob.State = sjob.cityid;
                tempjob.JobLength = sjob.additionaldetails;
                tempjob.Email = sjob.email;
                tempjob.Phone = sjob.phone;
                tempjob.jobdata = sjob.data;
                UI.Models.Job Objob = Newtonsoft.Json.JsonConvert.DeserializeObject<UI.Models.Job>(sjob.data);
                tempjob.payratemax = Objob.payratemax;
                tempjob.payratemode = Objob.payratemode;
                tempjob.Travel = Objob.Travel;
                tempjob.payratenegotaible = Objob.payratenegotaible;

                try
                {
                    tempjob.ExpiryDate = new DateTime(Convert.ToInt32(sjob.endyear), Convert.ToInt32(sjob.endmonth), Convert.ToInt32(sjob.enddate));
                }
                catch (Exception enddatexception)
                {

                    string strdatexceptioninfo = enddatexception.Message;
                }
                try
                {
                    tempjob.StartDate = new DateTime(Convert.ToInt32(sjob.startyear), Convert.ToInt32(sjob.startmonth), Convert.ToInt32(sjob.startdate));
                }
                catch (Exception strdatexception)
                {

                    string strdatexceptioninfo = strdatexception.Message;
                }
                tempjob.jobmailstatus = sjob.emailstatus;
                try
                {
                    tempjob.createddate = DateTime.Parse(sjob.createddate);
                }
                catch (Exception createddatexception)
                {

                    string strdatexceptioninfo = createddatexception.Message;
                }
                tempjob.JobDesc = sjob.jobdescription;
                tempjob.additionaldetails = sjob.additionaldetails;
                try
                {
                    string[] jobpositioncodearray = sjob.positiontype.Split(',');
                    foreach (string positioncode in jobpositioncodearray)
                    {
                        if (tempjob.postype == "")
                        {
                            tempjob.postype = CommonFunctions.MapIDtoPosition[positioncode].ToString();
                            tempjob.PositionType.Add(CommonFunctions.MapIDtoPosition[positioncode].ToString());
                        }
                        else
                        {
                            tempjob.postype = tempjob.postype + "," +CommonFunctions.MapIDtoPosition[positioncode].ToString();
                            tempjob.PositionType.Add(CommonFunctions.MapIDtoPosition[positioncode].ToString());
                        }
                    }

                }
                catch { tempjob.postype = CommonFunctions.MapIDtoPosition[sjob.positiontype].ToString(); }

                List<Job> jobslist = new List<Job>();

                jobslist.Add(tempjob);
                //}

                return jobslist;

            }

            catch { throw; }
        }