private void AddPageToTable(DataObjects.Page page) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerHtml = "<a href='/page/" + page.PageID.ToString() + "'>" + page.ShortTitle + "</a>"; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.Volume; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.Issue; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.Year; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.IndicatedPages; row.Cells.Add(cell); tblPages.Rows.Add(row); }
private void _dgrCategories_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { DataGrid _dgrSubCategories = (DataGrid)e.Item.FindControl("dgrSubCategories"); _dgrSubCategories.ItemDataBound += new DataGridItemEventHandler(_dgrSubCategories_ItemDataBound); if (_dgrSubCategories != null) { LoadSubCategories(Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "Cat_ID")), _dgrSubCategories); } Literal _ltrURL = e.Item.FindControl("ltrTopCategoryURL") as Literal; if (_ltrURL != null) { _ltrURL.Text += Config.CustomExtension; } System.Web.UI.HtmlControls.HtmlImage _imgShowSubCats = e.Item.FindControl("imgShowHideSubCatList") as System.Web.UI.HtmlControls.HtmlImage; if (_imgShowSubCats != null) { System.Web.UI.HtmlControls.HtmlTableCell _htcSubCats = e.Item.FindControl("htcSubCatList") as System.Web.UI.HtmlControls.HtmlTableCell; _imgShowSubCats.Attributes.Add("onClick", "ShowHide(" + _htcSubCats.ClientID + ");"); } } }
private void CreateTitle(System.Web.UI.HtmlControls.HtmlTableCell Parent) { System.Web.UI.HtmlControls.HtmlGenericControl titleText = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); titleText.Attributes["class"] = "titleText"; System.Web.UI.HtmlControls.HtmlGenericControl close = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); close.Attributes["class"] = "close"; Parent.Controls.Add(titleText); if (TitleTemplate == null) { if (Text == "") { titleText.InnerHtml = "untitled"; } else { titleText.InnerHtml = Text; } } else { TitleTemplate.InstantiateIn(titleText); } if (Closable) { Parent.Controls.Add(close); } }
// The next two functions simply create the html for the status tables. You can safely ignore these. protected void CreateStatusTable(DocuSignAPI.FilteredEnvelopeStatuses statuses) { foreach (DocuSignAPI.EnvelopeStatus status in statuses.EnvelopeStatuses) { var containerDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); var info = new System.Web.UI.HtmlControls.HtmlGenericControl("p") { InnerHtml = "<a href=\"javascript:toggle('" + status.EnvelopeID + "_Detail" + "');\"><img src=\"images/plus.png\"></a> " + status.Subject + " (" + status.Status.ToString() + ") - " + status.EnvelopeID }; containerDiv.Controls.Add(info); System.Web.UI.HtmlControls.HtmlGenericControl envelopeDetail = CreateEnvelopeTable(status); envelopeDetail.Attributes[Keys.Class] = "detail"; envelopeDetail.Attributes[Keys.Id] = status.EnvelopeID + "_Detail"; containerDiv.Controls.Add(envelopeDetail); var tr = new System.Web.UI.HtmlControls.HtmlTableRow(); var tc = new System.Web.UI.HtmlControls.HtmlTableCell(); tc.Controls.Add(containerDiv); tr.Cells.Add(tc); statusTable.Rows.Add(tr); } }
public static void ShowMessage(System.Web.UI.HtmlControls.HtmlTableCell cell, string msg, bool isSuccess) { if (cell != null && msg != null) { cell.Attributes.Add("class", (isSuccess ? "Success" : "Failed")); ShowMessage(cell, msg); } }
public static void ShowMessage(System.Web.UI.HtmlControls.HtmlTableCell cell, string msg, string style) { if (cell != null && msg != null) { cell.Attributes.Add("class", style); ShowMessage(cell, msg); } }
// Add the recipients to the UI protected void AddRecipients(DocuSignAPI.Recipient[] recipients) { int i = 1; foreach (DocuSignAPI.Recipient recipient in recipients) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell roleCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell nameCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell emailCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell securityCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell inviteCell = new System.Web.UI.HtmlControls.HtmlTableCell(); roleCell.InnerHtml = "<input id=\"RecipientRole\" type=\"text\" readonly=\"true\" name=\"RecipientRole" + i.ToString() + "\" value=\"" + recipient.RoleName + "\"/>"; nameCell.InnerHtml = "<input id=\"RecipientName\" type=\"text\" name=\"RecipientName" + i.ToString() + "\" value=\"" + recipient.UserName + "\"/>"; emailCell.InnerHtml = "<input id=\"RecipientEmail\" type=\"text\" name=\"RecipientEmail" + i.ToString() + "\" value=\"" + recipient.Email + "\"/>"; string security = ""; if (!String.IsNullOrEmpty(recipient.AccessCode)) { security = "Access code: " + recipient.AccessCode; } else if (recipient.PhoneAuthentication != null) { security = "Phone Authentication"; } else if (recipient.RequireIDLookup) { security = "ID Check"; } else { security = "None"; } securityCell.InnerHtml = "<input id=\"RecipientSecurity\" type=\"text\" readonly=\"true\" name=\"RecipientSecurity" + i.ToString() + "\" value=\"" + security + "\"/>"; inviteCell.InnerHtml = "<ul class=\"switcher\" name=\"RecipientInvite" + i.ToString() + "\" ><li class=\"active\"><a href=\"#\" title=\"On\">ON</a></li><li><a href=\"#\" title=\"OFF\">OFF</a></li><input id=\"RecipientInviteToggle" + i.ToString() + "\" name=\"RecipientInviteToggle" + i.ToString() + "\" value=\"RecipientInviteToggle" + i.ToString() + "\" type=\"checkbox\" checked=\"\" style=\"display: none\"></ul>"; //<ul class="switcher" id="RecipientInvite1"> // <li id="RecipientInviteon1" class="active"><a href="#" title="On">ON</a></li> // <li id="RecipientInviteoff1"><a href="#" title="OFF">OFF</a></li> // <input id="RecipientInviteToggle1" name="RecipientInviteToggle1" value="RecipientInviteToggle1" type="checkbox" checked="" style="display: none"> //</ul> inviteCell.Attributes["ID"] = String.Format("RecipientInvite{0}", recipient.ID); inviteCell.Attributes["name"] = String.Format("RecipientInvite{0}", recipient.ID); row.Cells.Add(roleCell); row.Cells.Add(nameCell); row.Cells.Add(emailCell); row.Cells.Add(securityCell); row.Cells.Add(inviteCell); RecipientTable.Rows.Add(row); i++; } }
protected void Page_Load(object sender, EventArgs e) { System.Web.UI.HtmlControls.HtmlTableRow r1; System.Web.UI.HtmlControls.HtmlTableCell c1; System.Web.UI.HtmlControls.HtmlTableCell c2; System.Web.UI.HtmlControls.HtmlTableCell c3; System.Web.UI.HtmlControls.HtmlTableCell c4; System.Web.UI.HtmlControls.HtmlImage img; System.Web.UI.HtmlControls.HtmlGenericControl name; System.Web.UI.HtmlControls.HtmlInputText quant; System.Web.UI.HtmlControls.HtmlGenericControl subtot; System.Web.UI.WebControls.LinkButton rmvBtn; System.Web.UI.HtmlControls.HtmlGenericControl glyph; for (int i = 0; i < 5; i++) { r1 = new System.Web.UI.HtmlControls.HtmlTableRow(); c1 = new System.Web.UI.HtmlControls.HtmlTableCell(); c2 = new System.Web.UI.HtmlControls.HtmlTableCell(); c3 = new System.Web.UI.HtmlControls.HtmlTableCell(); c4 = new System.Web.UI.HtmlControls.HtmlTableCell(); img = new System.Web.UI.HtmlControls.HtmlImage(); name = new System.Web.UI.HtmlControls.HtmlGenericControl(); quant = new System.Web.UI.HtmlControls.HtmlInputText(); subtot = new System.Web.UI.HtmlControls.HtmlGenericControl(); rmvBtn = new System.Web.UI.WebControls.LinkButton(); glyph = new System.Web.UI.HtmlControls.HtmlGenericControl(); r1.Controls.Add(c1); r1.Controls.Add(c2); r1.Controls.Add(c3); r1.Controls.Add(c4); img.Src = "http://placehold.it/50"; name.InnerText = " Item name"; c1.Controls.Add(img); c1.Controls.Add(name); quant.Style["width"] = "5em"; c2.Controls.Add(quant); subtot.InnerText = "$10.00"; c3.Controls.Add(subtot); rmvBtn.CssClass = "btn btn-danger"; rmvBtn.PostBackUrl = "?delete=id"; glyph.Attributes.Add("aria-hidden", "true"); glyph.Attributes.Add("class", "glyphicon glyphicon-remove"); rmvBtn.Controls.Add(glyph); c4.Controls.Add(rmvBtn); cartDisplay.Controls.Add(r1); } }
protected void CreateControls() { DataTable dt = new DataTable(); KingTop.BLL.SysManage.PublicOper bllPublicOper = new KingTop.BLL.SysManage.PublicOper(); dt = bllPublicOper.GetList("ALL", Utils.getOneParams("")); DataRow[] dr1 = dt.Select("IsValid=1"); System.Web.UI.HtmlControls.HtmlTable t = new System.Web.UI.HtmlControls.HtmlTable(); int k = 0; int drLen = dr1.Length; if (drLen > 0) { for (int i = 0; i < drLen; i = i + 6) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); for (int j = 0; j < 6; j++) { k = i + j; if (k == drLen) { break; } DataRow dr = dr1[k]; if (dr["IsValid"].ToString() == "False") { continue; } System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlInputCheckBox chkbox1 = new System.Web.UI.HtmlControls.HtmlInputCheckBox(); chkbox1.Name = "OperName"; chkbox1.Value = dr["OperName"].ToString(); string s = string.Empty; if (myOperCode.IndexOf("," + dr["OperName"].ToString() + ",") != -1) { s = "<input id=\"" + dr["OperName"].ToString() + "\" type=\"checkbox\" name=\"OperName\" value=\"" + dr["OperName"].ToString() + "|" + dr["Title"].ToString() + "\" checked/><label for=\"" + dr["OperName"].ToString() + "\">" + dr["Title"].ToString() + "</label>"; } else { s = "<input id=\"" + dr["OperName"].ToString() + "\" type=\"checkbox\" name=\"OperName\" value=\"" + dr["OperName"].ToString() + "|" + dr["Title"].ToString() + "\" /><label for=\"" + dr["OperName"].ToString() + "\">" + dr["Title"].ToString() + "</label>"; } CheckBox chkbox = new CheckBox(); chkbox.ID = dr["OperName"].ToString(); chkbox.Text = dr["Title"].ToString(); cell.Width = "120px"; cell.InnerHtml = s; row.Cells.Add(cell); } t.Controls.Add(row); } } this.OperTD.Controls.Add(t); }
// Add the recipients to the UI protected void AddRecipients(DocuSignAPI.Recipient[] recipients) { int i = 1; foreach (DocuSignAPI.Recipient recipient in recipients) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell roleCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell nameCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell emailCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell securityCell = new System.Web.UI.HtmlControls.HtmlTableCell(); System.Web.UI.HtmlControls.HtmlTableCell inviteCell = new System.Web.UI.HtmlControls.HtmlTableCell(); roleCell.InnerHtml = "<input id=\"RecipientRole\" type=\"text\" readonly=\"true\" name=\"RecipientRole" + i.ToString() + "\" value=\"" + recipient.RoleName + "\"/>"; nameCell.InnerHtml = "<input id=\"RecipientName\" type=\"text\" name=\"RecipientName" + i.ToString() + "\" value=\"" + recipient.UserName + "\"/>"; emailCell.InnerHtml = "<input id=\"RecipientEmail\" type=\"text\" name=\"RecipientEmail" + i.ToString() + "\" value=\"" + recipient.Email + "\"/>"; string security = ""; if (!String.IsNullOrEmpty(recipient.AccessCode)) { security = "Access code: " + recipient.AccessCode; } else if (recipient.PhoneAuthentication != null) { security = "Phone Authentication"; } else if (recipient.RequireIDLookup) { security = "ID Check"; } else { security = "None"; } securityCell.InnerHtml = "<input id=\"RecipientSecurity\" type=\"text\" readonly=\"true\" name=\"RecipientSecurity" + i.ToString() + "\" value=\"" + security + "\"/>"; inviteCell.InnerHtml = "<ul class=\"switcher\" name=\"RecipientInvite" + i.ToString() + "\" ><li class=\"active\"><a href=\"#\" title=\"On\">ON</a></li><li><a href=\"#\" title=\"OFF\">OFF</a></li><input id=\"RecipientInviteToggle" + i.ToString() + "\" name=\"RecipientInviteToggle" + i.ToString() + "\" value=\"RecipientInviteToggle" + i.ToString() + "\" type=\"checkbox\" checked=\"\" style=\"display: none\"></ul>"; //<ul class="switcher" id="RecipientInvite1"> // <li id="RecipientInviteon1" class="active"><a href="#" title="On">ON</a></li> // <li id="RecipientInviteoff1"><a href="#" title="OFF">OFF</a></li> // <input id="RecipientInviteToggle1" name="RecipientInviteToggle1" value="RecipientInviteToggle1" type="checkbox" checked="" style="display: none"> //</ul> inviteCell.Attributes["ID"] = String.Format("RecipientInvite{0}", recipient.ID); inviteCell.Attributes["name"] = String.Format("RecipientInvite{0}", recipient.ID); row.Cells.Add(roleCell); row.Cells.Add(nameCell); row.Cells.Add(emailCell); row.Cells.Add(securityCell); row.Cells.Add(inviteCell); RecipientTable.Rows.Add(row); i++; } }
void InitButtonSection() { System.Web.UI.HtmlControls.HtmlTableCell c = (System.Web.UI.HtmlControls.HtmlTableCell)mfPerformanceIndicatorForm.Rows[mfPerformanceIndicatorForm.Rows.Count - 1].Cells[0].Controls[0].Controls[0].Controls[0]; Button p = (Button)c.Controls[0]; Button OrgLocButton = new Button(); OrgLocButton.Text = "Create Performance Indicator Form and Assign to Org Location"; OrgLocButton.OnClientClick = "__doPostBack('" + this.UniqueID + "', 'assign'); return false;"; c.Controls.AddAt(1, OrgLocButton); c.Controls.AddAt(1, new LiteralControl(" or ")); //c.Controls.AddAt(1, new LiteralControl("<INPUT TYPE = submit name = " + this.UniqueID + " Value = 'Click Me' />")); }
void GenerateTableHeader(String[] headers, ref System.Web.UI.HtmlControls.HtmlTable table) { var headerRow = new System.Web.UI.HtmlControls.HtmlTableRow(); foreach (var str in headers) { var header = new System.Web.UI.HtmlControls.HtmlTableCell("th"); header.InnerText = str; headerRow.Cells.Add(header); } table.Rows.Add(headerRow); }
private void CreateSubControls(System.Web.UI.HtmlControls.HtmlTableRow Parent) { System.Web.UI.HtmlControls.HtmlTableCell left = new System.Web.UI.HtmlControls.HtmlTableCell(); left.Attributes["class"] = "left"; System.Web.UI.HtmlControls.HtmlTableCell right = new System.Web.UI.HtmlControls.HtmlTableCell(); right.Attributes["class"] = "right"; System.Web.UI.HtmlControls.HtmlTableCell center = new System.Web.UI.HtmlControls.HtmlTableCell(); center.Attributes["class"] = "center"; Parent.Controls.Add(left); Parent.Controls.Add(center); Parent.Controls.Add(right); }
protected override void AddFirstRowRightControls(System.Web.UI.HtmlControls.HtmlTableCell cell) { base.AddFirstRowRightControls(cell); if (!IsNew) { cell.Controls.Add(new MultiViewSwitcher("存货编辑", "屠宰分割")); } else { cell.Controls.Add(new MultiViewSwitcher("存货新建", "屠宰分割")); } }
private void CreateContents(System.Web.UI.HtmlControls.HtmlTableCell Parent) { if (ContentTemplate != null) { if (ContentTemplateContainer == null) { _Container = new Panel(); ContentTemplate.InstantiateIn(ContentTemplateContainer); } } _Container.CssClass = "content"; Parent.Controls.Clear(); Parent.Controls.Add(ContentTemplateContainer); regions.Add((IAttributeAccessor)ContentTemplateContainer); }
void GenerateTableRowsFromSp1(String procedure, ref System.Web.UI.HtmlControls.HtmlTable table) { String Connstr = "SERVER=sql2005.iats.missouri.edu;Integrated Security = True;DATABASE=MU_BUS_TechServices_1;"; System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(Connstr); conn.Open(); System.Data.SqlClient.SqlCommand cmd2 = new System.Data.SqlClient.SqlCommand(); cmd2.Connection = conn; cmd2.CommandType = System.Data.CommandType.StoredProcedure; cmd2.CommandText = procedure; System.Data.SqlClient.SqlDataReader query = cmd2.ExecuteReader(); if (query.HasRows == true) { System.Data.DataTable dt = new System.Data.DataTable(); dt.Load(query); for (var i = 0; i < dt.Rows.Count; i++) { var row = dt.Rows[i]; var htmlRow = new System.Web.UI.HtmlControls.HtmlTableRow(); htmlRow.ID = i.ToString(); htmlRow.Attributes.Add("class", "data-row"); foreach (var col in dt.Columns) { var field = col.ToString(); if (!check_is_header(field)) { continue; } var tableCell = new System.Web.UI.HtmlControls.HtmlTableCell("td"); var content = row[field].ToString(); //if (dt.Columns.IndexOf(field) > row.ItemArray.Count() - 6 && content.Length > 0) content = content.Substring(0, content.IndexOf(" ")); var innerHtml = "<a href='AddFromLog.aspx?id=" + row.ItemArray[1] + "' target='_blank'><div>" + content + "</div></a>"; tableCell.InnerHtml = innerHtml; htmlRow.Cells.Add(tableCell); } table.Rows.Add(htmlRow); } } }
private void AddTitleToTable(DataObjects.Title title) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerHtml = "<a href='/bibliography/" + title.TitleID.ToString() + "'>" + title.ShortTitle + "</a>"; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); tblPages.Rows.Add(row); }
private void AddItemToTable(DataObjects.PageSummaryView psv) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerHtml = "<a href='/item/" + psv.ItemID.ToString() + "'>" + psv.ShortTitle + "</a>"; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = psv.Volume; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); tblPages.Rows.Add(row); }
private void AddItemToTable(DataObjects.PageSummaryView psv) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerHtml = "<a href='/item/" + psv.ItemID.ToString() + "'>" + psv.ShortTitle + "</a>"; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = psv.Volume; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); tblPages.Rows.Add(row); }
// The next two functions simply create the html for the status tables. You can safely ignore these. protected void CreateStatusTable(DocuSignAPI.FilteredEnvelopeStatuses statuses) { foreach (DocuSignAPI.EnvelopeStatus status in statuses.EnvelopeStatuses) { System.Web.UI.HtmlControls.HtmlGenericControl containerDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); System.Web.UI.HtmlControls.HtmlGenericControl info = new System.Web.UI.HtmlControls.HtmlGenericControl("p"); info.InnerHtml = "<a href=\"javascript:toggle('" + status.EnvelopeID + "_Detail" + "');\"><img src=\"images/plus.png\"></a> " + status.Subject + " (" + status.Status.ToString() + ") - " + status.EnvelopeID; containerDiv.Controls.Add(info); System.Web.UI.HtmlControls.HtmlGenericControl envelopeDetail = CreateEnvelopeTable(status); envelopeDetail.Attributes["class"] = "detail"; envelopeDetail.Attributes["id"] = status.EnvelopeID + "_Detail"; containerDiv.Controls.Add(envelopeDetail); System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell tc = new System.Web.UI.HtmlControls.HtmlTableCell(); tc.Controls.Add(containerDiv); tr.Cells.Add(tc); statusTable.Rows.Add(tr); } }
private void bindmmAuditingReport1() { List <DataTable> SelectedReports = exportreport.GetSelectedDataTable(); // Runs all of the selected reports (selections stored in Session variable). for (int i = 0; i < exportreport.DataTableList.Count; i++) { string reportname = string.Empty; Label lblsetreporttitle = new Label(); lblsetreporttitle.Font.Bold = true; lblsetreporttitle.Font.Size = 12; System.Web.UI.HtmlControls.HtmlTableRow tbrow = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell tbcol = new System.Web.UI.HtmlControls.HtmlTableCell(); //bool hasValue = DDRSessionEntity.Current.checkcount.TryGetValue((i + 1).ToString(), out reportname); //tbcol.InnerText = reportname; //lblsetreporttitle.Text = reportname; lblsetreporttitle.Text = SelectedReports.ElementAt(i).TableName; tbcol.Controls.Add(lblsetreporttitle); tbrow.Cells.Add(tbcol); rpttable.Rows.Add(tbrow); //Create blank row System.Web.UI.HtmlControls.HtmlTableRow tbblankrow = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell tbblankcol = new System.Web.UI.HtmlControls.HtmlTableCell(); tbblankcol.Height = "15"; tbblankrow.Cells.Add(tbblankcol); rpttable.Rows.Add(tbblankrow); //Initialize the grid with data. GridView reportgrdi = new GridView(); reportgrdi = GridStyle(); reportgrdi.DataSource = SelectedReports.ElementAt(i);//MMAuditingbindtableheader(); reportgrdi.DataBind(); if (SelectedReports.ElementAt(i).Rows.Count > 0) { reportgrdi.Rows[0].Cells[0].Width = 250; } System.Web.UI.HtmlControls.HtmlTableRow tbrowtable = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell tbcoltable = new System.Web.UI.HtmlControls.HtmlTableCell(); tbcoltable.Controls.Add(reportgrdi); tbrowtable.Cells.Add(tbcoltable); rpttable.Rows.Add(tbrowtable); } }
private void AddPageToTable(DataObjects.Page page) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerHtml = "<a href='/page/" + page.PageID.ToString() + "'>" + page.ShortTitle + "</a>"; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.Volume; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.Issue; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.Year; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerText = page.IndicatedPages; row.Cells.Add(cell); tblPages.Rows.Add(row); }
private void genCardInfo(System.Web.UI.HtmlControls.HtmlGenericControl div, System.Web.UI.HtmlControls.HtmlTableCell cell, CowsCard cards) { if (cards == null) { return; } Cows_CardsCFGData d = Cows_CardsCFG.getInstance().getValue(cards.m_cardType); if (d != null) { cell.InnerText = d.m_cardName; } foreach (var card in cards.m_cards) { Image img = new Image(); img.ImageUrl = "/data/image/poker/" + DefCC.s_pokerCows[card.flower] + "_" + card.point + ".png"; div.Controls.Add(img); } }
private string ExportToCSV() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); //-------------------------------- slice--------------------------------------- Hierarchy[] hiers = this.Axes[2].Hierarchies.ToSortedByUniqueNameArray(); for (int i = 0; i < hiers.Length; i++) { Hierarchy hier = hiers[i]; //not displaying without mems if (hier.FilterMember == null) { continue; } DataMember mem = hier.FilterMember; //not displaying only with "All" members if (mem.LevelDepth == 0 && !(mem is CalculatedMember) && hier.Levels[0].IsAllLevel) { continue; } // add hier and mem sb.Append(hier.DisplayName); sb.Append(": "); Olap.CalculatedMemberTemplates.MembersAggregate aggMem = mem as Olap.CalculatedMemberTemplates.MembersAggregate; if (aggMem != null) //if aggregate, show children instead of agg itself { for (int j = 0; j < aggMem.Members.Count; j++) { sb.Append(aggMem.Members[j].Name); if (j < aggMem.Members.Count - 1) { sb.Append(", "); } } } else { sb.Append(mem.Name); } sb.Append("\r\n"); } sb.Append("\r\n"); //----------------------------------------------------------------------------- int Ax0MemCount = this.Cellset.Axis0TupleMemCount; int Ax1MemCount = this.Cellset.Axis1TupleMemCount; int Ax0PosCount = this.Cellset.Axis0PosCount; int Ax1PosCount = this.Cellset.Axis1PosCount; Hierarchy ax1Hier = null; Hierarchy ax0Hier = null; //-------------------------------- table--------------------------------------- System.Web.UI.HtmlControls.HtmlTableRow tr = null; System.Web.UI.HtmlControls.HtmlTableCell td = null; if (this.Cellset.IsValid == false) { return("Cellset contains no data"); } for (int i = 0; i < Ax0MemCount; i++) { for (int j = 0; j < Ax1MemCount; j++) { //hier uname in last row if (i == Ax0MemCount - 1) { sb.Append(this.Axes[1].Hierarchies[j].DisplayName); } sb.Append("\t"); } ax0Hier = this.Axes[0].Hierarchies[i]; for (int j = 0; j < Ax0PosCount; j++) { CellsetMember mem = this.Cellset.GetCellsetMember(0, i, j); sb.Append(mem.Name); sb.Append("\t"); } // hier name in last col sb.Append(ax0Hier.DisplayName); sb.Append("\r\n"); } for (int i = 0; i < Ax1PosCount; i++) { for (int j = 0; j < Ax1MemCount; j++) { ax1Hier = this.Axes[1].Hierarchies[j]; CellsetMember mem = this.Cellset.GetCellsetMember(1, j, i); sb.Append(mem.Name); sb.Append("\t"); } for (int j = 0; j < Ax0PosCount; j++) { Cell olapCell = this.Cellset.GetCell(j, i); sb.Append(olapCell.FormattedValue.Replace(System.Globalization.NumberFormatInfo.CurrentInfo.NumberGroupSeparator, "")); sb.Append("\t"); } sb.Append("\r\n"); } return(sb.ToString()); }
public void rptProfilePeriod_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { try { EHS_PROFILE_MEASURE metric = (EHS_PROFILE_MEASURE)e.Item.DataItem; Label lbl; LinkButton lnk; TextBox tb; //bool enabled = LocalProfile().InputPeriod.IsPeriodInputClosed(metric.PRMR_ID) == true ? false : true; bool enabled = true; if (string.IsNullOrEmpty(metric.MEASURE_PROMPT)) { lbl = (Label)e.Item.FindControl("lblMetricName"); lbl.Text = metric.EHS_MEASURE.MEASURE_NAME.Trim(); } ImageButton ib = (ImageButton)e.Item.FindControl("ibAddInput"); ib.Enabled = enabled; if (enabled) { ib.ImageUrl = "~/images/plus.png"; } else { ib.ImageUrl = "~/images/status/checked.png"; } Image img = (Image)e.Item.FindControl("imgHazardType"); System.Web.UI.HtmlControls.HtmlTableCell cell1 = (System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("tdMetricName"); if (metric.EHS_MEASURE.MEASURE_CATEGORY == "ENGY" || metric.EHS_MEASURE.MEASURE_CATEGORY == "EUTL") { cell1.Attributes.Add("Class", "rptInputTable energyColor"); img.ImageUrl = "~/images/status/energy.png"; } else if (metric.EHS_MEASURE.MEASURE_CATEGORY == "PROD" || metric.EHS_MEASURE.MEASURE_CATEGORY == "SAFE" || metric.EHS_MEASURE.MEASURE_CATEGORY == "FACT") { img.ImageUrl = "~/images/status/inputs.png"; img.ToolTip = WebSiteCommon.GetXlatValueLong("measureCategoryEHS", metric.EHS_MEASURE.MEASURE_CATEGORY); ib = (ImageButton)e.Item.FindControl("ibAddInput"); ib.Visible = false; } else { cell1.Attributes.Add("Class", "rptInputTable wasteColor"); if (metric.REG_STATUS == "HZ") { img.ImageUrl = "~/images/status/hazardous.png"; } else { img.ImageUrl = "~/images/status/waste.png"; } img.ToolTip = WebSiteCommon.GetXlatValueLong("regulatoryStatus", metric.REG_STATUS); if (!string.IsNullOrEmpty(metric.UN_CODE)) { img.ToolTip += (". " + SessionManager.DisposalCodeList.FirstOrDefault(l => l.UN_CODE == metric.UN_CODE).DESCRIPTION); } } cell1 = (System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("tdMetricReqd"); if ((bool)metric.IS_REQUIRED) { cell1.Attributes.Add("Class", "rptInputTable required"); } if (LocalProfile().InputPeriod.CountPeriodInputList(metric.PRMR_ID) == 0) { LocalProfile().CreatePeriodInput(LocalProfile().InputPeriod, metric, false); } Repeater rpt = (Repeater)e.Item.FindControl("rptProfileInput"); rpt.DataSource = LocalProfile().InputPeriod.GetPeriodInputList(metric.PRMR_ID); rpt.DataBind(); } catch { } } }
// private string m_extractionlayers;// needs to be array // private bool m_inputPolyAllowed; // private string m_jsonServiceLayers = "{}"; public string LoadConfigurator(ESRI.ArcGIS.Server.IServerContext serverContext, System.Collections.Specialized.NameValueCollection ServerObjectProperties, System.Collections.Specialized.NameValueCollection ExtensionProperties, System.Collections.Specialized.NameValueCollection InfoProperties, bool isEnabled, string servicesEndPoint, string serviceName, string serviceTypeName) { logger.LogMessage(ServerLogger.msgType.warning, "SOE manager page", 8000, "SOE Manager page: Loading"); // Just return a message if the SOE is not enabled on the current service. if (!isEnabled) return ("<span>No Properties to configure, sorry</span>"); // Initialize member variables holding the SOE's properties. if (!string.IsNullOrEmpty(ExtensionProperties["FlowAccum"])){ m_flowacc = ExtensionProperties["FlowAccum"]; } if (!string.IsNullOrEmpty(ExtensionProperties["FlowDir"])){ m_flowdir = ExtensionProperties["FlowDir"]; } //if (!(ExtensionProperties["ExtractionLayers"] == null || ExtensionProperties["ExtractionLayers"].Length==0)) //{ // m_extractionlayers = ExtensionProperties["ExtractionLayers"]; // } //Container div and table. System.Web.UI.HtmlControls.HtmlGenericControl propertiesDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("propertiesDiv"); propertiesDiv.Style[System.Web.UI.HtmlTextWriterStyle.Padding] = "10px"; System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable(); table.CellPadding = table.CellSpacing = 4; propertiesDiv.Controls.Add(table); // Header row. System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.ColSpan = 2; System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label(); lbl.Text = "Choose the flow accumulation and flow direction layers."; cell.Controls.Add(lbl); // Flow Acc Layer drop-down row. row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); lbl = new System.Web.UI.WebControls.Label(); cell.Controls.Add(lbl); lbl.Text = "Flow Accumulation:"; cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.Controls.Add(m_FlowAccDropDown); m_FlowAccDropDown.ID = "flowAccDropDown"; // Wire the OnLayerChanged JavaScript function (defined in SupportingJavaScript) to fire when a new layer is selected. m_FlowAccDropDown.Attributes["onchange"] = "ExtensionConfigurator.OnLayerChanged(this);"; // Flow dir layer drop-down row. row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); lbl = new System.Web.UI.WebControls.Label(); cell.Controls.Add(lbl); lbl.Text = "Flow Direction:"; cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.Controls.Add(m_FlowDirDropDown); m_FlowDirDropDown.ID = "flowDirDropDown"; // Get the path of the underlying map document and use it to populate the properties drop-downs. string fileName = ServerObjectProperties["FilePath"]; populateDropDowns(serverContext, fileName); // Render and return the HTML for the container div. System.IO.StringWriter stringWriter = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter (stringWriter); propertiesDiv.RenderControl(htmlWriter); string html = stringWriter.ToString(); stringWriter.Close(); return html; }
/// <summary> /// Creates the body. /// </summary> /// <returns></returns> /// <Remarks> /// Created Time: 2008-7-21 15:58 /// Created By: jack_que /// Last Modified Time: /// Last Modified By: /// </Remarks> public StringBuilder CreateBody() { StringBuilder builder = new StringBuilder(); System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable(); DataTable dt = this.dataSource.Tables[0]; bool flag = false; if (this.dataSource != null) { //处理有分区的行 for (int i = 0; i < report.Rows.Count; i++) { System.Web.UI.HtmlControls.HtmlTableRow tr1 = null; System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell td = new System.Web.UI.HtmlControls.HtmlTableCell(); td.InnerText = report.Rows[i].Header.HeaderText; td.RowSpan = report.Rows[i].RowSpan; tr.Cells.Add(td); for (int n = 0; n < dt.Rows.Count; n++) { DataRow row = dt.Rows[n]; tr1 = new System.Web.UI.HtmlControls.HtmlTableRow(); if (row[0].ToString() == report.Rows[i].Header.HeaderValue) { for (int j = 1; j < dt.Columns.Count; j++) { DataColumn column = dt.Columns[j]; System.Web.UI.HtmlControls.HtmlTableCell td1 = new System.Web.UI.HtmlControls.HtmlTableCell(); td1.InnerText = row[column].ToString(); if (j == 1) tr.Cells.Add(td1); else { tr1.Cells.Add(td1); } flag = true; } } if (flag) { if (n == 0) table.Rows.Add(tr); else table.Rows.Add(tr1); dt.Rows.RemoveAt(i); } } } //处理余下的行 for (int i = 0; i < dt.Rows.Count; i++) { System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow(); DataRow row = dt.Rows[i]; for (int j = 0; j < dt.Columns.Count; j++) { DataColumn column = dt.Columns[j]; System.Web.UI.HtmlControls.HtmlTableCell td = new System.Web.UI.HtmlControls.HtmlTableCell(); td.RowSpan = 1; td.ColSpan = 1; td.InnerText = row[column].ToString(); tr.Cells.Add(td); } table.Rows.Add(tr); } } builder.Append("<tbody>"); for (int i = 0; i < table.Rows.Count; i++) { builder.Append("<tr>"); for (int j = 0; j < table.Rows[i].Cells.Count; j++) { builder.Append("<td style='font:11' rowspan=" + table.Rows[i].Cells[j].RowSpan + ">"); builder.Append(table.Rows[i].Cells[j].InnerText); builder.Append("</td>"); } builder.Append("</tr>"); } builder.Append("</tbody>"); return builder; //StringBuilder builder = new StringBuilder(); //System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable(); //if (this.dataSource != null) //{ // DataTable dt = this.dataSource.Tables[0]; // for (int i = 0; i < dt.Rows.Count; i++) // { // DataRow row = dt.Rows[i]; // builder.Append("<tr>"); // for (int j = 0; j < dt.Columns.Count; j++) // { // DataColumn column = dt.Columns[j]; // builder.Append("<td>").Append(row[column].ToString()).Append("</td>"); // } // builder.Append("</tr>"); // } //} //return builder; }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { return; } #region " AdRotator " AdRotator1.Height = 100; AdRotator1.Width = 100; AdRotator1.AdvertisementFile = "AdRotatorControlTestData.xml"; AdRotator1.BorderColor = Color.Black; AdRotator1.BorderStyle = BorderStyle.Solid; AdRotator1.BorderWidth = 2; #endregion #region " BulletedList " //todo: for BulletedList, the third part of the triplet appears to be if the item is enabled. Could improve Glimpse visualizer for this. BulletedList1.Items.Add(new ListItem("Item Zero", "A")); BulletedList1.Items.Add(new ListItem("Item One", "B")); BulletedList1.Items.Add(new ListItem("Item Two", "C")); BulletedList1.Items.Add(new ListItem("Item Three (disabled)", "D")); BulletedList1.Items[3].Enabled = false; #endregion #region " Button " Button1.Text = "I am Button1"; Button1.ToolTip = "Button1 Tooltip is here."; Button1.Width = 300; Button1.Height = 80; Button1.BackColor = Color.Red; Button1.ForeColor = Color.Blue; #endregion #region " Calendar " Calendar1.DayNameFormat = DayNameFormat.FirstTwoLetters; Calendar1.FirstDayOfWeek = FirstDayOfWeek.Monday; Calendar1.Caption = "Super calendar!"; #endregion #region " Checkbox " CheckBox1Checked.Checked = true; CheckBox1Checked.Text = "This is a checked Checkbox."; CheckBox2UnChecked.Checked = false; CheckBox2UnChecked.Text = "This is an unchecked Checkbox."; #endregion #region " CheckboxList " CheckBoxList1.Items.Add(new ListItem("Item Zero (default)", "A")); CheckBoxList1.Items.Add(new ListItem("Item One (selected)", "B")); CheckBoxList1.Items.Add(new ListItem("Item Two (not selected)", "C")); CheckBoxList1.Items.Add(new ListItem("Item Three (disabled)", "D")); CheckBoxList1.Items[1].Selected = true; CheckBoxList1.Items[2].Selected = false; CheckBoxList1.Items[3].Enabled = false; #endregion #region " DropDownList " DropDownList1.Items.Add(new ListItem("Item Zero (default)", "A")); DropDownList1.Items.Add(new ListItem("Item One (selected)", "B")); DropDownList1.Items.Add(new ListItem("Item Two (not selected)", "C")); DropDownList1.Items.Add(new ListItem("Item Three (disabled)", "D")); DropDownList1.Items[1].Selected = true; DropDownList1.Items[2].Selected = false; DropDownList1.Items[3].Enabled = false; #endregion #region " FileUpload " FileUpload1.AllowMultiple = true; FileUpload1.Height = 80; FileUpload1.Width = 300; FileUpload1.ToolTip = "this is a file uploader"; #endregion #region " HiddenField " HiddenField1.Value = "this is a hidden field."; #endregion #region " Hyperlink " HyperLink1.ForeColor = Color.Gray; HyperLink1.NavigateUrl = "https://github.com/Glimpse/Glimpse"; HyperLink1.Text = "Go to Glimpse project site!"; #endregion #region " Image " Image1.ImageUrl = "/Images/logo.jpg"; Image1.AlternateText = "This is a logo"; Image1.DescriptionUrl = "this is the description URL... whatever that is."; #endregion #region " ImageButton " ImageButton1.ImageUrl = "/Images/logo.jpg"; ImageButton1.AlternateText = "This is a logo (ImageButton)"; ImageButton1.DescriptionUrl = "this is the description URL... whatever that is. (ImageButton)"; ImageButton1.PostBackUrl = "PopulatedControls.aspx?ImageButtonPostBack=1"; #endregion #region " ImageMap " ImageMap1.ImageUrl = "/Images/logo.jpg"; ImageMap1.HotSpotMode = HotSpotMode.PostBack; RectangleHotSpot hotSpot1 = new RectangleHotSpot(); hotSpot1.PostBackValue = "hotSpot 1"; hotSpot1.Top = 0; hotSpot1.Bottom = 101; hotSpot1.Left = 0; hotSpot1.Right = 181; hotSpot1.NavigateUrl = "PopulatedControls.aspx"; ImageMap1.HotSpots.Add(hotSpot1); RectangleHotSpot hotSpot2 = new RectangleHotSpot(); hotSpot2.PostBackValue = "hotSpot 2"; hotSpot2.Top = 0; hotSpot2.Bottom = 101; hotSpot2.Left = 182; hotSpot2.Right = 362; hotSpot2.NavigateUrl = "PopulatedControls.aspx"; ImageMap1.HotSpots.Add(hotSpot2); #endregion #region " Label " Label1.Text = "This is the best label. Ever."; Label1.ForeColor = Color.Orange; Label1.Font.Name = "Comic Sans MS"; Label1.Font.Size = 24; #endregion #region " LinkButton " LinkButton1.PostBackUrl = "PopulatedControls.aspx?LinkButton1Postback=1"; LinkButton1.Text = "This is a link button"; LinkButton1.Font.Italic = true; #endregion #region " ListBox " ListBox1.Items.Add(new ListItem("Item Zero (default)", "A")); ListBox1.Items.Add(new ListItem("Item One (selected)", "B")); ListBox1.Items.Add(new ListItem("Item Two (not selected)", "C")); ListBox1.Items.Add(new ListItem("Item Three (disabled)", "D")); ListBox1.Items[1].Selected = true; ListBox1.Items[2].Selected = false; ListBox1.Items[3].Enabled = false; ListBox1.BorderColor = Color.Blue; ListBox1.BorderStyle = BorderStyle.Dashed; ListBox1.BorderWidth = 3; #endregion #region " Literal " Literal1.Text = "<b>This is some literal content</b><pre>OH YEAH!!!" + Environment.NewLine + "This is on the next line.</pre>"; #endregion #region " Localize " Localize1.Mode = LiteralMode.Encode; #endregion #region " MultiView " //todo: The MultiView and View controls don't seem to have any sort of visibility into their data. MultiView1.ActiveViewIndex = 1; #endregion #region " Panel " Panel1.Width = 400; Panel1.Height = 200; Panel1.BorderColor = Color.Green; Panel1.BorderWidth = 5; Panel1.BorderStyle = BorderStyle.Inset; var panel1TextBox1 = new TextBox(); panel1TextBox1.ID = "panel1TextBox1"; panel1TextBox1.Text = "This is the panel1TextBox1 text value."; panel1TextBox1.Width = 300; Panel1.Controls.Add(panel1TextBox1); #endregion #region " PlaceHolder " var placeHolder1TextBox1 = new TextBox(); placeHolder1TextBox1.ID = "placeHolder1TextBox1"; placeHolder1TextBox1.Text = "This is the placeHolder1TextBox1 text value."; placeHolder1TextBox1.Width = 500; PlaceHolder1.Controls.Add(placeHolder1TextBox1); #endregion #region " RadioButton " RadioButton1.Checked = true; RadioButton2.Checked = false; RadioButton1.Text = "This is RadioButton1! The initial value is checked."; RadioButton2.Text = "This is RadioButton2! The initial value is not checked."; RadioButton3.Text = "This is RadioButton3! The initial value is not specified."; #endregion #region " RadioButtonList " RadioButtonList1.Items.Add(new ListItem("Item Zero (default)", "A")); RadioButtonList1.Items.Add(new ListItem("Item One (selected)", "B")); RadioButtonList1.Items.Add(new ListItem("Item Two (not selected)", "C")); RadioButtonList1.Items.Add(new ListItem("Item Three (disabled)", "D")); RadioButtonList1.Items[1].Selected = true; RadioButtonList1.Items[2].Selected = false; RadioButtonList1.Items[3].Enabled = false; RadioButtonList1.BorderColor = Color.Gray; RadioButtonList1.BorderStyle = BorderStyle.Outset; RadioButtonList1.BorderWidth = 2; #endregion #region " Substitution " Substitution1.Visible = true; #endregion #region " Table " Table1.Rows.Add(TableHeaderRowFromStringArray(new string[] { "Column 1 Header", "Column 2 Header", "Column 3 Header" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 A", "Field2", "Field3" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 B", "Field2", "Field3" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 C", "Field2", "Field3" })); #endregion #region " Textbox " TextBox1.Text = "This is a text box control."; TextBox1.ReadOnly = true; #endregion #region " View " var View1Label = new Label(); View1Label.Text = "This is the label inside the view... I am invisible because my parent View is supposed to be in a MultiView."; View1Label.Width = 100; View1.Controls.Add(View1Label); #endregion #region " Wizard " Wizard1.BackColor = Color.Honeydew; WizardStep1.AllowReturn = true; WizardStep2.AllowReturn = true; var WizardStep1TextBox1 = new TextBox(); WizardStep1TextBox1.Text = "This is Wizard step 0 checkbox 1."; WizardStep1.Controls.Add(WizardStep1TextBox1); var WizardStep2TextBox1 = new TextBox(); WizardStep2TextBox1.Text = "This is Wizard step 1 checkbox 1."; WizardStep2.Controls.Add(WizardStep2TextBox1); Wizard1.ActiveStepIndex = 0; #endregion #region " Xml " //todo: need to create an XSLT or else this will crash BrowserLink in VS2013. #endregion #region " HtmlButton " HtmlButton1.Value = "I am Html Button1"; #endregion #region " HtmlReset " HtmlReset1.Value = "I am Html Reset1"; #endregion #region " HtmlSubmit " HtmlSubmit1.Value = "I am Html Submit1"; #endregion #region " HtmlText " HtmlText1.Value = "I am Html Text1"; HtmlText1.Size = 100; #endregion #region " Html Input File " HtmlFile1.Accept = "text/xml"; #endregion #region " HtmlPassword " HtmlPassword1.Size = 200; HtmlPassword1.Value = "MyVoiceIsMyPassportVerifyMe"; #endregion #region " Html Input Checkbox " HtmlCheckbox1.Checked = true; HtmlCheckbox1.Name = "HtmlCheckbox1Name"; #endregion #region " Html Input Radio " HtmlRadio1.Checked = true; HtmlRadio1.Name = "HtmlRadio1Name"; #endregion #region " Html Input Hidden " HtmlHidden1.Value = "This is so hidden right now..."; HtmlHidden1.Name = "HtmlHidden1Name"; #endregion #region " Html Textarea " HtmlTextArea1.Value = "This is some multiline text.\nThis is line 2."; HtmlTextArea1.Name = "HtmlTextArea1Name"; #endregion #region " Html Table " var htmlTableRow1 = new System.Web.UI.HtmlControls.HtmlTableRow(); var htmlTableRow1Cell1 = new System.Web.UI.HtmlControls.HtmlTableCell(); htmlTableRow1Cell1.InnerText = "Cell1"; htmlTableRow1Cell1.BgColor = "green"; var htmlTableRow1Cell2 = new System.Web.UI.HtmlControls.HtmlTableCell(); htmlTableRow1Cell2.InnerText = "Cell2"; htmlTableRow1Cell2.BgColor = "pink"; htmlTableRow1.Cells.Add(htmlTableRow1Cell1); htmlTableRow1.Cells.Add(htmlTableRow1Cell2); HtmlTable.Rows.Add(htmlTableRow1); HtmlTable.Border = 1; HtmlTable.BorderColor = "gray"; #endregion #region " Html Image " HtmlImage1.Src = "~/Images/orderedList0.png"; HtmlImage1.Alt = "This is a zero picture. Sweet!"; #endregion #region " Html Select " HtmlSelect1.Items.Add(new ListItem("Item Zero (default)", "A")); HtmlSelect1.Items.Add(new ListItem("Item One (selected)", "B")); HtmlSelect1.Items.Add(new ListItem("Item Two (not selected)", "C")); HtmlSelect1.Items.Add(new ListItem("Item Three (disabled)", "D")); HtmlSelect1.Items[1].Selected = true; HtmlSelect1.Items[2].Selected = false; HtmlSelect1.Items[3].Enabled = false; #endregion #region " Html Horizontal Rule " horizontalRule1.InnerText = "Server side Horizontal Rules are the wave of the future."; horizontalRule1.Style.Add(HtmlTextWriterStyle.Color, "red"); horizontalRule1.EnableViewState = true; #endregion #region " Html Div " HtmlDiv1.InnerText = "This is some text inside this server-side div."; HtmlDiv1.EnableViewState = true; #endregion #region " Chart " Chart1.Series["Series1"].Points.DataBindY(PopulatedControls.GetSmallSampleNumericData()); Chart1.BackColor = Color.BlanchedAlmond; System.Diagnostics.Debug.Print(Chart1.ViewStateMode.ToString()); #endregion }
// private string m_extractionlayers;// needs to be array // private bool m_inputPolyAllowed; // private string m_jsonServiceLayers = "{}"; public string LoadConfigurator(ESRI.ArcGIS.Server.IServerContext serverContext, System.Collections.Specialized.NameValueCollection ServerObjectProperties, System.Collections.Specialized.NameValueCollection ExtensionProperties, System.Collections.Specialized.NameValueCollection InfoProperties, bool isEnabled, string servicesEndPoint, string serviceName, string serviceTypeName) { logger.LogMessage(ServerLogger.msgType.warning, "SOE manager page", 8000, "SOE Manager page: Loading"); // Just return a message if the SOE is not enabled on the current service. if (!isEnabled) { return("<span>No Properties to configure, sorry</span>"); } // Initialize member variables holding the SOE's properties. if (!string.IsNullOrEmpty(ExtensionProperties["FlowAccum"])) { m_flowacc = ExtensionProperties["FlowAccum"]; } if (!string.IsNullOrEmpty(ExtensionProperties["FlowDir"])) { m_flowdir = ExtensionProperties["FlowDir"]; } //if (!(ExtensionProperties["ExtractionLayers"] == null || ExtensionProperties["ExtractionLayers"].Length==0)) //{ // m_extractionlayers = ExtensionProperties["ExtractionLayers"]; // } //Container div and table. System.Web.UI.HtmlControls.HtmlGenericControl propertiesDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("propertiesDiv"); propertiesDiv.Style[System.Web.UI.HtmlTextWriterStyle.Padding] = "10px"; System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable(); table.CellPadding = table.CellSpacing = 4; propertiesDiv.Controls.Add(table); // Header row. System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.ColSpan = 2; System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label(); lbl.Text = "Choose the flow accumulation and flow direction layers."; cell.Controls.Add(lbl); // Flow Acc Layer drop-down row. row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); lbl = new System.Web.UI.WebControls.Label(); cell.Controls.Add(lbl); lbl.Text = "Flow Accumulation:"; cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.Controls.Add(m_FlowAccDropDown); m_FlowAccDropDown.ID = "flowAccDropDown"; // Wire the OnLayerChanged JavaScript function (defined in SupportingJavaScript) to fire when a new layer is selected. m_FlowAccDropDown.Attributes["onchange"] = "ExtensionConfigurator.OnLayerChanged(this);"; // Flow dir layer drop-down row. row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); lbl = new System.Web.UI.WebControls.Label(); cell.Controls.Add(lbl); lbl.Text = "Flow Direction:"; cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.Controls.Add(m_FlowDirDropDown); m_FlowDirDropDown.ID = "flowDirDropDown"; // Get the path of the underlying map document and use it to populate the properties drop-downs. string fileName = ServerObjectProperties["FilePath"]; populateDropDowns(serverContext, fileName); // Render and return the HTML for the container div. System.IO.StringWriter stringWriter = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter (stringWriter); propertiesDiv.RenderControl(htmlWriter); string html = stringWriter.ToString(); stringWriter.Close(); return(html); }
// Add the recipients to the UI protected void AddRecipients(DocuSignAPI.Recipient[] recipients) { int i = 1; foreach (DocuSignAPI.Recipient recipient in recipients) { var row = new System.Web.UI.HtmlControls.HtmlTableRow(); var roleCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var nameCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var emailCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var securityCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var inviteCell = new System.Web.UI.HtmlControls.HtmlTableCell(); roleCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" readonly=\"true\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientRole, i.ToString(), recipient.RoleName); nameCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientName, i.ToString(), recipient.UserName); emailCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientEmail, i.ToString(), recipient.Email); string security = String.Empty; if (!String.IsNullOrEmpty(recipient.AccessCode)) { security = "Access code: " + recipient.AccessCode; } else if (null != recipient.PhoneAuthentication) { security = "Phone Authentication"; } else if (recipient.RequireIDLookup) { security = "ID Check"; } else { security = "None"; } securityCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" readonly=\"true\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientSecurity, i.ToString(), security); inviteCell.InnerHtml = String.Format( "<ul class=\"switcher\" name=\"{0}{1}\" ><li class=\"active\"><a href=\"#\" title=\"On\">ON</a></li><li><a href=\"#\" title=\"OFF\">OFF</a></li><input id=\"RecipientInviteToggle{1}\" name=\"RecipientInviteToggle{1}\" value=\"RecipientInviteToggle{1}\" type=\"checkbox\" checked=\"\" style=\"display: none\"></ul>", Keys.RecipientInvite, i.ToString()); //<ul class="switcher" id="RecipientInvite1"> // <li id="RecipientInviteon1" class="active"><a href="#" title="On">ON</a></li> // <li id="RecipientInviteoff1"><a href="#" title="OFF">OFF</a></li> // <input id="RecipientInviteToggle1" name="RecipientInviteToggle1" value="RecipientInviteToggle1" type="checkbox" checked="" style="display: none"> //</ul> inviteCell.Attributes[Keys.Id] = String.Format("{0}{1}", Keys.RecipientInvite, recipient.ID); inviteCell.Attributes[Keys.Name] = String.Format("{0}{1}", Keys.RecipientInvite, recipient.ID); row.Cells.Add(roleCell); row.Cells.Add(nameCell); row.Cells.Add(emailCell); row.Cells.Add(securityCell); row.Cells.Add(inviteCell); RecipientTable.Rows.Add(row); i++; } }
private void AddTitleToTable(DataObjects.Title title) { System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); cell.InnerHtml = "<a href='/bibliography/" + title.TitleID.ToString() + "'>" + title.ShortTitle + "</a>"; row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); tblPages.Rows.Add(row); }
protected void lvStage_ItemDataBound(object sender, ListViewItemEventArgs e) { if (lvStage.EditIndex >= 0) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; if (dataItem.DisplayIndex == lvStage.EditIndex) { DropDownList ddl = (DropDownList)e.Item.FindControl("ddlPrjTaskEdit"); if (ddl != null) { string lsPrjCode = ((Label)e.Item.FindControl("lblPrjCodeEdit")).Text; string lsSAPB1DB = ((Label)e.Item.FindControl("lblSAPB1DBEdit")).Text; ddl.DataSource = dsPrjList.Tables[0]; ddl.DataTextField = "PrjName"; ddl.DataValueField = "PrjCode"; ddl.DataBind(); if (!lsPrjCode.Equals("") && !lsSAPB1DB.Equals("")) ddl.SelectedValue = lsPrjCode + ";" + lsSAPB1DB; } DropDownList ddlPhase = (DropDownList)e.Item.FindControl("ddlPhaseEdit"); if (ddlPhase != null) { if (ddlPhase.Items.FindByValue(msPhase) != null) { ddlPhase.Items.FindByValue(msPhase).Selected = true; msPhase = string.Empty; } else ddlPhase.SelectedIndex = 0; } TextBox txtMon = (TextBox)e.Item.FindControl("txtMonEdit"); TextBox txtTue = (TextBox)e.Item.FindControl("txtTueEdit"); TextBox txtWed = (TextBox)e.Item.FindControl("txtWedEdit"); TextBox txtThu = (TextBox)e.Item.FindControl("txtThuEdit"); TextBox txtFri = (TextBox)e.Item.FindControl("txtFriEdit"); TextBox txtSat = (TextBox)e.Item.FindControl("txtSatEdit"); TextBox txtSun = (TextBox)e.Item.FindControl("txtSunEdit"); TextBox txtSrvType = (TextBox)e.Item.FindControl("txtSrvTypeEdit"); TextBox txtTimeEndDate = (TextBox)e.Item.FindControl("txtTimeEndDateEdit"); txtMon.Attributes.Add("onKeyUp", "txtOnKeyPress( '" + txtMon.ClientID + "', '" + txtSrvType.Text + "', '" + Monday.ToString("yyyyMMdd") + "', '" + txtTimeEndDate.Text + "' )"); txtTue.Attributes.Add("onKeyUp", "txtOnKeyPress( '" + txtTue.ClientID + "', '" + txtSrvType.Text + "', '" + Tuesday.ToString("yyyyMMdd") + "', '" + txtTimeEndDate.Text + "' )"); txtWed.Attributes.Add("onKeyUp", "txtOnKeyPress( '" + txtWed.ClientID + "', '" + txtSrvType.Text + "', '" + Wednesday.ToString("yyyyMMdd") + "', '" + txtTimeEndDate.Text + "' )"); txtThu.Attributes.Add("onKeyUp", "txtOnKeyPress( '" + txtThu.ClientID + "', '" + txtSrvType.Text + "', '" + Thursday.ToString("yyyyMMdd") + "', '" + txtTimeEndDate.Text + "' )"); txtFri.Attributes.Add("onKeyUp", "txtOnKeyPress( '" + txtFri.ClientID + "', '" + txtSrvType.Text + "', '" + Friday.ToString("yyyyMMdd") + "', '" + txtTimeEndDate.Text + "' )"); txtSat.Attributes.Add("onKeyUp", "txtOnKeyPress( '" + txtSat.ClientID + "', '" + txtSrvType.Text + "', '" + Saturday.ToString("yyyyMMdd") + "', '" + txtTimeEndDate.Text + "' )"); txtSun.Attributes.Add("onKeyUp", "txtOnKeyPress( '" + txtSun.ClientID + "', '" + txtSrvType.Text + "', '" + Sunday.ToString("yyyyMMdd") + "', '" + txtTimeEndDate.Text + "' )"); } //mbVisible = true; System.Web.UI.HtmlControls.HtmlTableCell td = (System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("tdButtons"); if (td != null) td.Visible = true; } else { if (e.Item.ItemType == ListViewItemType.DataItem) { System.Web.UI.HtmlControls.HtmlTableCell td = (System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("tdButtons"); if (td != null) td.Visible = btnAddRecord.Enabled; } } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { return; } #region " AdRotator " AdRotator1.Height = 100; AdRotator1.Width = 100; AdRotator1.AdvertisementFile = "AdRotatorControlTestData.xml"; AdRotator1.BorderColor = Color.Black; AdRotator1.BorderStyle = BorderStyle.Solid; AdRotator1.BorderWidth = 2; #endregion #region " BulletedList " //todo: for BulletedList, the third part of the triplet appears to be if the item is enabled. Could improve Glimpse visualizer for this. BulletedList1.Items.Add(new ListItem("Item Zero", "A")); BulletedList1.Items.Add(new ListItem("Item One", "B")); BulletedList1.Items.Add(new ListItem("Item Two", "C")); BulletedList1.Items.Add(new ListItem("Item Three (disabled)", "D")); BulletedList1.Items[3].Enabled = false; #endregion #region " Button " Button1.Text = "I am Button1"; Button1.ToolTip = "Button1 Tooltip is here."; Button1.Width = 300; Button1.Height = 80; Button1.BackColor = Color.Red; Button1.ForeColor = Color.Blue; #endregion #region " Calendar " Calendar1.DayNameFormat = DayNameFormat.FirstTwoLetters; Calendar1.FirstDayOfWeek = FirstDayOfWeek.Monday; Calendar1.Caption = "Super calendar!"; #endregion #region " Checkbox " CheckBox1Checked.Checked = true; CheckBox1Checked.Text = "This is a checked Checkbox."; CheckBox2UnChecked.Checked = false; CheckBox2UnChecked.Text = "This is an unchecked Checkbox."; #endregion #region " CheckboxList " CheckBoxList1.Items.Add(new ListItem("Item Zero (default)", "A")); CheckBoxList1.Items.Add(new ListItem("Item One (selected)", "B")); CheckBoxList1.Items.Add(new ListItem("Item Two (not selected)", "C")); CheckBoxList1.Items.Add(new ListItem("Item Three (disabled)", "D")); CheckBoxList1.Items[1].Selected = true; CheckBoxList1.Items[2].Selected = false; CheckBoxList1.Items[3].Enabled = false; #endregion #region " DropDownList " DropDownList1.Items.Add(new ListItem("Item Zero (default)", "A")); DropDownList1.Items.Add(new ListItem("Item One (selected)", "B")); DropDownList1.Items.Add(new ListItem("Item Two (not selected)", "C")); DropDownList1.Items.Add(new ListItem("Item Three (disabled)", "D")); DropDownList1.Items[1].Selected = true; DropDownList1.Items[2].Selected = false; DropDownList1.Items[3].Enabled = false; #endregion #region " FileUpload " FileUpload1.AllowMultiple = true; FileUpload1.Height = 80; FileUpload1.Width = 300; FileUpload1.ToolTip = "this is a file uploader"; #endregion #region " HiddenField " HiddenField1.Value = "this is a hidden field."; #endregion #region " Hyperlink " HyperLink1.ForeColor = Color.Gray; HyperLink1.NavigateUrl = "https://github.com/Glimpse/Glimpse"; HyperLink1.Text = "Go to Glimpse project site!"; #endregion #region " Image " Image1.ImageUrl = "/Images/logo.jpg"; Image1.AlternateText = "This is a logo"; Image1.DescriptionUrl = "this is the description URL... whatever that is."; #endregion #region " ImageButton " ImageButton1.ImageUrl = "/Images/logo.jpg"; ImageButton1.AlternateText = "This is a logo (ImageButton)"; ImageButton1.DescriptionUrl = "this is the description URL... whatever that is. (ImageButton)"; ImageButton1.PostBackUrl = "PopulatedControls.aspx?ImageButtonPostBack=1"; #endregion #region " ImageMap " ImageMap1.ImageUrl = "/Images/logo.jpg"; ImageMap1.HotSpotMode = HotSpotMode.PostBack; RectangleHotSpot hotSpot1 = new RectangleHotSpot(); hotSpot1.PostBackValue = "hotSpot 1"; hotSpot1.Top = 0; hotSpot1.Bottom = 101; hotSpot1.Left = 0; hotSpot1.Right = 181; hotSpot1.NavigateUrl = "PopulatedControls.aspx"; ImageMap1.HotSpots.Add(hotSpot1); RectangleHotSpot hotSpot2 = new RectangleHotSpot(); hotSpot2.PostBackValue = "hotSpot 2"; hotSpot2.Top = 0; hotSpot2.Bottom = 101; hotSpot2.Left = 182; hotSpot2.Right = 362; hotSpot2.NavigateUrl = "PopulatedControls.aspx"; ImageMap1.HotSpots.Add(hotSpot2); #endregion #region " Label " Label1.Text = "This is the best label. Ever."; Label1.ForeColor = Color.Orange; Label1.Font.Name = "Comic Sans MS"; Label1.Font.Size = 24; #endregion #region " LinkButton " LinkButton1.PostBackUrl = "PopulatedControls.aspx?LinkButton1Postback=1"; LinkButton1.Text = "This is a link button"; LinkButton1.Font.Italic = true; #endregion #region " ListBox " ListBox1.Items.Add(new ListItem("Item Zero (default)", "A")); ListBox1.Items.Add(new ListItem("Item One (selected)", "B")); ListBox1.Items.Add(new ListItem("Item Two (not selected)", "C")); ListBox1.Items.Add(new ListItem("Item Three (disabled)", "D")); ListBox1.Items[1].Selected = true; ListBox1.Items[2].Selected = false; ListBox1.Items[3].Enabled = false; ListBox1.BorderColor = Color.Blue; ListBox1.BorderStyle = BorderStyle.Dashed; ListBox1.BorderWidth = 3; #endregion #region " Literal " Literal1.Text = "<b>This is some literal content</b><pre>OH YEAH!!!" + Environment.NewLine + "This is on the next line.</pre>"; #endregion #region " Localize " Localize1.Mode = LiteralMode.Encode; #endregion #region " MultiView " //todo: The MultiView and View controls don't seem to have any sort of visibility into their data. MultiView1.ActiveViewIndex = 1; #endregion #region " Panel " Panel1.Width = 400; Panel1.Height = 200; Panel1.BorderColor = Color.Green; Panel1.BorderWidth = 5; Panel1.BorderStyle = BorderStyle.Inset; var panel1TextBox1 = new TextBox(); panel1TextBox1.ID = "panel1TextBox1"; panel1TextBox1.Text = "This is the panel1TextBox1 text value."; panel1TextBox1.Width = 300; Panel1.Controls.Add(panel1TextBox1); #endregion #region " PlaceHolder " var placeHolder1TextBox1 = new TextBox(); placeHolder1TextBox1.ID = "placeHolder1TextBox1"; placeHolder1TextBox1.Text = "This is the placeHolder1TextBox1 text value."; placeHolder1TextBox1.Width = 500; PlaceHolder1.Controls.Add(placeHolder1TextBox1); #endregion #region " RadioButton " RadioButton1.Checked = true; RadioButton2.Checked = false; RadioButton1.Text = "This is RadioButton1! The initial value is checked."; RadioButton2.Text = "This is RadioButton2! The initial value is not checked."; RadioButton3.Text = "This is RadioButton3! The initial value is not specified."; #endregion #region " RadioButtonList " RadioButtonList1.Items.Add(new ListItem("Item Zero (default)", "A")); RadioButtonList1.Items.Add(new ListItem("Item One (selected)", "B")); RadioButtonList1.Items.Add(new ListItem("Item Two (not selected)", "C")); RadioButtonList1.Items.Add(new ListItem("Item Three (disabled)", "D")); RadioButtonList1.Items[1].Selected = true; RadioButtonList1.Items[2].Selected = false; RadioButtonList1.Items[3].Enabled = false; RadioButtonList1.BorderColor = Color.Gray; RadioButtonList1.BorderStyle = BorderStyle.Outset; RadioButtonList1.BorderWidth = 2; #endregion #region " Substitution " Substitution1.Visible = true; #endregion #region " Table " Table1.Rows.Add(TableHeaderRowFromStringArray(new string[] { "Column 1 Header", "Column 2 Header", "Column 3 Header" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 A", "Field2", "Field3" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 B", "Field2", "Field3" })); Table1.Rows.Add(TableRowFromStringArray(new string[] { "Field1 C", "Field2", "Field3" })); #endregion #region " Textbox " TextBox1.Text = "This is a text box control."; TextBox1.ReadOnly = true; #endregion #region " View " var View1Label = new Label(); View1Label.Text = "This is the label inside the view... I am invisible because my parent View is supposed to be in a MultiView."; View1Label.Width = 100; View1.Controls.Add(View1Label); #endregion #region " Wizard " Wizard1.BackColor = Color.Honeydew; WizardStep1.AllowReturn = true; WizardStep2.AllowReturn = true; var WizardStep1TextBox1 = new TextBox(); WizardStep1TextBox1.Text = "This is Wizard step 0 checkbox 1."; WizardStep1.Controls.Add(WizardStep1TextBox1); var WizardStep2TextBox1 = new TextBox(); WizardStep2TextBox1.Text = "This is Wizard step 1 checkbox 1."; WizardStep2.Controls.Add(WizardStep2TextBox1); Wizard1.ActiveStepIndex = 0; #endregion #region " Xml " //todo: need to create an XSLT or else this will crash BrowserLink in VS2013. #endregion #region " HtmlButton " HtmlButton1.Value = "I am Html Button1"; #endregion #region " HtmlReset " HtmlReset1.Value = "I am Html Reset1"; #endregion #region " HtmlSubmit " HtmlSubmit1.Value = "I am Html Submit1"; #endregion #region " HtmlText " HtmlText1.Value = "I am Html Text1"; HtmlText1.Size = 100; #endregion #region " Html Input File " HtmlFile1.Accept = "text/xml"; #endregion #region " HtmlPassword " HtmlPassword1.Size = 200; HtmlPassword1.Value = "MyVoiceIsMyPassportVerifyMe"; #endregion #region " Html Input Checkbox " HtmlCheckbox1.Checked = true; HtmlCheckbox1.Name = "HtmlCheckbox1Name"; #endregion #region " Html Input Radio " HtmlRadio1.Checked = true; HtmlRadio1.Name = "HtmlRadio1Name"; #endregion #region " Html Input Hidden " HtmlHidden1.Value = "This is so hidden right now..."; HtmlHidden1.Name = "HtmlHidden1Name"; #endregion #region " Html Textarea " HtmlTextArea1.Value = "This is some multiline text.\nThis is line 2."; HtmlTextArea1.Name = "HtmlTextArea1Name"; #endregion #region " Html Table " var htmlTableRow1 = new System.Web.UI.HtmlControls.HtmlTableRow(); var htmlTableRow1Cell1 = new System.Web.UI.HtmlControls.HtmlTableCell(); htmlTableRow1Cell1.InnerText = "Cell1"; htmlTableRow1Cell1.BgColor = "green"; var htmlTableRow1Cell2 = new System.Web.UI.HtmlControls.HtmlTableCell(); htmlTableRow1Cell2.InnerText = "Cell2"; htmlTableRow1Cell2.BgColor = "pink"; htmlTableRow1.Cells.Add(htmlTableRow1Cell1); htmlTableRow1.Cells.Add(htmlTableRow1Cell2); HtmlTable.Rows.Add(htmlTableRow1); HtmlTable.Border = 1; HtmlTable.BorderColor = "gray"; #endregion #region " Html Image " HtmlImage1.Src = "~/Images/orderedList0.png"; HtmlImage1.Alt = "This is a zero picture. Sweet!"; #endregion #region " Html Select " HtmlSelect1.Items.Add(new ListItem("Item Zero (default)", "A")); HtmlSelect1.Items.Add(new ListItem("Item One (selected)", "B")); HtmlSelect1.Items.Add(new ListItem("Item Two (not selected)", "C")); HtmlSelect1.Items.Add(new ListItem("Item Three (disabled)", "D")); HtmlSelect1.Items[1].Selected = true; HtmlSelect1.Items[2].Selected = false; HtmlSelect1.Items[3].Enabled = false; #endregion #region " Html Horizontal Rule " horizontalRule1.InnerText = "Server side Horizontal Rules are the wave of the future."; horizontalRule1.Style.Add(HtmlTextWriterStyle.Color, "red"); horizontalRule1.EnableViewState = true; #endregion #region " Html Div " HtmlDiv1.InnerText = "This is some text inside this server-side div."; HtmlDiv1.EnableViewState = true; #endregion #region " Chart " Chart1.Series["Series1"].Points.DataBindY(PopulatedControls.GetSmallSampleNumericData()); Chart1.BackColor = Color.BlanchedAlmond; System.Diagnostics.Debug.Print(Chart1.ViewStateMode.ToString()); #endregion }
/// <summary> /// Check User permitions /// Set Page Header /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { string Mode = string.Empty; if (Request.QueryString["ProjectID"] != null) { Session["PROJECT_ID"] = Convert.ToInt32(Request.QueryString["ProjectID"]); if (Request.QueryString["HHID"] != null) { Session["HH_ID"] = Convert.ToInt32(Request.QueryString["HHID"]); } else { Session["HH_ID"] = null; } Session["PROJECT_CODE"] = Request.QueryString["ProjectCode"].ToString(); Mode = Request.QueryString["Mode"].ToString(); } if (Session["PROJECT_CODE"] == null) { Response.Redirect("~/UI/Project/ViewProjects.aspx"); } if (Session["HH_ID"] == null) { Response.Redirect("~/UI/Compensation/PAPList.aspx"); } Page.Response.Cache.SetNoStore(); if (!IsPostBack) { if (Session["PROJECT_CODE"] != null) { Master.PageHeader = Session["PROJECT_CODE"].ToString() + " - Compensation Packages"; } else { Response.Redirect("~/UI/Project/ViewProjects.aspx"); } checkApprovalExitOrNot(); LoadComponestion(); if (CheckAuthorization.HasUpdatePrivilege(UtilBO.PrivilegeCode.PRIV_PACKAGE_DOCUMENTS) == false) { lnkValuationPCI.Visible = false; foreach (RepeaterItem item1 in rptPKGDoccatName.Items) { Repeater rptDOCitem = (Repeater)item1.FindControl("rptDOCitem"); thPrint.Visible = false; thApprover.Visible = false; foreach (RepeaterItem item in rptDOCitem.Items) { System.Web.UI.HtmlControls.HtmlTableCell tdPrintButton = (System.Web.UI.HtmlControls.HtmlTableCell)item.FindControl("tdPrintButton"); System.Web.UI.HtmlControls.HtmlTableCell tdApproverButton = (System.Web.UI.HtmlControls.HtmlTableCell)item.FindControl("tdApproverButton"); tdPrintButton.Visible = false; tdApproverButton.Visible = false; } } } } if (Mode == "Readonly") { Label userNameLabel = (Label)Master.FindControl("userNameLabel"); userNameLabel.Visible = false; LinkButton lnkLogout = (LinkButton)Master.FindControl("lnkLogout"); lnkLogout.Visible = false; Menu NavigationMenu = (Menu)Master.FindControl("NavigationMenu"); NavigationMenu.Visible = false; ImageButton imgSearch = (ImageButton)HouseholdSummary1.FindControl("imgSearch"); imgSearch.Visible = false; lnkValuationPCI.Visible = false; foreach (RepeaterItem item1 in rptPKGDoccatName.Items) { Repeater rptDOCitem = (Repeater)item1.FindControl("rptDOCitem"); thPrint.Visible = false; thApprover.Visible = false; thStatus.Visible = true; foreach (RepeaterItem item in rptDOCitem.Items) { System.Web.UI.HtmlControls.HtmlTableCell tdPrintButton = (System.Web.UI.HtmlControls.HtmlTableCell)item.FindControl("tdPrintButton"); System.Web.UI.HtmlControls.HtmlTableCell tdApproverButton = (System.Web.UI.HtmlControls.HtmlTableCell)item.FindControl("tdApproverButton"); System.Web.UI.HtmlControls.HtmlTableCell tdStatusButton = (System.Web.UI.HtmlControls.HtmlTableCell)item.FindControl("tdStatusButton"); tdPrintButton.Visible = false; tdApproverButton.Visible = false; tdStatusButton.Visible = true; } } } }
// Add the recipients to the UI protected void AddRecipients(DocuSignAPI.Recipient[] recipients) { int i = 1; foreach (DocuSignAPI.Recipient recipient in recipients) { var row = new System.Web.UI.HtmlControls.HtmlTableRow(); var roleCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var nameCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var emailCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var securityCell = new System.Web.UI.HtmlControls.HtmlTableCell(); var inviteCell = new System.Web.UI.HtmlControls.HtmlTableCell(); roleCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" readonly=\"true\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientRole, i.ToString(), recipient.RoleName); nameCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientName, i.ToString(), recipient.UserName); emailCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientEmail, i.ToString(), recipient.Email); string security = String.Empty; if (!String.IsNullOrEmpty(recipient.AccessCode)) { security = "Access code: " + recipient.AccessCode; } else if (null != recipient.PhoneAuthentication) { security = "Phone Authentication"; } else if (recipient.RequireIDLookup) { security = "ID Check"; } else { security = "None"; } securityCell.InnerHtml = String.Format( "<input id=\"{0}\" type=\"text\" readonly=\"true\" name=\"{0}{1}\" value=\"{2}\"/>", Keys.RecipientSecurity, i.ToString(), security); inviteCell.InnerHtml = String.Format( "<ul class=\"switcher\" name=\"{0}{1}\" ><li class=\"active\"><a href=\"#\" title=\"On\">ON</a></li><li><a href=\"#\" title=\"OFF\">OFF</a></li><input id=\"RecipientInviteToggle{1}\" name=\"RecipientInviteToggle{1}\" value=\"RecipientInviteToggle{1}\" type=\"checkbox\" checked=\"\" style=\"display: none\"></ul>", Keys.RecipientInvite, i.ToString()); //<ul class="switcher" id="RecipientInvite1"> // <li id="RecipientInviteon1" class="active"><a href="#" title="On">ON</a></li> // <li id="RecipientInviteoff1"><a href="#" title="OFF">OFF</a></li> // <input id="RecipientInviteToggle1" name="RecipientInviteToggle1" value="RecipientInviteToggle1" type="checkbox" checked="" style="display: none"> //</ul> inviteCell.Attributes[Keys.Id] = String.Format("{0}{1}", Keys.RecipientInvite,recipient.ID); inviteCell.Attributes[Keys.Name] = String.Format("{0}{1}", Keys.RecipientInvite,recipient.ID); row.Cells.Add(roleCell); row.Cells.Add(nameCell); row.Cells.Add(emailCell); row.Cells.Add(securityCell); row.Cells.Add(inviteCell); RecipientTable.Rows.Add(row); i++; } }
protected override void CreateContent(System.Web.UI.Control NamingContainer, System.Web.UI.ControlCollection content) { var hinweis = new HtmlCtrl.P() { InnerText = EmptyDataText, CssStyleBld = EmptyDataTextStyle }; content.Add(hinweis); content.Add(new HtmlCtrl.BR()); var btnRemove = new Button() { Text = RemoveButtonCaption }; btnRemove.Attributes.Add("style", RemoveButtonStyle.ToString()); btnRemove.Click += new EventHandler(btnRemove_Click); content.Add(btnRemove); content.Add(new HtmlCtrl.BR()); // Alle aktuell gültigen Filter auflisten var fltTab = new System.Web.UI.HtmlControls.HtmlTable(); content.Add(fltTab); fltTab.Attributes.Add("style", CurrentlyActiveFiltersTabStyle.ToString()); var header = new System.Web.UI.HtmlControls.HtmlTableRow(); fltTab.Rows.Add(header); var col1Header = new System.Web.UI.HtmlControls.HtmlTableCell() { InnerText = "Filter" }; header.Cells.Add(col1Header); var col1HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellDescription); col1HeaderCssBld.FontWeight = new css.FontWeightMeasure() { Value = css.FontWeightMeasure.Unit.bold }; col1Header.Attributes.Add("style", col1HeaderCssBld.ToString()); var col2Header = new System.Web.UI.HtmlControls.HtmlTableCell() { InnerText = "entfernen ja/nein" }; header.Cells.Add(col2Header); var col2HeaderCssBld = new css.StyleBuilder(CurrentlyActiveFiltersTabCellAction); col2HeaderCssBld.FontWeight = new css.FontWeightMeasure() { Value = css.FontWeightMeasure.Unit.bold }; col2Header.Attributes.Add("style", col2HeaderCssBld.ToString()); int line = 0; foreach (var flt in sessVar.Filters) { var row = new System.Web.UI.HtmlControls.HtmlTableRow(); fltTab.Rows.Add(row); var descr = new System.Web.UI.HtmlControls.HtmlTableCell() { InnerText = flt.Value.Description }; descr.Attributes.Add("style", CurrentlyActiveFiltersTabCellDescription.ToString()); row.Cells.Add(descr); var action = new System.Web.UI.HtmlControls.HtmlTableCell(); action.Attributes.Add("style", CurrentlyActiveFiltersTabCellAction.ToString()); action.Controls.Add(new CheckBox() { ID = "cbxCtrl" + line++, ClientIDMode = ClientIDMode.Static, Checked = true }); row.Cells.Add(action); } }
protected void Page_Load(object sender, EventArgs e) { List <string> idList = (List <string>)Session["cart"]; if (idList == null) { idList = new List <string>(); } string provider = "Microsoft.ACE.OLEDB.12.0"; // the data source for Access database if it's placed in the 'App_Data' folder of the // current project when run within Citrix //string dataSource = "\\\\itfs1\\wpcarey\\StudentHomeFolders\\apedroz1\\Documents\\A2ZBooks.accdb"; //string dataSource = "C:\\Users\\jdpiasecki\\Downloads\\A2ZBooks\\A2ZBooks\\A2ZBooks\\a2zbooks.accdb"; string dataSource = Server.MapPath("a2zbooks.accdb"); string dbConnectionString = string.Format("Provider={0};Data Source={1};", provider, dataSource); OleDbConnection myConn = new OleDbConnection(dbConnectionString); myConn.Open(); string idVal = "("; foreach (string s in idList) { idVal += s + ","; } string query = "SELECT * FROM book WHERE ID IN " + idVal + ")"; OleDbCommand cmd = new OleDbCommand(query, myConn); var reader = cmd.ExecuteReader(); double sum = 0; while (reader.Read()) { string author = reader["Author"].ToString(); // get data from the 'Author' column string title = reader["Title"].ToString(); string isbn = reader["ISBN"].ToString(); string price = reader["Price"].ToString(); //string courseID = reader["Course ID"].ToString(); int bookCount = 0; foreach (string s in idList) { if (s == reader["ID"].ToString()) { bookCount++; } } string quantity = reader["Quantity"].ToString(); var newRow = new System.Web.UI.HtmlControls.HtmlTableRow(); var newCell = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell.InnerText = author; newRow.Cells.Add(newCell); var newCell1 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell1.InnerText = title; newRow.Cells.Add(newCell1); var newCell4 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell4.InnerText = string.Format("{0:C2}", Double.Parse(price)); newRow.Cells.Add(newCell4); var newCell5 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell5.InnerText = bookCount.ToString(); newRow.Cells.Add(newCell5); var newCell6 = new System.Web.UI.HtmlControls.HtmlTableCell(); double tmpPrice = double.Parse(price); tmpPrice = tmpPrice * bookCount; newCell6.InnerText = string.Format("{0:C2}", tmpPrice); sum += tmpPrice; newRow.Cells.Add(newCell6); results.Rows.Add(newRow); }//end of while var anotherRow = new System.Web.UI.HtmlControls.HtmlTableRow(); for (int i = 0; i < 4; i++) { anotherRow.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell()); } var cellTotal = new System.Web.UI.HtmlControls.HtmlTableCell(); cellTotal.InnerHtml = "<strong>" + string.Format("{0:C2}", sum) + "</strong>"; anotherRow.Cells.Add(cellTotal); results.Rows.Add(anotherRow); }
protected void Page_Load(object sender, EventArgs e) { string searchTerm = (string)Session["searchTerm"]; string searchCategory = (string)Session["category"]; // components for a connection string to an Access 2016 named 'SampleDB.accdb' string provider = "Microsoft.ACE.OLEDB.12.0"; // the data source for Access database if it's placed in the 'App_Data' folder of the // current project when run within Citrix string dataSource = "\\\\itfs1\\wpcarey\\StudentHomeFolders\\kroumina\\Documents\\VisualStudio2017\\Projects\\A2ZBooks\\A2ZBooks\\A2ZBooks.accdb"; //string dataSource = "C:\\Users\\jdpiasecki\\Downloads\\A2ZBooks\\A2ZBooks\\A2ZBooks\\a2zbooks.accdb"; //string dataSource = Server.MapPath("a2zbooks.accdb"); string dbConnectionString = string.Format("Provider={0};Data Source={1};", provider, dataSource); OleDbConnection myConn = new OleDbConnection(dbConnectionString); myConn.Open(); searchResultsLabel.Text = "Search results for " + searchCategory + " = '" + searchTerm + "'"; { string query = "SELECT * FROM book WHERE " + searchCategory + " like '%" + searchTerm + "%'"; // the SampleDB Access database has a table named 'practice' if (searchCategory == "Course Number") { query = "SELECT * FROM book WHERE ID IN (SELECT BookID FROM bookcoursebridge WHERE CourseID IN (SELECT ID FROM course WHERE CODE like '%" + searchTerm + "%') )"; } OleDbCommand cmd = new OleDbCommand(query, myConn); var reader = cmd.ExecuteReader(); while (reader.Read()) { string author = reader["Author"].ToString(); // get data from the 'Author' column string title = reader["Title"].ToString(); string isbn = reader["ISBN"].ToString(); string price = reader["Price"].ToString(); //string courseID = reader["Course ID"].ToString(); string quantity = reader["Quantity"].ToString(); Button newButton = new Button(); newButton.Text = "Add to Cart"; newButton.Click += NewButton_Click; newButton.ID = "btn" + reader["ID"].ToString(); var newRow = new System.Web.UI.HtmlControls.HtmlTableRow(); var newCell = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell.InnerText = author; newRow.Cells.Add(newCell); var newCell1 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell1.InnerText = title; newRow.Cells.Add(newCell1); var newCell2 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell2.InnerText = isbn; newRow.Cells.Add(newCell2); var newCell4 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell4.InnerText = string.Format("{0:C2}", double.Parse(price)); newRow.Cells.Add(newCell4); var newCell5 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell5.InnerText = quantity; newRow.Cells.Add(newCell5); var newCell6 = new System.Web.UI.HtmlControls.HtmlTableCell(); newCell6.Controls.Add(newButton); newRow.Cells.Add(newCell6); results.Rows.Add(newRow); } //end of while } //end of if }
/// <summary> /// Set Attributes to Link buttons /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void rptDOCitem_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { string Mode = string.Empty; string PageCode = string.Empty; documentCode = Convert.ToString(DataBinder.Eval(e.Item.DataItem, "PKGDocumentCode")); System.Web.UI.HtmlControls.HtmlAnchor lnkViewPkgItem = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lnkViewPkgItem"); if (Request.QueryString["Mode"] != null) { Mode = Request.QueryString["Mode"].ToString(); } if (Request.QueryString["PageCode"] != null) { PageCode = Request.QueryString["PageCode"].ToString(); } if (Mode == "Readonly") { int ApprovalLevel = 0; ApprovalLevel = Convert.ToInt32(Request.QueryString["ApprovalLevel"].ToString()); lnkViewPkgItem.Attributes.Add("onclick", string.Format("OpenApprovalReport('{0}',{1},'{2}',{3},'{4}');", documentCode, Convert.ToInt32(Session["HH_ID"].ToString()), "Approval", ApprovalLevel, PageCode)); } else { lnkViewPkgItem.Attributes.Add("onclick", string.Format("OpenReport('{0}',{1});", documentCode, Convert.ToInt32(Session["HH_ID"].ToString()))); } System.Web.UI.HtmlControls.HtmlAnchor LnkprintApproved = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("LnkprintApproved"); LnkprintApproved.Attributes.Add("onclick", string.Format("OpenPrintReport('{0}',{1});", documentCode, Convert.ToInt32(Session["HH_ID"].ToString()))); LnkprintApproved.Visible = false; #region for Approval Task System.Web.UI.HtmlControls.HtmlAnchor lnkApprovalTAsk = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lnkApprovalTAsk"); PAP_HouseholdBLL objHouseHoldBLL = new PAP_HouseholdBLL(); PAP_HouseholdBO objHouseHold = new PAP_HouseholdBO(); objHouseHold.ProjectedId = Convert.ToInt32(Session["PROJECT_ID"]); int householdID = Convert.ToInt32(Session["HH_ID"]); objHouseHold.HhId = householdID; objHouseHold.PageCode = "CPREV"; objHouseHold.Workflowcode = UtilBO.WorkflowPackageReview; objHouseHold = objHouseHoldBLL.ApprovalChangerequestStatus(objHouseHold); //int countResult = totalcountapproval(); if (objHouseHold != null) { if (objHouseHold.ApproverStatus == 3) //(objHouseHold.ApproverStatus == 3) { //PENDING lnkApprovalTAsk.Visible = false; LnkprintApproved.Visible = false; } if (objHouseHold.ApproverStatus == 2)// (objHouseHold.ApproverStatus == 2) { //DECLINED lnkApprovalTAsk.Visible = false; LnkprintApproved.Visible = false; } if (objHouseHold.ApproverStatus == 1)// (objHouseHold.ApproverStatus == 1) { //APPROVED lnkApprovalTAsk.Visible = false; LnkprintApproved.Visible = true; } //if (countResult == 0 || countResult == 3) //{ // try // { // WorkFlowBO objWorkFlowBO = new WorkFlowBO(); // WorkFlowBLL objWorkFlowBLL = new WorkFlowBLL(); // string ChangeRequestCode = UtilBO.CompensationPrintRequest; // objWorkFlowBO = objWorkFlowBLL.getWOrkFlowApprovalID(Convert.ToInt32(Session["PROJECT_ID"]), ChangeRequestCode); // int userID = Convert.ToInt32(Session["USER_ID"]); // int ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); // int HHID = Convert.ToInt32(Session["HH_ID"]); // string pageCode = documentCode; // if (objWorkFlowBO != null) // { // string paramChangeRequest = string.Format("OpenChangeRequest('{0}',{1},{2},{3},'{4}')", ChangeRequestCode, ProjectID, userID, HHID, pageCode); // lnkApprovalTAsk.Attributes.Add("onclick", paramChangeRequest); // } // } // catch (Exception ex) // { // throw ex; // } //} } else { //try //{ // WorkFlowBO objWorkFlowBO = new WorkFlowBO(); // WorkFlowBLL objWorkFlowBLL = new WorkFlowBLL(); // string ChangeRequestCode = UtilBO.CompensationPrintRequest; // objWorkFlowBO = objWorkFlowBLL.getWOrkFlowApprovalID(Convert.ToInt32(Session["PROJECT_ID"]), ChangeRequestCode); // int userID = Convert.ToInt32(Session["USER_ID"]); // int ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); // int HHID = Convert.ToInt32(Session["HH_ID"]); // string pageCode = documentCode; // if (objWorkFlowBO != null) // { // string paramChangeRequest = string.Format("OpenChangeRequest('{0}',{1},{2},{3},'{4}')", ChangeRequestCode, ProjectID, userID, HHID, pageCode); // lnkApprovalTAsk.Attributes.Add("onclick", paramChangeRequest); // lnkApprovalTAsk.Visible = true; // } // else // { // lnkApprovalTAsk.Visible = false; // } //} //catch (Exception ex) //{ // throw ex; //} } #endregion #region For PageLevel Approver: Package Review if (ViewState["ApproveExists"] != null) { System.Web.UI.HtmlControls.HtmlTableCell tdPrintButton = (System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("tdPrintButton"); System.Web.UI.HtmlControls.HtmlTableCell tdApproverButton = (System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("tdApproverButton"); if (ViewState["ApproveExists"] != null && ViewState["ApproveExists"].ToString() == "Yes") { PAP_HouseholdBLL oHouseHoldBLL = new PAP_HouseholdBLL(); PAP_HouseholdBO oHouseHold = new PAP_HouseholdBO(); oHouseHold.ProjectedId = Convert.ToInt32(Session["PROJECT_ID"]); int HHID = Convert.ToInt32(Session["HH_ID"]); oHouseHold.HhId = householdID; oHouseHold.PageCode = "CPREV"; oHouseHold.Workflowcode = UtilBO.WorkflowPackageReview; oHouseHold = oHouseHoldBLL.ApprovalChangerequestStatus(oHouseHold); if (oHouseHold != null) { if (oHouseHold.ApproverStatus == 3) { //PENDING thPrint.Visible = false; thApprover.Visible = false; tdPrintButton.Visible = false; tdApproverButton.Visible = false; } else if (oHouseHold.ApproverStatus == 2) { //DECLINED thPrint.Visible = true; thApprover.Visible = false; tdPrintButton.Visible = true; tdApproverButton.Visible = false; } else if (oHouseHold.ApproverStatus == 1) { //APPROVED thPrint.Visible = true; thApprover.Visible = false; tdPrintButton.Visible = true; tdApproverButton.Visible = false; } } else { thPrint.Visible = true; thApprover.Visible = false; tdPrintButton.Visible = true; tdApproverButton.Visible = false; } } } #endregion For PageLevel Approver: Package Review } }