private void BuildTable() { Table table = new Table(); table.AddHeaderRow(2, "Notary's sign check cookie"); if (this.cookie != null) { table.AddRow("You are:", this.cookie.Certificate.FullName); table.AddRow(string.Empty, "Sign check cookie set."); } else { table.AddRow("You are:", "Unknown"); } table.AddSpaceRow(2, 32); if (!this.valid) { table.AddRow(string.Empty, this.message); if (!string.IsNullOrEmpty(this.error)) { table.AddRow(string.Empty, this.error); } } mainPanel.Controls.Add(table); }
protected void Page_Load(object sender, EventArgs e) { this.table = new Table(); this.maySign = false; if (ConnectToServer()) { bool isNotary = ReadSignCheckCookie(); bool requestValid = ReadRequestData(); bool notAlreadySigned = DisplayRequest(); if (isNotary) { if (requestValid) { if (notAlreadySigned) { table.AddRow(string.Empty, "Please verify the name and certificate id matches the paper form before signing."); this.maySign = true; Button signButton = new Button(); signButton.ID = "signButton"; signButton.Text = "Sign"; signButton.Click += new EventHandler(signButton_Click); table.AddRow(null, signButton); } else { table.AddRow(string.Empty, "You have already signed."); } } else { table.AddRow(string.Empty, "You cannot sign because the request is not valid."); } } else { table.AddRow(string.Empty, "You are not authorized to sign."); } } mainPanel.Controls.Add(table); }