コード例 #1
0
        public CreateModel(WalkingTracker.Data.ApplicationDbContext context)
        {
            TrackingLog = new TrackingLog
            {
                Date = (DateTime.Today),
            };

            _context = context;
        }
コード例 #2
0
        public WorkFlowInstanceList GetWorkFlowInstances()
        {
            //WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal;

            //WindowsIdentity identity = (WindowsIdentity)principal.Identity;

            //TrackingLog.Log(identity.Name);

            WorkFlowInstanceList l = new WorkFlowInstanceList();

            try
            {
                TrackingDataContext dataContext = new TrackingDataContext();

                IQueryable <CommonResource.Tracking> trackingQuery =
                    from tracking in dataContext.Trackings
                    select tracking;

                foreach (CommonResource.Tracking t in trackingQuery)
                {
                    using (TrackingWorkFlowInteraction interaction = new TrackingWorkFlowInteraction())
                    {
                        WorkFlowInstance wfi = new WorkFlowInstance();
                        wfi.BugId          = t.bugid;
                        wfi.Id             = t.wfinstanceid.ToString();
                        wfi.Title          = t.title;
                        wfi.WFName         = t.wfname;
                        wfi.LastModified   = t.lastmodified.ToString();
                        wfi.QFEStatus      = t.qfestatus;
                        wfi.AssignedTo     = t.assignedto;
                        wfi.LastModified   = t.lastmodified == null ? "N/A" : t.lastmodified.Value.ToString();
                        wfi.LastModifiedBy = t.lastmodifiedby;
                        //
                        //List<string> candiCmds = interaction.getCandidateCommands(t.wfname.Trim(), t.wfinstanceid.ToString());
                        //CandidateCommandList ccl = new CandidateCommandList();
                        //if (candiCmds != null)
                        //{
                        //    foreach (string cmd in candiCmds)
                        //    {
                        //        ccl.Add(cmd);
                        //    }
                        //}
                        //wfi.CandidateCommandList = ccl;
                        l.Add(wfi);
                    }
                }
            }
            catch (Exception e)
            {
                TrackingLog.Log(e.ToString() + "!!" + e.Message);
            }
            return(l);
        }
コード例 #3
0
 public void AddToTrackingLog(string line)
 {
     TrackingLog.Add(string.Format(ProgramLocalization.LogRow, DateTime.Now.ToLongTimeString(), line));
     if (TrackingLog != null)
     {
         var temp = new List <string>(TrackingLog);
         temp.Reverse();
         TrackingLogsListBox.Items.Clear();
         TrackingLogsListBox.Items.AddRange(temp.Select(x => new ListViewItem(x)).ToArray());
         TrackingLogsListBox.Refresh();
     }
 }
コード例 #4
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TrackingLog = await _context.Tracking.FirstOrDefaultAsync(m => m.ID == id);

            if (TrackingLog == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #5
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TrackingLog = await _context.Tracking.FindAsync(id);

            if (TrackingLog != null)
            {
                _context.Tracking.Remove(TrackingLog);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
コード例 #6
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TrackingLog = await _context.TrackingLog
                          .Include(t => t.Project)
                          .Include(t => t.StaffMember).FirstOrDefaultAsync(m => m.TrackingLogId == id);

            if (TrackingLog == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #7
0
        public void Clear()
        {
            var temp = new List <string>();

            TrackingLog.Clear();

            TrackingLogsListBox.Items.Clear();
            TrackingLogsListBox.Items.AddRange(temp.Select(x => new ListViewItem(x)).ToArray());

            GameHistoryListBox.Items.Clear();
            GameHistoryListBox.Items.AddRange(temp.Select(x => new ListViewItem(x)).ToArray());

            SceneDisruptionBtn.BackColor = SystemColors.ControlLight;
            SceneDisruptionBtn.Text      = string.Empty;

            ImmediateBoardStatePictureBox.Image = null;
            TrackedBoardStatePictureBox.Image   = null;
            GameStatePictureBox.Image           = null;
        }