public void ShouldBuildQueryStringCorrectlyWhenPassingParameterAsFirstParameter()
        {
            //Arrange
            QueryStringBuilder queryBuilder = new QueryStringBuilder();
            DateTime dateTime = new DateTime(2011, 04, 15);

            //Act
            queryBuilder.AppendQueryString("StartDateFilter", dateTime.ToString("MM/dd/yyyy"));

            //Assert
            Assert.AreEqual("?StartDateFilter=04/15/2011", queryBuilder.ToString());
        }
 public string BuildQueryStringToQuickSearch(IDefaultPageView view)
 {
     QueryStringBuilder quickSearchQueryBuilder = new QueryStringBuilder();
     quickSearchQueryBuilder.AppendQueryString("JobId", view.QuickSearchJobId.ToString());
     return quickSearchQueryBuilder.ToString();
 }
        public string BuildQueryStringToPrintCallLogViewInDashBoardView(IDashboardView view)
        {
            QueryStringBuilder builder = new QueryStringBuilder();
            if (view.DashBoardViewType != Globals.Dashboard.ViewType.None)
                builder.AppendQueryString("ViewPoint", Convert.ToInt32(view.DashBoardViewType).ToString());
            if (!view.BeginDateCallLogViewFilter.Equals(DateTime.MinValue))
                builder.AppendQueryString("StartDateFilter", view.BeginDateCallLogViewFilter.ToString("MM/dd/yyyy"));
            if (!view.EndDateCallLogViewFilter.Equals(DateTime.MinValue))
                builder.AppendQueryString("EndDateFilter", view.EndDateCallLogViewFilter.ToString("MM/dd/yyyy"));
            if(view.JobStatusCallLogViewFilter.HasValue)
                builder.AppendQueryString("JobStatusFilter", view.JobStatusCallLogViewFilter.Value.ToString());
            if(view.DivisionValueCallLogViewFilter.HasValue)
                builder.AppendQueryString("DivisionFilter", view.DivisionValueCallLogViewFilter.Value.ToString());
            if(view.CallTypeCallLogViewFilter.HasValue)
                builder.AppendQueryString("CallTypeFilter", view.CallTypeCallLogViewFilter.Value.ToString());
            if(!string.IsNullOrEmpty(view.ModifiedByCallLogViewFilter))
                builder.AppendQueryString("ModifiedByFilter",view.ModifiedByCallLogViewFilter);
            if (view.OrderBy != null && view.OrderBy.Length > 0)
                builder.AppendQueryString("OrderBy", string.Format("{0} {1}", view.OrderBy[0], view.OrderBy[1]));
            if(view.ShiftTransferLogCallLogViewFilter)
                builder.AppendQueryString("ShiftTransferLogFilter", view.ShiftTransferLogCallLogViewFilter.ToString());
            if(view.GeneralLogCallLogViewFilter)
                builder.AppendQueryString("GeneralLogFilter", view.GeneralLogCallLogViewFilter.ToString());
            if (null != view.PersonNameCallLog)
                builder.AppendQueryString("PersonName", view.PersonNameCallLog);

            return builder.ToString();
        }
        public string BuildQueryStringToPrintJobSummaryInDashBoardView(IDashboardView view)
        {
            QueryStringBuilder builder = new QueryStringBuilder();
            if (view.DashBoardViewType != Globals.Dashboard.ViewType.None)
                builder.AppendQueryString("ViewPoint", Convert.ToInt32(view.DashBoardViewType).ToString());
            if (view.JobStatusFilterValue.HasValue)
                builder.AppendQueryString("JobStatusFilter", view.JobStatusFilterValue.Value.ToString());
            if (view.JobNumberFilterValue.HasValue)
                builder.AppendQueryString("JobNumberFilter", view.JobNumberFilterValue.Value.ToString());
            if (view.DivisionFilterValue.HasValue)
                builder.AppendQueryString("DivisionFilter", view.DivisionFilterValue.Value.ToString());
            if (view.CustomerFilterValue.HasValue)
                builder.AppendQueryString("CustomerFilter", view.CustomerFilterValue.Value.ToString());
            if (view.DateFilterTypeValue != Globals.Dashboard.DateFilterType.None)
                builder.AppendQueryString("DateTypeFilter", Convert.ToInt32(view.DateFilterTypeValue).ToString());
            if (view.BeginDateJobSummaryValue != DateTime.MinValue)
                builder.AppendQueryString("StartDateFilter", view.BeginDateJobSummaryValue.ToString("MM/dd/yyyy"));
            if (view.EndDateJobSummaryValue != DateTime.MinValue)
                builder.AppendQueryString("EndDateFilter", view.EndDateJobSummaryValue.ToString("MM/dd/yyyy"));
            if (view.OrderBy != null && view.OrderBy.Length > 0)
                builder.AppendQueryString("OrderBy", string.Format("{0} {1}", view.OrderBy[0], view.OrderBy[1]));
            if (null != view.PersonNameValueJobSummary)
                builder.AppendQueryString("PersonName", view.PersonNameValueJobSummary);

            return builder.ToString();
        }
 public string BuildQueryStringForQuickReference(Dictionary<string,string> parameters)
 {
     QueryStringBuilder quickReferenceQueryBuilder = new QueryStringBuilder();
     foreach (var item in parameters)
     {
         quickReferenceQueryBuilder.AppendQueryString(item.Key , item.Value);
     }
     return  quickReferenceQueryBuilder.ToString();
 }