public ActionResult Edit(string id)
        {
            if (Session["OrganizationGUID"] != null)
            {
                DropdownValues();
                Jschema = new JobForm();
                jobPageList.Clear();
                jobItemList.Clear();
                Jschema = _IJobSchemaRepository.JobSchemaDetails(new Guid(id));
                JobSchemaModel jobschemamodel = new JobSchemaModel();
                jobschemamodel.JobLogicalID = Jschema.JobFormGUID.ToString();
                jobschemamodel.OrganizationGUID = Jschema.OrganizationGUID != null ? Jschema.OrganizationGUID.ToString() : Guid.Empty.ToString();
                jobschemamodel.LastModifiedBy = Jschema.LastModifiedBy != null ? Jschema.LastModifiedBy.ToString() : Guid.Empty.ToString();
                jobschemamodel.LastModifiedDate = Convert.ToDateTime(Jschema.LastModifiedDate);
                jobschemamodel.JobSchemaName = Jschema.FriendlyName;
                // jobschemamodel.EstimatedDuration = Jschema.EstimatedDuration;
                // jobschemamodel.GroupCode = Jschema.GroupCode.ToString();
                jobschemamodel.IsDeleted = Convert.ToBoolean(Jschema.IsDeleted);
                jobschemamodel.JobClass = Jschema.JobClass;

                ViewBag.JobLogicalID = Jschema.JobFormGUID.ToString();
                ViewData["JobName"] = Jschema.FriendlyName;
                ViewData["JobClass"] = Jschema.JobClass == null ? 0 : Jschema.JobClass;// Jschema.Description;
                ViewData["GroupCode"] = "";// Jschema.GroupCode;
                ViewData["GroupName"] = "";// _IGroupRepository.GetGroupByID(Jschema.GroupCode).Name;
                ViewData["EstimatedDuration"] = "";// Jschema.EstimatedDuration;
                ViewBag.BasicDetails = "true";


                JobFormModel jobFormModel = new JavaScriptSerializer().Deserialize<JobFormModel>(Jschema.JobForm1);
                jobPageList = jobFormModel.JobPageList;
                jobItemList = jobFormModel.JobItemList;

                JobSchemaEditView jobschemaedit = new JobSchemaEditView();
                jobschemaedit.JobPageSchemaModel = jobPageList;
                jobschemaedit.JobPageItemModel = jobItemList;
                jobschemaedit.JobSchemaModel = jobschemamodel;

                return View(jobschemaedit);
            }
            else
            {
                return RedirectToAction("SessionTimeOut", "User");
            }
        }
        //
        // GET: /Job/
        public ActionResult Index(string id = "")
        {
            Logger.Debug("Inside Job Controller- Index");
            try
            {
                if (Session["OrganizationGUID"] != null)
                {
                    DropdownValues();
                    var jobSchemaList = new JobSchemaViewModel();
                    jobSchemaList.JobSchemaModel = new List<JobSchemaModel>();
                    var appJobSchema = new List<JobForm>();
                    // if (string.IsNullOrEmpty(id))
                    {
                        appJobSchema = _IJobSchemaRepository.GetJobSchema(new Guid(Session["OrganizationGUID"].ToString())).ToList();
                    }
                    //else
                    //{
                    //    appJobSchema = _IJobSchemaRepository.GetJobSchemabyGroupCode(new Guid(id)).ToList();
                    //}
                    foreach (var jobshcema in appJobSchema.ToList())
                    {
                        JobSchemaModel pJobSchemaModel = new JobSchemaModel();

                        pJobSchemaModel.JobLogicalID = jobshcema.JobFormGUID.ToString();
                        pJobSchemaModel.OrganizationGUID = jobshcema.OrganizationGUID != null ? jobshcema.OrganizationGUID.ToString() : Guid.Empty.ToString();
                        pJobSchemaModel.JobSchemaName = jobshcema.FriendlyName;
                        // GroupCode = "",//jobshcema.GroupCode.ToString(),

                        pJobSchemaModel.LastModifiedDate = Session["TimeZoneID"] != null ? Convert.ToDateTime(_IUserRepository.GetLocalDateTime(jobshcema.LastModifiedDate, Session["TimeZoneID"].ToString())) : Convert.ToDateTime(jobshcema.LastModifiedDate);
                        pJobSchemaModel.LastModifiedDateTime = pJobSchemaModel.LastModifiedDate.ToString("MM/dd/yy hh:mm tt");
                        pJobSchemaModel.LastModifiedBy = jobshcema.LastModifiedBy.ToString();
                        //  EstimatedDuration = jobshcema.EstimatedDuration


                        jobSchemaList.JobSchemaModel.Add(pJobSchemaModel);
                    }
                    StringBuilder sb = new StringBuilder();
                    sb.Append("<div class='actions'>");
                    sb.Append("<div class='btn-group'>");
                    //if (!string.IsNullOrEmpty(id))
                    //{
                    //    sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>" + _IGroupRepository.GetGroupNameByGroupGUID(new Guid(id)) + " <i class='icon-angle-down'></i></a>");
                    //}
                    //else
                    {
                        sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>Worker Group <i class='icon-angle-down'></i></a>");
                    }
                    sb.Append("<ul id='ulworkgroup' class='dropdown-menu pull-left'>");
                    sb.Append("<li><a href=" + Url.Action("Index", new { id = "" }) + ">All</a></li>");
                    //List<Group> GroupList = _IGroupRepository.GetGroupByOrganizationGUID(new Guid(Session["OrganizationGUID"].ToString())).ToList();
                    //foreach (Group item in GroupList)
                    //{

                    //    sb.Append("<li><a href=" + Url.Action("Index", new { id = item.GroupGUID.ToString() }) + " data-groupguid=" + item.GroupGUID + ">" + item.Name + "</a></li>");
                    //}
                    sb.Append("</ul>");
                    sb.Append("</div>");
                    sb.Append("</div>");
                    ViewBag.Group = sb.ToString();
                    return View(jobSchemaList.JobSchemaModel.AsEnumerable());
                }
                else
                {
                    return RedirectToAction("SessionTimeOut", "User");
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
                return RedirectToAction("Login", "User");

            }
        }
        public ActionResult Create(JobSchemaModel jobschema)
        {
            Logger.Debug("Inside Job Controller- Create HttpPost");
            try
            {
                if (Session["OrganizationGUID"] != null)
                {
                    DropdownValues();
                    if (ModelState.IsValid)
                    {
                        Jschema = new JobForm();
                        jobPageList.Clear();
                        jobItemList.Clear();
                        Jschema.JobFormGUID = Guid.NewGuid();
                        Jschema.FriendlyName = jobschema.JobSchemaName;
                        Jschema.IsActive = true;
                        Jschema.JobClass = jobschema.JobClass;
                        Jschema.Skill = "";// new Guid(jobschema.GroupCode);
                        //Jschema.EstimatedDuration = jobschema.EstimatedDuration;
                        Jschema.OrganizationGUID = new Guid(Session["OrganizationGUID"].ToString());
                        Jschema.LastModifiedBy = new Guid(Session["UserGUID"].ToString());
                        Jschema.IsDeleted = false;
                        Jschema.LastModifiedDate = Convert.ToDateTime(DateTime.UtcNow);

                        ViewBag.JobLogicalID = Jschema.JobFormGUID.ToString();
                        ViewData["JobName"] = jobschema.JobSchemaName;
                        ViewData["JobClass"] = jobschema.JobClass;
                        // ViewData["GroupCode"] = jobschema.GroupCode;
                        ViewData["GroupName"] = "";// _IGroupRepository.GetGroupByID(new Guid(jobschema.GroupCode)).Name;
                        ViewData["EstimatedDuration"] = "";// jobschema.EstimatedDuration;
                        ViewBag.BasicDetails = "true";



                    }

                    return View(jobschema);
                }
                else
                {
                    return RedirectToAction("SessionTimeOut", "User");
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
                return View(jobschema);
            }
        }