protected void lvFriends_Sorting(object sender, ListViewSortEventArgs e)
    {
        Image imgFirstName = (Image)lvFriends.FindControl("imgFirstName");
        Image imgLastName = (Image)lvFriends.FindControl("imgLastName");
        Image imgCreated = (Image)lvFriends.FindControl("imgCreated");
        String imageUrl = (e.SortDirection == SortDirection.Ascending) ? "~/images/asc.gif" : "~/images/desc.gif";

        imgFirstName.Visible = false;
        imgLastName.Visible = false;
        imgCreated.Visible = false;

        switch (e.SortExpression)
        {
            case "firstname":
                imgFirstName.ImageUrl = imageUrl;
                imgFirstName.Visible = true;
                break;
            case "lastname":
                imgLastName.ImageUrl = imageUrl;
                imgLastName.Visible = true;
                break;
            case "created":
                imgCreated.ImageUrl = imageUrl;
                imgCreated.Visible = true;
                break;
        }
    }
		protected void lvDepartment_Sorting(object sender, ListViewSortEventArgs e)
        {
			Session["DepartmentSortExpression"] = e.SortExpression;
            Session["DepartmentSortDirection"] = e.SortDirection;
            Session["DepartmentCurrentPage"] = 0;

			DisplayedSortedArrows();
        }
		protected void lvPerson_Sorting(object sender, ListViewSortEventArgs e)
        {
			Session["PersonSortExpression"] = e.SortExpression;
            Session["PersonSortDirection"] = e.SortDirection;
            Session["PersonCurrentPage"] = 0;

			DisplayedSortedArrows();
        }
Esempio n. 4
0
 protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
 {
     if (SortExpression == ("ASC"))
     {
         SortExpression = "DESC";
     }
     else
     {
         SortExpression = "ASC";
     }
 }
Esempio n. 5
0
 protected void HandleFieldItemSorting(object sender, ListViewSortEventArgs args)
 {
     List<DesignableField> fields = this.controller.DesignableForm.RelatedFields;
     ///sort the fields
     var sortedFields = fields;
     if (args.SortDirection == SortDirection.Ascending)
         sortedFields = fields.OrderBy(field => field.Name).ToList();
     else
         sortedFields = fields.OrderByDescending(field => field.Name).ToList();
     this.FieldsListView.DataSource = sortedFields;
     this.FieldsListView.DataBind();
 }
Esempio n. 6
0
        protected void lvTowns_Sorting(object sender, ListViewSortEventArgs e)
        {
            var sortExpression = e.SortExpression;
            var sortDirection = this.ListViewSortDirection.ToString();

            if (sortDirection == "Ascending")
            {
                this.EntityDataSourceTowns.OrderBy = "it." + sortExpression + " ASC";
            }
            else
            {
                this.EntityDataSourceTowns.OrderBy = "it." + sortExpression + " DESC";
            }
        }
        protected void ListViewArticles_Sorting(object sender, ListViewSortEventArgs e)
        {
            e.Cancel = true;
            if (ViewState["OrderBy"] != null &&
                (string)ViewState["OrderBy"] == e.SortExpression)
            {
                this.changeDirection = true;
            }
            else
            {
                this.SortDirection = SortDirection.Ascending;
            }

            ViewState["OrderBy"] = e.SortExpression;
            this.ListViewArticles.DataBind();
        }
Esempio n. 8
0
        protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
        {
            //Choosing the right comparer based on SortExpression returned from header LinkButton CommandArgument
            switch (e.SortExpression)
            {
                case "Autor":
                    {
                        comparer = new AutorComparer();
                        break;
                    }
                case "Title":
                    {
                        comparer = new TitleComparer();
                        break;
                    }
                case "Year":
                    {
                        comparer = new YearComparer();
                        break;
                    }
                case "Pages":
                    {
                        comparer = new PagesComparer();
                        break;
                    }

            }
                ViewState["Comparer"] = comparer;

            // Try to retrieve data from session memory rather than DB,if the session variable is null retrive it from DB.

            var result = ViewState["SearchResult"] as List<BookInfo>;
            if (result != null)
            {
                result.Sort(comparer);  //sorting based on chosen comparer
                ViewState["SearchResult"] = result;
            }
            else
            {
                result = (new BookManager()).Search(Request.QueryString["text"]);
                result.Sort(comparer);
                ViewState["SearchResult"] = result;

            }
            ListView1.DataSource = result;
            ListView1.DataBind();
        }
        /// <summary>
        /// Userses the view sorting.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">
        /// The <see cref="System.Web.UI.WebControls.ListViewSortEventArgs"/> 
        /// instance containing the event data.</param>
        protected void UsersViewSorting(object sender, ListViewSortEventArgs e)
        {
            if (ClientsSource.SelectParameters[0].DefaultValue == null ||
                ClientsSource.SelectParameters[1].DefaultValue == null ||
                ClientsSource.SelectParameters[0].DefaultValue != e.SortExpression ||
                ClientsSource.SelectParameters[1].DefaultValue == "Desc")
            {
                ClientsSource.SelectParameters[1].DefaultValue = "Asce";
            }
            else if (ClientsSource.SelectParameters[1].DefaultValue == "Asce")
            {
                ClientsSource.SelectParameters[1].DefaultValue = "Desc";

            }

            ClientsSource.SelectParameters[0].DefaultValue = e.SortExpression;
            e.Cancel = true;
        }
