public ActionResult AddEditJobRoleSegment(SegmentViewModel model) { if (model.isAddMode == false) { JavaScriptSerializer js = new JavaScriptSerializer(); JobRoleQuestionModel queModel = new JobRoleQuestionModel(); if (!string.IsNullOrEmpty(model.JsonQuestionString)) { model.JobroleQueList = js.Deserialize <List <JobRoleQuestionModel> >(model.JsonQuestionString); // foreach (var item in model.JobroleQueList) // { // if (item.FiledId != null) // { // int CoreFiledid = Convert.ToInt32(item.FiledId); // var coreData = _db.SystemListValues.Where(x => x.Id == CoreFiledid).FirstOrDefault(); // item.FiledId = Convert.ToString(coreData.Id); // } // if (item.CValue != null) // { // int CoreValueid = Convert.ToInt32(item.CValue); // var coreValueData = _db.SystemListValues.Where(x => x.Id == CoreValueid).FirstOrDefault(); // item.CValue = Convert.ToString(coreValueData.Id); // } // } } } else { model.SegmentId = 0; } return(PartialView("_partialAddEditJobSegment", model)); }
public ActionResult AddEditCustomerSegment(SegmentViewModel model) { if (model.isAddMode == false) { JobRoleQuestionModel queModel = new JobRoleQuestionModel(); if (!string.IsNullOrEmpty(model.JsonQuestionString)) { JavaScriptSerializer js = new JavaScriptSerializer(); model.CustomerQueList = js.Deserialize <List <CustomerQuestionModel> >(model.JsonQuestionString); } } else { model.SegmentId = 0; } return(PartialView("_partialAddEditCustomerSegment", model)); }