public IActionResult toMainIndex() { string questionId = Request.Query["questionId"]; string userquestionId = Request.Query["userquestionId"].ToString(); string companyId = Request.Query["companyId"].ToString(); string classId = Request.Query["classid"].ToString(); string courseId = Request.Query["courseid"]; string userId = Request.Query["userid"]; string Name = Request.Query["Name"]; if (!string.IsNullOrEmpty(questionId)) { HttpContext.Session.SetString("questionId", questionId); HttpContext.Session.SetString("userquestionId", userquestionId); HttpContext.Session.SetString("companyId", companyId); HttpContext.Session.SetString("classId", classId); HttpContext.Session.SetString("courseId", courseId); HttpContext.Session.SetString("userId", userId); HttpContext.Session.SetString("Name", Name); JObject jo = new JObject(); jo["questionId"] = questionId; jo["userquestionId"] = userquestionId; jo["companyId"] = companyId; jo["classId"] = classId; jo["courseId"] = courseId; jo["userId"] = userId; jo["Name"] = Name; string split; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { split = "\\"; } else { split = "/"; } string path = he.ContentRootPath + split + "Log"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string fileFullPath = path + split + "Session.json"; StringBuilder str = new StringBuilder(); str.Append(JsonConvert.SerializeObject(jo)); StreamWriter sw; sw = System.IO.File.CreateText(fileFullPath); sw.WriteLine(str.ToString()); sw.Close(); } Model m = new Model(); m.Nsrxx = set.getNsrxx(); return(View(m)); }
public IActionResult view_10104() { qc = set.getUserYSBQC(set.BDDM.YbnsrZzs); JToken reportData = set.getUserYSBQCReportData(qc.Id, qc.BDDM); YbnsrzzsModel model = new YbnsrzzsModel(); model.reportData = reportData; model.GDTXDate = set.getGDTXDate(set.BDDM.YbnsrZzs); model.Nsrxx = set.getNsrxx(); return(View(model)); }
public System.Web.Mvc.ActionResult toMainIndex() { string questionId = Request.QueryString["questionId"]; string userquestionId = Request.QueryString["userquestionId"].ToString(); string companyId = Request.QueryString["companyId"].ToString(); string classId = Request.QueryString["classid"].ToString(); string courseId = Request.QueryString["courseid"]; string userId = Request.QueryString["userid"]; string Name = Request.QueryString["Name"]; HttpContext.Session["questionId"] = questionId; HttpContext.Session["userquestionId"] = userquestionId; HttpContext.Session["companyId"] = companyId; HttpContext.Session["classId"] = classId; HttpContext.Session["courseId"] = courseId; HttpContext.Session["userId"] = userId; HttpContext.Session["Name"] = Name; JObject jo = new JObject(); jo["questionId"] = questionId; jo["userquestionId"] = userquestionId; jo["companyId"] = companyId; jo["classId"] = classId; jo["courseId"] = courseId; jo["userId"] = userId; jo["Name"] = Name; string path = AppDomain.CurrentDomain.BaseDirectory + @"\Log\"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string fileFullPath = path + "Session.json"; StringBuilder str = new StringBuilder(); str.Append(JsonConvert.SerializeObject(jo)); StreamWriter sw; sw = System.IO.File.CreateText(fileFullPath); sw.WriteLine(str.ToString()); sw.Close(); Model m = new Model(); m.Nsrxx = set.getNsrxx(); return(View(m)); }
public System.Web.Mvc.ActionResult view_20101() { qc = set.getUserYSBQC(set.BDDM.Fjs); JToken reportData = set.getUserYSBQCReportData(qc.Id, qc.BDDM); Nsrxx xx = set.getNsrxx(); GDTXDate gd = set.getGDTXDate(qc.BDDM); FjsModel model = new FjsModel { SBZT = set.SBZT.WTX, Nsrxx = xx, GDTXDate = gd }; List <FjsData> listFjsData = new List <FjsData>(); if (reportData.HasValues) { model.SBZT = set.SBZT.DSB; for (int i = 0; i < 3; i++) { IEnumerable <JToken> datas = reportData.SelectToken("[0].data").Where(a => a["idx"] != null && int.Parse(a["idx"].ToString()) == i); JObject jo = new JObject(); jo.Add("index", i.ToString()); foreach (JObject item in datas) { jo.Add(item["name"].ToString().Split('.')[1], item["value"]); } FjsData fjsData = JsonConvert.DeserializeObject <FjsData>(JsonConvert.SerializeObject(jo)); listFjsData.Add(fjsData); } } else { listFjsData = new List <FjsData> { new FjsData(0), new FjsData(1), new FjsData(2) }; } model.FjsData = listFjsData; return(View("view_20101", model)); }