public bool UpdateJob(string jobid, string categoryid, string subcategoryid, string jobname, string jobdescription, string payrate, string preferenceskills, string positiontype, string cityid,
                              string startdate, string startmonth, string startyear, string enddate, string endmonth, string endyear, int expid, int publish, string objecttype, string email, string phone, string partnerslist, string data, string additionaldetails)
        {
            Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
            bool stat = appclient.UpdateJob(jobid, categoryid, subcategoryid, jobname, jobdescription, payrate, preferenceskills, positiontype, cityid,
                                            startdate, startmonth, startyear, enddate, endmonth, endyear,
                                            expid, publish, Session["companyid"].ToString(), objecttype, email, phone, partnerslist, data, additionaldetails);

            return(stat);
        }
        public ActionResult Edit(UI.Models.Job editedjob)
        {
            Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
            int CompID    = 1;
            int CatId     = 1;
            int stateId   = 1;
            int Expcodeid = 1;

            Expcodeid = Convert.ToInt32(CommonFunctions.MapExperiencetoID[editedjob.Exp].ToString());


            // string PositionTypeId = CommonFunctions.MapPositiontoID[editedjob.postype].ToString();

            string[] postypearray   = editedjob.postype.Split(',');
            string   PositionTypeId = "";

            if (postypearray.Length > 0)
            {
                foreach (string postype in postypearray)
                {
                    if (PositionTypeId == "")
                    {
                        PositionTypeId = CommonFunctions.MapPositiontoID[postype].ToString();
                    }
                    else
                    {
                        PositionTypeId = PositionTypeId + "," + CommonFunctions.MapPositiontoID[postype].ToString();
                    }
                }
            }


            editedjob.ModifiedDate = DateTime.Now;

            editedjob.StartDate = DateTime.Now;
            //string[] startdatearray = DateTime.Now.ToString().Split('/');
            // string startdate = new DateTime(Convert.ToInt32(startdatearray[2]), Convert.ToInt32(startdatearray[0]), Convert.ToInt32(startdatearray[1])).ToString("yyyy-MM-dd HH:mm:ss");
            string[] expdatearray = editedjob.ExpDate.Split('/');
            string   expdt        = new DateTime(Convert.ToInt32(expdatearray[2]), Convert.ToInt32(expdatearray[0]), Convert.ToInt32(expdatearray[1])).ToString("yyyy-MM-dd HH:mm:ss");

            editedjob.jobdata = Newtonsoft.Json.JsonConvert.SerializeObject(editedjob);
            editedjob.Publish = 1;
            editedjob.PayRate = editedjob.PayRate + "-" + editedjob.payratemax;
            bool stat = appclient.UpdateJob(editedjob.JobId, editedjob.CatId, editedjob.SubId, editedjob.JobName, editedjob.JobDesc, editedjob.PayRate, editedjob.PrefSkills, PositionTypeId, editedjob.State,
                                            editedjob.StartDate.Day.ToString(), editedjob.StartDate.Month.ToString(), editedjob.StartDate.Year.ToString(), expdatearray[1], expdatearray[0], expdatearray[2],
                                            Expcodeid, (int)editedjob.Publish, Session["companyid"].ToString(), "jobpost", editedjob.Email, editedjob.Phone, "", editedjob.jobdata, editedjob.additionaldetails);

            return(RedirectToAction("show", "jobs", new { jobid = editedjob.JobId }));
        }
 public bool UpdateJob(string jobid, string categoryid, string subcategoryid, string jobname, string jobdescription, string payrate, string preferenceskills, string positiontype, string cityid,
         string startdate, string startmonth, string startyear, string enddate, string endmonth, string endyear, int expid, int publish, string objecttype, string email, string phone, string partnerslist, string data, string additionaldetails)
 {
     Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
     bool stat = appclient.UpdateJob(jobid, categoryid, subcategoryid, jobname, jobdescription, payrate, preferenceskills, positiontype, cityid,
         startdate, startmonth, startyear, enddate, endmonth, endyear,
         expid, publish, Session["companyid"].ToString(), objecttype, email, phone, partnerslist, data, additionaldetails);
     return stat;
 }
        public ActionResult Edit(UI.Models.Job editedjob)
        {
            Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient();
            int CompID = 1;
            int CatId = 1;
            int stateId = 1;
            int Expcodeid = 1;
            Expcodeid = Convert.ToInt32(CommonFunctions.MapExperiencetoID[editedjob.Exp].ToString());

            // string PositionTypeId = CommonFunctions.MapPositiontoID[editedjob.postype].ToString();

            string[] postypearray = editedjob.postype.Split(',');
            string PositionTypeId = "";
            if (postypearray.Length > 0)
            {
                foreach (string postype in postypearray)
                {
                    if (PositionTypeId == "")
                    { PositionTypeId = CommonFunctions.MapPositiontoID[postype].ToString(); }
                    else
                    {
                        PositionTypeId = PositionTypeId + "," + CommonFunctions.MapPositiontoID[postype].ToString();
                    }
                }
            }

            editedjob.ModifiedDate = DateTime.Now;

            editedjob.StartDate = DateTime.Now;
            //string[] startdatearray = DateTime.Now.ToString().Split('/');
            // string startdate = new DateTime(Convert.ToInt32(startdatearray[2]), Convert.ToInt32(startdatearray[0]), Convert.ToInt32(startdatearray[1])).ToString("yyyy-MM-dd HH:mm:ss");
            string[] expdatearray = editedjob.ExpDate.Split('/');
            string expdt = new DateTime(Convert.ToInt32(expdatearray[2]), Convert.ToInt32(expdatearray[0]), Convert.ToInt32(expdatearray[1])).ToString("yyyy-MM-dd HH:mm:ss");

            editedjob.jobdata = Newtonsoft.Json.JsonConvert.SerializeObject(editedjob);
            editedjob.Publish = 1;
            editedjob.PayRate = editedjob.PayRate + "-" + editedjob.payratemax;
            bool stat = appclient.UpdateJob(editedjob.JobId, editedjob.CatId, editedjob.SubId, editedjob.JobName, editedjob.JobDesc, editedjob.PayRate, editedjob.PrefSkills, PositionTypeId, editedjob.State,
                editedjob.StartDate.Day.ToString(), editedjob.StartDate.Month.ToString(), editedjob.StartDate.Year.ToString(), expdatearray[1], expdatearray[0], expdatearray[2],
                Expcodeid, (int)editedjob.Publish, Session["companyid"].ToString(), "jobpost", editedjob.Email, editedjob.Phone, "", editedjob.jobdata, editedjob.additionaldetails);
            return RedirectToAction("show", "jobs", new { jobid = editedjob.JobId });
        }