Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Get the ticket ID from the querystring

            string ticketID_String = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(ticketID_String))
            {
                int ticketID = Parsers.ParseInt(ticketID_String);

                if (ticketID > 0)
                {
                    SysAidTicketRepository repository = new SysAidTicketRepository();
                    SysAidTicket           ticket     = repository.Get(ticketID);
                    if (ticket != null)
                    {
                        litTicketInfo.Text = buildTicketInfoBox(ticket);
                    }
                    else
                    {
                        litTicketInfo.Text = "Ticket is null for some reason";
                    }
                }
                else
                {
                    litTicketInfo.Text = "Invalid ticket specified: " + ticketID;
                }
            }
            else
            {
                litTicketInfo.Text = "No ticket specified";
            }
        }
Exemplo n.º 2
0
        protected void btnSearch_OnClick(object sender, EventArgs e)
        {
            string searchTerms = txtSearchTerms.Text.Trim();

            if (!string.IsNullOrEmpty(searchTerms))
            {
                SysAidTicketRepository repository = new SysAidTicketRepository();

                List <SysAidTicketSearchResult> results = repository.Find(searchTerms);

                lblResults.Text = "<div style=\"font-size: 8pt;\"><b>Found: </b>" + results.Count + "</div><br/><br/>";

                tblResults.Rows.Clear();
                foreach (SysAidTicketSearchResult result in results)
                {
                    tblResults.Rows.Add(addSearchResultRow(result));
                }
            }
        }