/// <summary> /// 加載類型relevantStore /// </summary> public ActionResult relevantStore() { try { int scheduleid = Request["schedule_id"] == null ? 0 : int.Parse(Request["schedule_id"]);//key的值 string xmlPath = Server.MapPath("../XML/ParameterSrc.xml"); _scheduleItemMgr = new ScheduleItemMgr(connectionString); List<ScheduleItemCustom> list = _scheduleItemMgr.Query(new ScheduleItem { schedule_Id=scheduleid}); _fstMgr = new ScheduleMgr(connectionString); List<Parametersrc> typeList = _fstMgr.GetRelevantInfo(xmlPath, "ScheduleType"); List<Parametersrc> keyList = _fstMgr.GetRelevantInfo(xmlPath, "Schedule_Key"); foreach (ScheduleItemCustom i in list) { i.keyStr = keyList.Find(m=>m.ParameterCode==i.key1.ToString()).parameterName; i.tabType = typeList.Find(m=>m.ParameterCode==i.type.ToString()).parameterName; } return Json(list); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); return Json(new { success = false }); } }
public ActionResult GetRelevantType() { try { string type = Request["type"]; string xmlPath = Server.MapPath("../XML/ParameterSrc.xml"); _fstMgr = new ScheduleMgr(connectionString); return Json(_fstMgr.GetRelevantInfo(xmlPath, type)); } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); return Json(new { success = false }); } }