예제 #1
0
        public void Supplier_user_can_not_be_old()
        {
            var item = new UserSearchItem {
                ClientType = SearchClientType.Supplier
            };

            Assert.That(item.IsOldUserUpdate, Is.False);
        }
예제 #2
0
        protected void _grdSearchUserList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Header)
            {
                foreach (TableCell tc in e.Row.Cells)
                {
                    if (tc.HasControls())
                    {
                        // search for the header link
                        LinkButton lnk = (LinkButton)tc.Controls[0];
                        if (lnk != null)
                        {
                            // inizialize a new image
                            System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
                            // setting the dynamically URL of the image
                            img.ImageUrl = "~/Images/PNGs/sort_az_" + (_grdSearchUserList.SortDirection == SortDirection.Ascending ? "descending" : "ascending") + ".png";
                            // checking if the header link is the user's choice
                            if (_grdSearchUserList.SortExpression == lnk.CommandArgument)
                            {
                                // adding a space and the image to the header link
                                tc.Controls.Add(new LiteralControl(" "));
                                tc.Controls.Add(img);
                            }
                        }
                    }
                }
            }

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                LinkButton     _lnkUser = (LinkButton)e.Row.FindControl("_lnkUser");
                UserSearchItem user     = (UserSearchItem)e.Row.DataItem;


                _lnkUser.Text = user.Forename + " " + user.Surname + "(" + user.UserName + ")";
            }
        }