Esempio n. 10
0
		protected void UsersListView_Sorting(Object sender, ListViewSortEventArgs e)
		{
			HtmlGenericControl gcLogin = (HtmlGenericControl)lvViewUsers.FindControl("spnLogin");
			HtmlGenericControl gcFirstName = (HtmlGenericControl)lvViewUsers.FindControl("spnFirstName");
			HtmlGenericControl gcLastName = (HtmlGenericControl)lvViewUsers.FindControl("spnLastName");

			ResolveClientUrl("~/App_Themes/Default/Images/asc.gif");

			string imgUrl;
      string options;
			if (e.SortDirection == SortDirection.Ascending)
			{
        imgUrl = "url('" + ResolveClientUrl("~/App_Themes/Default/Images/spriteEngageCCTDB.png") + "')";
        options = imgUrl + " no-repeat" + " 0" + " -80px";
			}
			else
			{
        imgUrl = "url('" + ResolveClientUrl("~/App_Themes/Default/Images/spriteEngageCCTDB.png") + "')";
        options = imgUrl + " no-repeat" + " 0" + " -108px";
			}

			switch (e.SortExpression)
			{
				case "Login":
					gcLogin.Style.Add("background", options);
					gcFirstName.Style.Add("background", "");
					gcLastName.Style.Add("background", "");
					break;

				case "FirstName":
					gcLogin.Style.Add("background", "");
					gcFirstName.Style.Add("background", options);
					gcLastName.Style.Add("background", "");
					break;

				case "LastName":
					gcLogin.Style.Add("background", "");
					gcFirstName.Style.Add("background", "");
					gcLastName.Style.Add("background", options);
					break;
			}
		}
Esempio n. 11
0
        protected void ListViewEmployees_Sorting(object sender, ListViewSortEventArgs e)
        {
            string SortDirection = "ASC";

            if (ViewState["SortExpression"] != null)
            {
                if (ViewState["SortExpression"].ToString() == e.SortExpression)
                {
                    ViewState["SortExpression"] = null;
                    SortDirection = "DESC";
                }
                else
                {
                    ViewState["SortExpression"] = e.SortExpression;
                }
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }

            BindSortedEmployees(" order by " + e.SortExpression + " " + SortDirection);
        }
Esempio n. 12
0
 protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
 {
 }
Esempio n. 13
0
    protected void resourcesLV_OnSorting(object sender, ListViewSortEventArgs e)
    {
        LinkButton ResourceNameBtn = resourcesLV.FindControl("ResourceNameBtn") as LinkButton;
        ImageButton ResourceNameImg = resourcesLV.FindControl("ResourceNameImg") as ImageButton;

        //LinkButton SubjectAreasBtn = resourcesLV.FindControl("SubjectAreasBtn") as LinkButton;
        //ImageButton SubjectAreasImg = resourcesLV.FindControl("SubjectAreasImg") as ImageButton;

        LinkButton ePassBtn = resourcesLV.FindControl("ePassBtn") as LinkButton;
        ImageButton ePassImg = resourcesLV.FindControl("ePassImg") as ImageButton;

        LinkButton StatusBtn = resourcesLV.FindControl("StatusBtn") as LinkButton;
        ImageButton StatusImg = resourcesLV.FindControl("StatusImg") as ImageButton;

        string DefaultSortIMG = "~/admin/img/asc.png";
        string imgUrl = "~/admin/img/desc.png";

        string SortDirection = "DESC";

        if (ViewState["SortExpression"] != null)
        {
            if (ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortExpression"] = null;
                SortDirection = "ASC";
                imgUrl = DefaultSortIMG;
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
        }
        else
        {
            ViewState["SortExpression"] = e.SortExpression;
        }

        switch (e.SortExpression)
        {
            case "ResourceName":
                if (ResourceNameImg != null)
                    ResourceNameImg.ImageUrl = imgUrl;

                if (ePassImg != null)
                    ePassImg.ImageUrl = DefaultSortIMG;
                if (StatusImg != null)
                    StatusImg.ImageUrl = DefaultSortIMG;

                break;

            //case "SubjectAreas":
            //    if (SubjectAreasImg != null)
            //        SubjectAreasImg.ImageUrl = DefaultSortIMG;

            //    break;

            case "ePass":
                if (ePassImg != null)
                    ePassImg.ImageUrl = imgUrl;

                if (ResourceNameImg != null)
                    ResourceNameImg.ImageUrl = DefaultSortIMG;
                if (StatusImg != null)
                    StatusImg.ImageUrl = DefaultSortIMG;
                break;

            case "Status":
                if (StatusImg != null)
                    StatusImg.ImageUrl = imgUrl;

                if (ResourceNameImg != null)
                    ResourceNameImg.ImageUrl = DefaultSortIMG;

                if (ePassImg != null)
                    ePassImg.ImageUrl = DefaultSortIMG;

                break;

        }

        //sortOrderbyHF.Value = " order by " + e.SortExpression + " " + SortDirection;
        sqlOrderBy = " order by " + e.SortExpression + " " + SortDirection;
        // getResources();
    }
Esempio n. 14
0
 protected virtual void OnSorting(ListViewSortEventArgs e) {
     EventHandler<ListViewSortEventArgs> handler = (EventHandler<ListViewSortEventArgs>)Events[EventSorting];
     if (handler != null) {
         handler(this, e);
     }
     else {
         if (IsDataBindingAutomatic == false && e.Cancel == false) {
             throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, AtlasWeb.ListView_UnhandledEvent, ID, "Sorting"));
         }
     }
 }
