private StaffRequestDashboardQuery BuildQuery()
        {
            StaffRequestDashboardQuery query = new StaffRequestDashboardQuery();

            query.PageSize = int.Parse(m_hdnPageSize.Value);
            query.RequestNumber = m_txtRequestNumber.Text;

            if (m_dtCreatedDate.SelectedDate.HasValue)
            {
                query.RequestDate = m_dtCreatedDate.SelectedDate.Value;
            }

            query.RequestedBy = m_txtRequestedBy.Text;

            query.Lanugages = GetSelectedLanguageOptions();
            query.SetStatus(GetSelectedStatusOptions());
            query.SetLabels(GetSelectedLabelOptions());
            query.SetOrderBy(m_hdnSortName.Value + " " + m_hdnSortDir.Value);

            return query;
        }
        private static StaffRequestDashboardQuery ParseRequestsDashboardQuery(string filterString, string orderBy)
        {
            StaffRequestDashboardQuery query = new StaffRequestDashboardQuery();

            query.SetOrderBy(orderBy);

            if (!string.IsNullOrEmpty(filterString))
            {
                string[] sFilters = filterString.Split(char.ConvertFromUtf32(200).ToCharArray());
                foreach (string sFilterChunk in sFilters)
                {
                    string[] sFilterParts = sFilterChunk.Split(char.ConvertFromUtf32(201).ToCharArray());
                    string sName = sFilterParts[0];
                    string sValue = sFilterParts[1];

                    switch (sName)
                    {
                        case "Request Number":
                            query.RequestNumber = sValue;
                            break;
                        case "Request Date":
                            DateTime oDateTime = new DateTime();
                            DateTime.TryParse(sValue, out oDateTime);

                            if (oDateTime > DateTime.MinValue)
                            {
                                query.RequestDate = oDateTime;
                            }
                            break;
                        case "Requested By":
                            query.RequestedBy = sValue;
                            break;
                        case "Status":
                            if (!string.IsNullOrEmpty(sValue))
                            {
                                List<int> status = sValue.Split(',').Select(i => int.Parse(i)).ToList();
                                query.SetStatus(status);
                            }

                            break;
                        case "Languages":
                            if (!string.IsNullOrEmpty(sValue))
                            {
                                query.Lanugages.AddRange(sValue.Split(','));
                            }

                            break;
                        case "ASAP":
                            query.RequestASAP = (sValue == "Y") ? true : false;
                            break;
                        case "Labels":
                            if (!string.IsNullOrEmpty(sValue))
                            {
                                List<int> labels = sValue.Split(',').Select(i => int.Parse(i)).ToList();
                                query.SetLabels(labels);
                            }

                            break;
                        case "LabelsShowOnlyUnlabeled":
                            query.LabelsShowOnlyUnlabeled = (sValue == "Y") ? true : false;
                            break;
                        default:
                            break;
                    }
                }
            }

            return query;
        }