/// <summary>
        /// The Index action.
        /// </summary>
        /// <param name="BuggsForm">The form of user data passed up from the client.</param>
        /// <returns>The view to display a list of Buggs on the client.</returns>
        public ActionResult Index(FormCollection BuggsForm)
        {
            FormHelper     FormData = new FormHelper(Request, BuggsForm, "CrashesInTimeFrame");
            BuggsViewModel Results  = LocalBuggRepository.GetResults(FormData);

            return(View("Index", Results));
        }
Example #2
0
 /// <summary>
 /// The Index action.
 /// </summary>
 /// <param name="BuggsForm">The form of user data passed up from the client.</param>
 /// <returns>The view to display a list of Buggs on the client.</returns>
 public ActionResult Index(FormCollection BuggsForm)
 {
     using (FAutoScopedLogTimer LogTimer = new FAutoScopedLogTimer(this.GetType().ToString()))
     {
         FormHelper     FormData = new FormHelper(Request, BuggsForm, "CrashesInTimeFrame");
         BuggsViewModel Results  = LocalBuggRepository.GetResults(FormData);
         return(View("Index", Results));
     }
 }
Example #3
0
        /*
         * /// <summary>
         * /// The empty view of the buggs page.
         * /// </summary>
         * ///
         * public ActionResult Index()
         * {
         *      using (FAutoScopedLogTimer LogTimer = new FAutoScopedLogTimer( this.GetType().ToString(), bCreateNewLog: true ))
         *      {
         *              BuggsViewModel Results = new BuggsViewModel();
         *              Results.GenerationTime = LogTimer.GetElapsedSeconds().ToString( "F2" );
         *              return View( "Index", Results );
         *      }
         * }*/

        /// <summary>
        /// The Index action.
        /// </summary>
        /// <param name="BuggsForm">The form of user data passed up from the client.</param>
        /// <returns>The view to display a list of Buggs on the client.</returns>
        public ActionResult Index(FormCollection BuggsForm)
        {
            using (FAutoScopedLogTimer LogTimer = new FAutoScopedLogTimer(this.GetType().ToString(), bCreateNewLog: true))
            {
                BuggRepository Buggs = new BuggRepository();

                FormHelper     FormData = new FormHelper(Request, BuggsForm, "CrashesInTimeFrameGroup");
                BuggsViewModel Results  = Buggs.GetResults(FormData);
                foreach (var Bugg in Results.Results)
                {
                    // Populate function calls.
                    Bugg.GetFunctionCalls();
                }
                Results.GenerationTime = LogTimer.GetElapsedSeconds().ToString("F2");
                return(View("Index", Results));
            }
        }
        /// <summary>
        /// Create the html required to change the current user group to filter Buggs by.
        /// </summary>
        /// <param name="Helper">The Url helper object.</param>
        /// <param name="UserGroup">The user group to generate a link for.</param>
        /// <param name="Model">The view model for the current page.</param>
        /// <returns>A string suitable for MVC to render.</returns>
        public static MvcHtmlString UserGroupLink(this UrlHelper Helper, string UserGroup, BuggsViewModel Model)
        {
            StringBuilder Result = new StringBuilder();
            TagBuilder    Tag    = new TagBuilder("a");

            string URL = Helper.Action("Index", new {
                controller   = "Buggs",
                SortTerm     = Model.SortTerm,
                SortOrder    = Model.SortOrder,
                UserGroup    = UserGroup,
                SearchQuery  = Model.SearchQuery,
                DateFrom     = Model.DateFrom,
                DateTo       = Model.DateTo,
                BuildVersion = Model.BuildVersion,
                CrashType    = Model.CrashType,
            });

            Tag.MergeAttribute("href", URL);
            Tag.InnerHtml = UserGroup;
            Result.AppendLine(Tag.ToString());

            return(MvcHtmlString.Create(Result.ToString()));
        }
        /// <summary>
        /// Create the html required to create the links for table headers to control the sorting of Buggs.
        /// </summary>
        /// <param name="Helper">The Url helper object.</param>
        /// <param name="HeaderName">The table column header name.</param>
        /// <param name="SortTerm">The sort term to use when sorting by this column.</param>
        /// <param name="Model">The view model for the current page.</param>
        /// <returns>A string suitable for MVC to render.</returns>
        public static MvcHtmlString TableHeader(this UrlHelper Helper, string HeaderName, string SortTerm, BuggsViewModel Model)
        {
            StringBuilder Result = new StringBuilder();
            TagBuilder    Tag    = new TagBuilder("a");         // Construct an <a> Tag

            string URL = Helper.Action("Index", new {
                controller    = "Buggs",
                Page          = Model.PagingInfo.CurrentPage,
                SortTerm      = SortTerm,
                PreviousOrder = Model.SortOrder,
                PreviousTerm  = Model.SortTerm,
                UserGroup     = Model.UserGroup,
                SearchQuery   = Model.SearchQuery,
                DateFrom      = Model.DateFrom,
                DateTo        = Model.DateTo,
                BuildVersion  = Model.BuildVersion,
                CrashType     = Model.CrashType,
            });

            Tag.MergeAttribute("href", URL);
            string SortArrow = "";

            if (Model.SortTerm == SortTerm)
            {
                if (Model.SortOrder == "Descending")
                {
                    SortArrow = "<img border=0 src='../../Content/Images/SortDescending.png' />";
                }
                else
                {
                    SortArrow = "<img border=0 src='../../Content/Images/SortAscending.png' />";
                }
            }
            else
            {
                SortArrow = "<img border=0 src='../../Content/Images/SortPlaceHolder.png' />";
            }

            Tag.InnerHtml = "<span>" + HeaderName + "&nbsp;" + SortArrow + "</span>";
            Result.AppendLine(Tag.ToString());

            return(MvcHtmlString.Create(Result.ToString()));
        }
		/// <summary>
		/// Create the html required to change the current user group to filter Buggs by.
		/// </summary>
		/// <param name="Helper">The Url helper object.</param>
		/// <param name="UserGroup">The user group to generate a link for.</param>
		/// <param name="Model">The view model for the current page.</param>
		/// <returns>A string suitable for MVC to render.</returns>
		public static MvcHtmlString UserGroupLink( this UrlHelper Helper, string UserGroup, BuggsViewModel Model )
		{
			StringBuilder Result = new StringBuilder();
			TagBuilder Tag = new TagBuilder( "a" );

			string URL = Helper.Action( "Index", new { 
														controller = "Buggs",
														SortTerm = Model.SortTerm,
														SortOrder = Model.SortOrder,
														UserGroup = UserGroup,
														SearchQuery = Model.SearchQuery,
														DateFrom = Model.DateFrom,
														DateTo = Model.DateTo,
														VersionName = Model.VersionName,
                                                        CrashType = Model.CrashType,
                                                        JiraId = Model.Jira,
                                                        PlatformName = Model.PlatformName,
                                                        BranchName = Model.BranchName
													} );

			Tag.MergeAttribute( "href", URL );
			Tag.InnerHtml = UserGroup;
			Result.AppendLine( Tag.ToString() );

			return MvcHtmlString.Create( Result.ToString() );
		}
		/// <summary>
		/// Create the html required to create the links for table headers to control the sorting of Buggs.
		/// </summary>
		/// <param name="Helper">The Url helper object.</param>
		/// <param name="HeaderName">The table column header name.</param>
		/// <param name="SortTerm">The sort term to use when sorting by this column.</param>
		/// <param name="Model">The view model for the current page.</param>
		/// <returns>A string suitable for MVC to render.</returns>
		public static MvcHtmlString TableHeader( this UrlHelper Helper, string HeaderName, string SortTerm, BuggsViewModel Model )
		{
			StringBuilder Result = new StringBuilder();
			TagBuilder Tag = new TagBuilder( "a" ); // Construct an <a> Tag

			string URL = Helper.Action( "Index", new { 
														controller = "Buggs",
														Page = Model.PagingInfo.CurrentPage,
														SortTerm = SortTerm,
														PreviousOrder = Model.SortOrder,
														PreviousTerm = Model.SortTerm,
														UserGroup = Model.UserGroup,
														SearchQuery = Model.SearchQuery,
														DateFrom = Model.DateFrom,
														DateTo = Model.DateTo,
														VersionName = Model.VersionName,
														CrashType = Model.CrashType,
													} );

			Tag.MergeAttribute( "href", URL );
			string SortArrow = "";
			if( Model.SortTerm == SortTerm )
			{
				if( Model.SortOrder == "Descending" )
				{
					SortArrow = "<img border=0 src='../../Content/Images/SortDescending.png' />";
				}
				else
				{
					SortArrow = "<img border=0 src='../../Content/Images/SortAscending.png' />";
				}
			}
			else
			{
				SortArrow = "<img border=0 src='../../Content/Images/SortPlaceHolder.png' />";
			}

			Tag.InnerHtml = "<span>" + HeaderName + "&nbsp;" + SortArrow + "</span>";
			Result.AppendLine( Tag.ToString() );

			return MvcHtmlString.Create( Result.ToString() );
		}