Esempio n. 15
0
        private void HandleSort(string sortExpression, SortDirection sortDirection) {
            ListViewSortEventArgs e = new ListViewSortEventArgs(sortExpression, sortDirection);
            OnSorting(e);

            if (e.Cancel) {
                return;
            }

            if (IsDataBindingAutomatic) {
                ClearDataKeys();
                DataSourceView view = GetData();
                if (view == null) {
                    throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, AtlasWeb.ListView_NullView, ID));
                }

                EditIndex = -1;

                SortExpressionInternal = e.SortExpression;
                SortDirectionInternal = e.SortDirection;
                _startRowIndex = 0;
            }

            OnSorted(EventArgs.Empty);
            RequiresDataBinding = true;
        }
Esempio n. 16
0
        protected void LeadListView_Sorting(Object sender, ListViewSortEventArgs e)
        {

            ResolveClientUrl("~/App_Themes/Default/Images/asc.gif");

            string imgUrl;
            string options;
            if (e.SortDirection == SortDirection.Ascending)
            {
                imgUrl = "url('" + ResolveClientUrl("~/App_Themes/Default/Images/spriteEngageCCTDB.png") + "')";
                options = imgUrl + " no-repeat" + " 0" + " -80px";
            }
            else
            {
                imgUrl = "url('" + ResolveClientUrl("~/App_Themes/Default/Images/spriteEngageCCTDB.png") + "')";
                options = imgUrl + " no-repeat" + " 0" + " -108px";
            }

            string numberBg, nameBg, topicBg, statusBg, createdBg, ofacBg, exlBg, addrBg;
            string numberHtml, nameHtml, topicHtml, statusHtml, createdHtml, ofacHtml, exlHtml, addrHtml;

            numberBg = nameBg = topicBg = statusBg = createdBg = ofacBg = exlBg = addrBg = numberHtml = nameHtml = topicHtml = statusHtml = createdHtml = ofacHtml = exlHtml = addrHtml = "";
            switch (e.SortExpression)
            {
                case "LeadNumber":
                    numberBg = options;
                    numberHtml = "&nbsp; &nbsp; &nbsp;";
                    break;

                case "Name":
                    nameBg = options;
                    nameHtml = "&nbsp; &nbsp; &nbsp;";
                    break;

                case "Topic":
                    topicBg = options;
                    topicHtml = "&nbsp; &nbsp; &nbsp;";
                    break;

                case "Status":
                    statusBg = options;
                    statusHtml = "&nbsp; &nbsp; &nbsp;";
                    break;

                case "Created":
                    createdBg = options;
                    createdHtml = "&nbsp; &nbsp; &nbsp;";
                    break;

                case "OFAC":
                    ofacBg = options;
                    ofacHtml = "&nbsp; &nbsp; &nbsp;";
                    break;

                case "Exl":
                    exlBg = options;
                    exlHtml = "&nbsp; &nbsp; &nbsp;";
                    break;

                case "Addr":
                    addrBg = options;
                    addrHtml = "&nbsp; &nbsp; &nbsp;";
                    break;
            }

            SetSortArrow(numberBg, nameBg, topicBg, statusBg, createdBg, ofacBg, exlBg, addrBg);
            SetTextAlign(numberHtml, nameHtml, topicHtml, statusHtml, createdHtml, ofacHtml, exlHtml, addrHtml);
        }
