Beispiel #1
0
        public static Guid PrintVisitor(int id)
        {
            VisitorRegistrationService.EndpointClient client = new VisitorRegistrationService.EndpointClient();

            Guid fileID = client.GenerateVisitorPass(id);

            return(fileID);
        }
        /// <summary>
        /// Page Load
        /// </summary>
        /// <param name="sender">Object Sender</param>
        /// <param name="e">EventArgs e</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["ID"] != " ")
            {
                VisitorRegistrationService.EndpointClient client = new VisitorRegistrationService.EndpointClient();
                byte[] file = client.DownloadVisitorPass(Guid.Parse(Request.QueryString["ID"]));

                Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
                Response.AddHeader("Content-Disposition", "attachment; filename=visitorpass.docx");
                Response.OutputStream.Write(file, 0, file.Length);
                Response.Flush();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Build Visitor Table
        /// </summary>
        protected void BuildTable()
        {
            StringBuilder str = new StringBuilder();

            VisitorRegistrationService.EndpointClient client = new VisitorRegistrationService.EndpointClient();
            var visitors = client.GetCurrentVisitors();

            foreach (var visitor in visitors)
            {
                str.AppendLine("<tr><th>" + visitor.First_Name + "</th><th>" + visitor.Last_Name + "</th><th>" + visitor.Email + "</th><th>" + visitor.HostEmail + "</th><th>" + visitor.IDNumber + "</th><th><a runat='server' onclick='PrintPass(" + visitor.ID + ")' class='btn btn-xs btn-success'><span class='glyphicon glyphicon-print'></span> Create Pass</a></th></tr>");
            }

            this.tbody.InnerHtml = str.ToString();
        }