//public int Save() //{ // return context.SaveChanges(); //} //public void InsertJobItemSchema(JobItemSchema JobItemSchema) //{ // context.JobItemSchema.Add(JobItemSchema); //} //public void InsertJobPageSchema(JobPageSchema JobPageSchema) //{ // context.JobPageSchema.Add(JobPageSchema); //} public int InsertJobSchema(JobForm JobForm) { //context.JobForms.Add(JobForm); SqlParameter[] Param = new SqlParameter[11]; Param[0] = new SqlParameter("@pJobFormGUID", SqlDbType.UniqueIdentifier); Param[0].Value = JobForm.JobFormGUID; Param[1] = new SqlParameter("@pOrganizationGUID", SqlDbType.UniqueIdentifier); Param[1].Value = (object)JobForm.OrganizationGUID ?? DBNull.Value; Param[2] = new SqlParameter("@pSkill", SqlDbType.NVarChar, -1); Param[2].Value = (object)JobForm.Skill ?? DBNull.Value; Param[3] = new SqlParameter("@pJobClass", SqlDbType.SmallInt); Param[3].Value = (object)JobForm.JobClass ?? DBNull.Value; Param[4] = new SqlParameter("@pLocationType", SqlDbType.SmallInt); Param[4].Value = (object)JobForm.LocationType ?? DBNull.Value; Param[5] = new SqlParameter("@pIsActive", SqlDbType.Bit); Param[5].Value = (object)JobForm.IsActive ?? DBNull.Value; Param[6] = new SqlParameter("@pIsDeleted", SqlDbType.Bit); Param[6].Value = (object)JobForm.IsDeleted ?? DBNull.Value; Param[7] = new SqlParameter("@pFriendlyName", SqlDbType.NVarChar, 50); Param[7].Value = (object)JobForm.FriendlyName ?? DBNull.Value; Param[8] = new SqlParameter("@pJobForm1", SqlDbType.Text); Param[8].Value = (object)JobForm.JobForm1 ?? DBNull.Value; Param[9] = new SqlParameter("@pLastModifiedDate", SqlDbType.DateTime); Param[9].Value = (object)JobForm.LastModifiedDate ?? DBNull.Value; Param[10] = new SqlParameter("@pLastModifiedBy", SqlDbType.UniqueIdentifier); Param[10].Value = (object)JobForm.LastModifiedBy ?? DBNull.Value; return context.Database.ExecuteSqlCommand("insert into JobForms(JobFormGUID,OrganizationGUID,Skill,JobClass,LocationType,IsActive,IsDeleted,FriendlyName," + "JobForm1,LastModifiedDate,LastModifiedBy)values(@pJobFormGUID,@pOrganizationGUID,@pSkill,@pJobClass,@pLocationType,@pIsActive,@pIsDeleted,@pFriendlyName," + "@pJobForm1,@pLastModifiedDate,@pLastModifiedBy)", Param); }
public ActionResult ViewSchema(string id = "") { Logger.Debug("Inside Job Controller- View Job"); try { if (Session["OrganizationGUID"] != null) { DropdownValues(); Jschema = new JobForm(); jobPageList.Clear(); jobItemList.Clear(); Jschema = _IJobSchemaRepository.JobSchemaDetails(new Guid(id)); ViewBag.JobName = Jschema.FriendlyName; 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 = null; return View(jobschemaedit); } else { return RedirectToAction("SessionTimeOut", "User"); } } catch (Exception ex) { Logger.Error(ex.Message); if (Session["UserType"] != null && Session["UserType"].ToString() != "ENT_A") return RedirectToAction("../JobStatus/Index"); else return RedirectToAction("Index"); } }
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); } }
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"); } }
public ActionResult Create() { if (Session["OrganizationGUID"] != null) { DropdownValues(); jobPageList.Clear(); jobItemList.Clear(); Jschema = new JobForm(); return View(); } else { return RedirectToAction("SessionTimeOut", "User"); } }