public ActionResult ITIssueDetailPage(int i) { List <ActionSelectionTech> pls1 = new List <ActionSelectionTech>() { new ActionSelectionTech { Text = "Solved", Value = 1, IsChecked = false }, new ActionSelectionTech { Text = "Unsolved", Value = 2, IsChecked = false }, }; TechList t = new TechList(); t.pls = pls1; TechnicalIssue tc = (from tch in _db.TechnicalIssues where tch.TechnicalIssueID == i select tch).FirstOrDefault(); ViewData["TechnicalIssueID"] = tc.TechnicalIssueID; ViewData["LabNo"] = tc.LabNo; ViewData["PCNo"] = tc.PCNo; ViewData["ProblemType"] = tc.ProblemType; ViewData["RecievedTime"] = tc.Time_Tech; ViewData["Priority"] = tc.Priority; ViewData["Status"] = tc.Status; return(View(t)); }
public ActionResult FormProcTechSupport(TechList tci) { StringBuilder sb = new StringBuilder(); StringBuilder sb1 = new StringBuilder(); foreach (var item in tci.techIs) { Debug.WriteLine("Checked value" + item.IsChecked); if (item.IsChecked) { //append each checked records into StringBuilder sb.Append(item.Text + ","); } } foreach (var item in tci.pIs) { Debug.WriteLine("Checked value" + item.IsChecked); if (item.IsChecked) { //append each checked records into StringBuilder sb1.Append(item.Text + ","); } } DateTime now = DateTime.Now; var time24 = DateTime.Now.ToString("HH:mm:ss"); Debug.WriteLine("The string is " + sb.ToString() + " " + sb1.ToString() + " " + now.Date.ToString()); StringBuilder sb2 = new StringBuilder(); sb2.Append(sb.ToString() + " And Priority is " + sb1.ToString() + " The description is " + tci.techdescription + " " + DateTime.Now.ToString("dd/MM/yyyy") + "The time is" + time24); TechnicalIssue tc = new TechnicalIssue(); // tc.TechnicalIssueID = 5; tc.BuildingNo = 1; tc.LabNo = "1"; tc.PCNo = 1; tc.ProblemType = sb.ToString(); tc.Priority = sb1.ToString(); tc.Date_Tech = DateTime.Now.Date; tc.Time_Tech = now.TimeOfDay; tc.Status = "Not Resolved"; tc.Comments = tci.techdescription; _db.TechnicalIssues.Add(tc); _db.SaveChanges(); var l = (from tch in _db.TechnicalIssues orderby tch.TechnicalIssueID descending select tch.TechnicalIssueID).First(); Debug.WriteLine("hidden field value from tech" + Request.Form["SubmissionFrom"]); string s1 = l.ToString(); /*if (Request.Form["SubmissionFrom"].ToString() == "ITUnitTeam") * { * Debug.WriteLine("hidden field value from ITUnitTeam" + Request.Form["SubmissionFrom"]); * return RedirectToAction("ITFinalSubmissionPage", "ITUnitTeam", new { s = s1 }); * } * else if (Request.Form["SubmissionFrom"].ToString() == "LogSupportTeam") * { * Debug.WriteLine("hidden field value from LogSupportTeam" + Request.Form["SubmissionFrom"]); * return RedirectToAction("CreateNewLogIssue", "LogisticsSupportTeam", new { s = s1 }); * } * else * {*/ Debug.WriteLine("hidden field value from ExamTeamFinalPage" + Request.Form["SubmissionFrom"]); string s2 = Request.Form["SubmissionFrom"].ToString(); return(RedirectToAction("ExamTeamFinalPage", new { s = s1, s4 = s2 })); // } }