예제 #1
0
        /*public ActionResult LogisticsIssueUpdate()
         * {
         *  LogList ls = new LogList();
         *
         * }*/
        public ActionResult LogisticsIssueDetailPage(int i)
        {
            List <ActionSelectionLog> pls = new List <ActionSelectionLog>()
            {
                new ActionSelectionLog {
                    Text = "Solved", Value = 1, IsChecked = false
                },
                new ActionSelectionLog {
                    Text = "Unsolved", Value = 2, IsChecked = false
                },
            };

            LogList lo = new LogList();

            lo.ls = pls;

            LogisticsIssue lc = (from log in _db.LogisticsIssues
                                 where log.LogisticsIssueID == i
                                 select log).FirstOrDefault();

            ViewData["LogisticsIssueID"] = lc.LogisticsIssueID;
            ViewData["LabNo"]            = lc.LabNo;
            ViewData["PCNo"]             = lc.PCNo;
            ViewData["ProblemType"]      = lc.ProblemType;
            ViewData["RecievedTime"]     = lc.Time_Log;
            ViewData["Priority"]         = lc.Priority;
            ViewData["Status"]           = lc.Status;
            return(View(lo));
        }
예제 #2
0
        public ActionResult FormProcLogSupport(LogList lci)
        {
            StringBuilder sb  = new StringBuilder();
            StringBuilder sb1 = new StringBuilder();

            foreach (var item in lci.logIs)
            {
                Debug.WriteLine("Checked value" + item.IsChecked);
                if (item.IsChecked)
                {
                    //append each checked records into StringBuilder
                    sb.Append(item.Text + ",");
                }
            }

            foreach (var item in lci.plIs)
            {
                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());
            //  String s1 = sb.ToString() + " And Priority is "+ sb1.ToString() + " The description is " + lci.logdescription + " " + DateTime.Now.ToString("dd/MM/yyyy") + "The time is" + time24;
            LogisticsIssue tc = new LogisticsIssue();

            //  tc.LogisticsIssueID = 4;
            tc.BuildingNo  = 1;
            tc.LabNo       = "1";
            tc.PCNo        = 1;
            tc.ProblemType = sb.ToString();
            tc.Priority    = sb1.ToString();
            tc.Date_Log    = DateTime.Now.Date;
            tc.Time_Log    = now.TimeOfDay;
            tc.Status      = "Not Resolved";
            tc.Comments    = lci.logdescription;
            _db.LogisticsIssues.Add(tc);
            _db.SaveChanges();
            var li = (from tch in _db.LogisticsIssues
                      orderby tch.LogisticsIssueID descending
                      select tch.LogisticsIssueID).First();
            string s1 = li.ToString();

            Debug.WriteLine("hidden field value from Log" + Request.Form["SubmissionFrom"]);

            /*  if (Request.Form["SubmissionFrom"].ToString() == "ITUnitTeam")
             * {
             *    return RedirectToAction("ITFinalSubmissionPage", "ITUnitTeam", new { s = s1 });
             * }
             * else if (Request.Form["SubmissionFrom"].ToString() == "LogSupportTeam")
             * {
             *    return RedirectToAction("CreateNewLogIssue", "LogisticsSupportTeam", new { s = s1 });
             * }
             * else
             * {*/
            string s2 = Request.Form["SubmissionFrom"].ToString();

            return(RedirectToAction("ExamTeamFinalPage", new { s = s1, s4 = s2 }));
            //}
        }