Esempio n. 17
0
		protected override void OnSorting (ListViewSortEventArgs e)
		{
			RecordEvent ("Enter");
			base.OnSorting (e);
			RecordEvent ("Leave");
		}
Esempio n. 18
0
 protected void ListViewArticles_Sorting(object sender, ListViewSortEventArgs e)
 {
     e.Cancel = true;
     ViewState["OrderBy"] = e.SortExpression;
     this.ListViewArticles.DataBind();
 }
 protected void lvClientSearch_Sorting(object sender, ListViewSortEventArgs e)
 {
     Session["Column"] = e.SortExpression;
     myDal.AddParam("Column", Session["Column"].ToString());
     ExecLoadMethods();
 }
Esempio n. 20
0
    protected void passwordAssistanceLV_OnSorting(object sender, ListViewSortEventArgs e)
    {
        LinkButton ResourceNameBtn = passwordAssistanceLV.FindControl("ResourceNameBtn") as LinkButton;
        ImageButton ResourceImg = passwordAssistanceLV.FindControl("ResourceNameIMg") as ImageButton;

        LinkButton TotalLicensesBtn = passwordAssistanceLV.FindControl("TotalLicensesBtn") as LinkButton;
        ImageButton TotalLicensesImg = passwordAssistanceLV.FindControl("TotalLicensesImg") as ImageButton;

        LinkButton AssignedBtn = passwordAssistanceLV.FindControl("AssignedBtn") as LinkButton;
        ImageButton AssignedImg = passwordAssistanceLV.FindControl("AssignedImg") as ImageButton;

        LinkButton AvailableBtn = passwordAssistanceLV.FindControl("AvailableBtn") as LinkButton;
        ImageButton AvailableImg = passwordAssistanceLV.FindControl("AvailableImg") as ImageButton;

        string DefaultSortIMG = "~/admin/img/asc.png";
        string imgUrl = "~/admin/img/desc.png";

        string SortDirection = "DESC";

        if (ViewState["SortExpression"] != null)
        {
            if (ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortExpression"] = null;
                SortDirection = "ASC";
                imgUrl = DefaultSortIMG;
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
        }
        else
        {
            ViewState["SortExpression"] = e.SortExpression;
        }

        if (ResourceImg != null)
            ResourceImg.ImageUrl = DefaultSortIMG;
        if (TotalLicensesImg != null)
            TotalLicensesImg.ImageUrl = DefaultSortIMG;
        if (AssignedImg != null)
            AssignedImg.ImageUrl = DefaultSortIMG;
        if (AvailableImg != null)
            AvailableImg.ImageUrl = DefaultSortIMG;

        switch (e.SortExpression)
        {
            case "ResourceName":
                if (ResourceImg != null)
                    ResourceImg.ImageUrl = imgUrl;

                break;

            case "TotalLicenses":
                if (TotalLicensesImg != null)
                    TotalLicensesImg.ImageUrl = imgUrl;

                break;
            case "AssignedLicenses":
                if (AssignedImg != null)
                    AssignedImg.ImageUrl = imgUrl;

                break;

            case "AvailableLicenses":
                if (AvailableImg != null)
                    AvailableImg.ImageUrl = imgUrl;

                break;

        }

        //sortOrderbyHF.Value = " order by " + e.SortExpression + " " + SortDirection;
        sqlOrderBy = " order by " + e.SortExpression + " " + SortDirection;
        //getResources();
    }
Esempio n. 21
0
    protected void passwordAssistanceLV_OnSorting(object sender, ListViewSortEventArgs e)
    {
        LinkButton DateBtn = passwordAssistanceLV.FindControl("DateBtn") as LinkButton;
        ImageButton DateImg = passwordAssistanceLV.FindControl("DateImg") as ImageButton;

        LinkButton FormStatusBtn = passwordAssistanceLV.FindControl("FormStatusBtn") as LinkButton;
        ImageButton FormStatusImg = passwordAssistanceLV.FindControl("FormStatusImg") as ImageButton;

        LinkButton RequestTypeBtn = passwordAssistanceLV.FindControl("RequestTypeBtn") as LinkButton;
        ImageButton RequestTypeImg = passwordAssistanceLV.FindControl("RequestTypeImg") as ImageButton;

        LinkButton RequestorBtn = passwordAssistanceLV.FindControl("RequestorBtn") as LinkButton;
        ImageButton RequestorImg = passwordAssistanceLV.FindControl("RequestorImg") as ImageButton;

        string DefaultSortIMG = "~/admin/img/asc.png";
        string imgUrl = "~/admin/img/desc.png";

        string SortDirection = "ASC";

        if (ViewState["SortExpression"] != null)
        {
            if (ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortExpression"] = null;
                SortDirection = "DESC";
                imgUrl = DefaultSortIMG;
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
        }
        else
        {
            ViewState["SortExpression"] = e.SortExpression;
        }

        switch (e.SortExpression)
        {
            case "SubmissionDateandTime":
                if (DateImg != null)
                    DateImg.ImageUrl = DefaultSortIMG;
                SortColumnName = "SubmissionDateandTime";
                break;

            case "FormStatus":
                if (FormStatusImg != null)
                    FormStatusImg.ImageUrl = DefaultSortIMG;
                SortColumnName = "FormStatus";
                break;

            case "RequestType":
                if (RequestTypeBtn != null)
                    RequestTypeImg.ImageUrl = imgUrl;
                SortColumnName = "RequestType";
                break;

            case "SubmittedForFirstName":
                if (RequestorImg != null)
                    RequestorImg.ImageUrl = imgUrl;
                SortColumnName = "SubmittedForFirstName";
                break;

        }

        sqlOrderBy = SortDirection;

        //sortOrderbyHF.Value = " order by " + e.SortExpression + " " + SortDirection;
        //  sqlOrderBy = " order by " + e.SortExpression + " " + SortDirection;
        //getResources();
    }
Esempio n. 22
0
    protected void UsersListView_OnSorting(object sender, ListViewSortEventArgs e)
    {
        LinkButton FirstNameBtn = usersLV.FindControl("FirstNameBtn") as LinkButton;
        LinkButton LastNameBtn = usersLV.FindControl("LastNameBtn") as LinkButton;
        LinkButton PINBtn = usersLV.FindControl("PINBtn") as LinkButton;
        LinkButton AccessLevelBtn = usersLV.FindControl("AccessLevelBtn") as LinkButton;
        LinkButton CORExpireDateBtn = usersLV.FindControl("CORExpireDateBtn") as LinkButton;
        LinkButton ActiveBtn = usersLV.FindControl("ActiveBtn") as LinkButton;
        LinkButton LastAccessedBtn = usersLV.FindControl("LastAccessedBtn") as LinkButton;

        ImageButton FirstNameImg = usersLV.FindControl("FirstNameImg") as ImageButton;
        ImageButton LastNameImg = usersLV.FindControl("LastNameImg") as ImageButton;
        ImageButton PINImg = usersLV.FindControl("PINImg") as ImageButton;
        ImageButton AccessLevelImg = usersLV.FindControl("AccessLevelImg") as ImageButton;
        ImageButton CORExpireDateImg = usersLV.FindControl("CORExpireDateImg") as ImageButton;
        ImageButton ActiveImg = usersLV.FindControl("ActiveImg") as ImageButton;
        ImageButton LastAccessedImg = usersLV.FindControl("LastAccessedImg") as ImageButton;

        string DefaultSortIMG = "~/admin/img/asc.png";
        string imgUrl = "~/admin/img/desc.png";

        string SortDirection = "DESC";

        if (ViewState["SortExpression"] != null)
        {
            if (ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortExpression"] = null;
                SortDirection = "ASC";
                imgUrl = DefaultSortIMG;
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
        }
        else
        {
            ViewState["SortExpression"] = e.SortExpression;
        }

        if (LastNameImg != null)
            LastNameImg.ImageUrl = DefaultSortIMG;
        if (FirstNameImg != null)
            FirstNameImg.ImageUrl = DefaultSortIMG;
        if (PINImg != null)
            PINImg.ImageUrl = DefaultSortIMG;
        if (AccessLevelImg != null)
            AccessLevelImg.ImageUrl = DefaultSortIMG;
        if (CORExpireDateImg != null)
            CORExpireDateImg.ImageUrl = DefaultSortIMG;
        if (ActiveImg != null)
            ActiveImg.ImageUrl = DefaultSortIMG;
        if (LastAccessedImg != null)
            LastAccessedImg.ImageUrl = DefaultSortIMG;

        switch (e.SortExpression)
        {
            case "LastName":

                if (LastNameImg != null)
                    LastNameImg.ImageUrl = imgUrl;
                break;
            case "FirstName":

                if (FirstNameImg != null)
                    FirstNameImg.ImageUrl = imgUrl;
                break;

            case "PIN":
                if (PINImg != null)
                    PINImg.ImageUrl = imgUrl;

                break;

            case "AccessLevel":
                if (AccessLevelImg != null)
                    AccessLevelImg.ImageUrl = imgUrl;

                break;

            case "COR":
                if (CORExpireDateImg != null)
                    CORExpireDateImg.ImageUrl = imgUrl;

                break;

            case "Active":
                if (ActiveImg != null)
                    ActiveImg.ImageUrl = imgUrl;

                break;

            case "LastAccessed":
                if (LastAccessedImg != null)
                    LastAccessedImg.ImageUrl = imgUrl;

                break;
        }

        //sortOrderbyHF.Value = " order by " + e.SortExpression + " " + SortDirection;
        sqlOrderBy = " order by " + e.SortExpression + " " + SortDirection;
        getUsers();
    }
Esempio n. 23
0
        protected void lvTasks_Sorting(object sender, ListViewSortEventArgs e)
        {
            if (SortDirection == "ASC")
            {
                SortDirection = "DESC";
            }
            else
            {
                SortDirection = "ASC";
            }

            SortExpression = String.Format("{0} {1}", e.SortExpression, SortDirection);

            // Check the sort direction to set the image URL accordingly.
            string imgUrl;
            if (SortDirection == "ASC")
                imgUrl = "~/DesktopModules/R7.HelpDesk/R7.HelpDesk/images/dt-arrow-up.png";
            else
                imgUrl = "~/DesktopModules/R7.HelpDesk/R7.HelpDesk/images/dt-arrow-dn.png";

            // Check which field is being sorted
            // to set the visibility of the image controls.
            Image TaskIDImage = (Image)lvTasks.FindControl("TaskIDImage");
            Image StatusImage = (Image)lvTasks.FindControl("StatusImage");
            Image PriorityImage = (Image)lvTasks.FindControl("PriorityImage");
            Image DueDateImage = (Image)lvTasks.FindControl("DueDateImage");
            Image CreatedDateImage = (Image)lvTasks.FindControl("CreatedDateImage");
            Image AssignedImage = (Image)lvTasks.FindControl("AssignedImage");
            Image DescriptionImage = (Image)lvTasks.FindControl("DescriptionImage");
            Image RequesterImage = (Image)lvTasks.FindControl("RequesterImage");

            // Set each Image to the proper direction
            TaskIDImage.ImageUrl = imgUrl;
            StatusImage.ImageUrl = imgUrl;
            PriorityImage.ImageUrl = imgUrl;
            DueDateImage.ImageUrl = imgUrl;
            CreatedDateImage.ImageUrl = imgUrl;
            AssignedImage.ImageUrl = imgUrl;
            DescriptionImage.ImageUrl = imgUrl;
            RequesterImage.ImageUrl = imgUrl;

            // Set each Image to false
            TaskIDImage.Visible = false;
            StatusImage.Visible = false;
            PriorityImage.Visible = false;
            DueDateImage.Visible = false;
            CreatedDateImage.Visible = false;
            AssignedImage.Visible = false;
            DescriptionImage.Visible = false;
            RequesterImage.Visible = false;

            switch (e.SortExpression)
            {
                case "TaskID":
                    TaskIDImage.Visible = true;
                    break;
                case "Status":
                    StatusImage.Visible = true;
                    break;
                case "Priority":
                    PriorityImage.Visible = true;
                    break;
                case "DueDate":
                    DueDateImage.Visible = true;
                    break;
                case "CreatedDate":
                    CreatedDateImage.Visible = true;
                    break;
                case "Assigned":
                    AssignedImage.Visible = true;
                    break;
                case "Description":
                    DescriptionImage.Visible = true;
                    break;
                case "Requester":
                    RequesterImage.Visible = true;
                    break;
            }

            HelpDesk_LastSearch objHelpDesk_LastSearch = GetValuesFromSearchForm();
            // Save Search Criteria
            SaveLastSearchCriteria(objHelpDesk_LastSearch);
            // Execute Search
            DisplayExistingTickets(SearchCriteria);
        }
Esempio n. 24
0
 protected void listeleme_Sorting(object sender, System.Web.UI.WebControls.ListViewSortEventArgs e)
 {
     Listele();
 }
Esempio n. 25
0
    protected void reportsLV_OnSorting(object sender, ListViewSortEventArgs e)
    {
        LinkButton RunDateTimeBtn = reportsLV.FindControl("RunDateTimeBtn") as LinkButton;
        ImageButton RunDateTimeImg = reportsLV.FindControl("RunDateTimeImg") as ImageButton;

        LinkButton ReportTypeBtn = reportsLV.FindControl("ReportTypeBtn") as LinkButton;
        ImageButton ReportTypeImg = reportsLV.FindControl("ReportTypeImg") as ImageButton;

        LinkButton DisplayNameBtn = reportsLV.FindControl("DisplayNameBtn") as LinkButton;
        ImageButton DisplayNameImg = reportsLV.FindControl("DisplayNameImg") as ImageButton;

        string DefaultSortIMG = "~/admin/img/desc.png";
        string imgUrl = "~/admin/img/asc.png";

        string SortDirection = "ASC";

        if (ViewState["SortExpression"] != null)
        {
            if (ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortExpression"] = null;
                SortDirection = "DESC";
                imgUrl = DefaultSortIMG;
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
        }
        else
        {
            ViewState["SortExpression"] = e.SortExpression;
        }

        switch (e.SortExpression)
        {
            case "DateTimRun":
                if (RunDateTimeBtn != null)
                    RunDateTimeImg.ImageUrl = imgUrl;

                break;

            case "ReportType":
                if (ReportTypeBtn != null)
                    ReportTypeImg.ImageUrl = imgUrl;

                break;

            case "DisplayName":
                if (DisplayNameBtn != null)
                    DisplayNameImg.ImageUrl = imgUrl;

                break;

        }

        //sortOrderbyHF.Value = " order by " + e.SortExpression + " " + SortDirection;
        sqlOrderBy = " order by " + e.SortExpression + " " + SortDirection;
        //  getResources();
    }
Esempio n. 26
0
    protected void passwordAssistanceLV_OnSorting(object sender, ListViewSortEventArgs e)
    {
        LinkButton LastNameBtn = passwordAssistanceLV.FindControl("LastNameBtn") as LinkButton;
        ImageButton LastNameImg = passwordAssistanceLV.FindControl("LastNameImg") as ImageButton;

        LinkButton FirstNameBtn = passwordAssistanceLV.FindControl("FirstNameBtn") as LinkButton;
        ImageButton FirstNameImg = passwordAssistanceLV.FindControl("FirstNameImg") as ImageButton;

        LinkButton EmailBtn = passwordAssistanceLV.FindControl("EmailBtn") as LinkButton;
        ImageButton EmailImg = passwordAssistanceLV.FindControl("EmailImg") as ImageButton;

        LinkButton PINBtn = passwordAssistanceLV.FindControl("PINBtn") as LinkButton;
        ImageButton PINImg = passwordAssistanceLV.FindControl("PINImg") as ImageButton;

        LinkButton OfficeCodeBtn = passwordAssistanceLV.FindControl("LastNameBtn") as LinkButton;
        ImageButton OfficeCodeImg = passwordAssistanceLV.FindControl("LastNameImg") as ImageButton;

        string DefaultSortIMG = "~/admin/img/asc.png";
        string imgUrl = "~/admin/img/desc.png";

          SortDirection = "DESC";

        if (ViewState["SortExpression"] != null)
        {
            if (ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortExpression"] = null;
                SortDirection = "ASC";
                imgUrl = DefaultSortIMG;
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
        }
        else
        {
            ViewState["SortExpression"] = e.SortExpression;
        }

        switch (e.SortExpression)
        {
            case "UserLastName":
                if (LastNameImg != null)
                    LastNameImg.ImageUrl = imgUrl ;

                if (FirstNameImg != null)
                    FirstNameImg.ImageUrl = DefaultSortIMG;
                if (EmailImg != null)
                    EmailImg.ImageUrl = DefaultSortIMG;
                if (PINImg != null)
                    PINImg.ImageUrl = DefaultSortIMG;
                if (OfficeCodeImg != null)
                    OfficeCodeImg.ImageUrl = DefaultSortIMG;

                break;

            case "UserFirstName":
                if (LastNameImg != null)
                    LastNameImg.ImageUrl = DefaultSortIMG;

                if (FirstNameImg != null)
                    FirstNameImg.ImageUrl = imgUrl;
                if (EmailImg != null)
                    EmailImg.ImageUrl = DefaultSortIMG;
                if (PINImg != null)
                    PINImg.ImageUrl = DefaultSortIMG;
                if (OfficeCodeImg != null)
                    OfficeCodeImg.ImageUrl = DefaultSortIMG;

                break;

            case "UserEmail":
                if (LastNameImg != null)
                    LastNameImg.ImageUrl = DefaultSortIMG;

                if (FirstNameImg != null)
                    FirstNameImg.ImageUrl = DefaultSortIMG;
                if (EmailImg != null)
                    EmailImg.ImageUrl = imgUrl;
                if (PINImg != null)
                    PINImg.ImageUrl = DefaultSortIMG;
                if (OfficeCodeImg != null)
                    OfficeCodeImg.ImageUrl = DefaultSortIMG;

                break;

            case "UserPIN":
                if (LastNameImg != null)
                    LastNameImg.ImageUrl = DefaultSortIMG;

                if (FirstNameImg != null)
                    FirstNameImg.ImageUrl = DefaultSortIMG;
                if (EmailImg != null)
                    EmailImg.ImageUrl = DefaultSortIMG;
                if (PINImg != null)
                    PINImg.ImageUrl = imgUrl;
                if (OfficeCodeImg != null)
                    OfficeCodeImg.ImageUrl = DefaultSortIMG;

                break;

            case "UserOfficeCode":
                if (LastNameImg != null)
                    LastNameImg.ImageUrl = DefaultSortIMG;

                if (FirstNameImg != null)
                    FirstNameImg.ImageUrl = DefaultSortIMG;
                if (EmailImg != null)
                    EmailImg.ImageUrl = DefaultSortIMG;
                if (PINImg != null)
                    PINImg.ImageUrl = DefaultSortIMG;
                if (OfficeCodeImg != null)
                    OfficeCodeImg.ImageUrl = imgUrl;

                break;

        }

        //sortOrderbyHF.Value = " order by " + e.SortExpression + " " + SortDirection;
        //sqlOrderBy = e.SortExpression;
        //SortDirection = SortDirection;
        //getResources();
        sqlOrderBy = " order by " + e.SortExpression + " " + SortDirection;
    }
Esempio n. 27
0
    protected void passwordAssistanceLV_OnSorting(object sender, ListViewSortEventArgs e)
    {
        LinkButton DateBtn = passwordAssistanceLV.FindControl("DateBtn") as LinkButton;
        ImageButton DateImg = passwordAssistanceLV.FindControl("DateImg") as ImageButton;

        string DefaultSortIMG = "~/admin/img/desc.png";
        string imgUrl = "~/admin/img/asc.png";

        string SortDirection = "ASC";

        if (ViewState["SortExpression"] != null)
        {
            if (ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortExpression"] = null;
                SortDirection = "DESC";
                imgUrl = DefaultSortIMG;
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
        }
        else
        {
            ViewState["SortExpression"] = e.SortExpression;
        }

        switch (e.SortExpression)
        {
            case "SubmissionDateandTime":
                if (DateImg != null)
                    DateImg.ImageUrl = imgUrl;

                break;

        }

        //sortOrderbyHF.Value = " order by " + e.SortExpression + " " + SortDirection;
        sqlOrderBy = " order by " + e.SortExpression + " " + SortDirection;
        getResources();
    }
Esempio n. 28
0
    /// <summary>
    /// ListView Item Sorting event
    /// </summary>
    /// <param name="fxEventArgs"></param>
    /// <param name="e"></param>
    /// <returns></returns>
    protected string UOC_lvwListView1_Sorting(FxEventArgs fxEventArgs, ListViewSortEventArgs e)
    {
        // 元のデータ
        DataTable dt1 = (DataTable)Session["SampleData"];

        // ソート後のデータを格納するためのDataTable
        DataTable dt2 = dt1.Clone();

        // データソート用のDataView
        DataView dv = new DataView(dt1);

        if (Session["SortDirection"] == null)
        {
            // ソートの定義情報を格納するためのDictionaryがない場合は作成する
            Session["SortDirection"] = new Dictionary<string, SortDirection>();
        }

        // ソート定義情報にしたがい、データをソートする
        if (!((Dictionary<string, SortDirection>)Session["SortDirection"]).ContainsKey(e.SortExpression))
        {
            // ソート定義情報がない場合。デフォルトは昇順とする
            dv.Sort = e.SortExpression;

            // ソート定義情報を追加する
            ((Dictionary<string, SortDirection>)Session["SortDirection"]).Add(e.SortExpression, SortDirection.Descending);
        }
        else
        {
            // ソート定義情報をもとに、当該列のソート方向を取得する
            SortDirection direction = ((Dictionary<string, SortDirection>)Session["SortDirection"])[e.SortExpression];

            if (direction == SortDirection.Ascending)
            {
                // 昇順
                dv.Sort = e.SortExpression;

                // ソート定義情報を更新する
                ((Dictionary<string, SortDirection>)Session["SortDirection"])[e.SortExpression] = SortDirection.Descending;
            }
            else
            {
                // 降順
                dv.Sort = e.SortExpression + " DESC";

                // ソート定義情報を更新する
                ((Dictionary<string, SortDirection>)Session["SortDirection"])[e.SortExpression] = SortDirection.Ascending;
            }
        }

        // ソート後のデータをDataTableにインポートする
        foreach (DataRowView drv in dv)
        {
            dt2.ImportRow(drv.Row);
        }

        // データの再バインド
        Session["SampleData"] = dt2;
        this.BindListViewData();

        return "";
    }