protected void Page_Load(object sender, EventArgs e)
        {
            HtmlTable table1 = new HtmlTable();
              table1.Border = 1;
              table1.CellPadding = 3;
              table1.CellSpacing = 3;
              table1.BorderColor = "red";

              HtmlTableRow row;
              HtmlTableCell cell;

              for (int i = 1; i <= 5; i++)
              {
            row = new HtmlTableRow();

            row.BgColor = (i % 2 == 0 ? "lightyellow" : "lightcyan");

            for (int j = 1; j <= 4; j++)
            {
              cell = new HtmlTableCell();
              cell.InnerHtml = "Row: " + i.ToString() + "<br /> Cell: " + j.ToString();

              row.Cells.Add(cell);
            }

            table1.Rows.Add(row);
              }

              this.Controls.Add(table1);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     //tabelaZlecenia.Rows.Clear();
     DataView view = (DataView)SqlDataZleceniodawcy.Select(DataSourceSelectArguments.Empty);
     DataTable table = view.ToTable();
     DataSet ds = new DataSet();
     ds.Tables.Add(table);
     foreach (DataRow row in ds.Tables[0].Rows)
     {
         HtmlTableRow htmlrow = new HtmlTableRow();
         HtmlTableCell htmlcell = new HtmlTableCell();
         HtmlTableCell htmlcell2 = new HtmlTableCell();
         HtmlTableCell htmlcell3 = new HtmlTableCell();
         HtmlTableCell htmlcell4 = new HtmlTableCell();
         HtmlTableCell htmlcell5 = new HtmlTableCell();
         htmlcell.InnerText = row["Imie"].ToString() + " " + row["Nazwisko"].ToString();
         htmlrow.Cells.Add(htmlcell);
         htmlcell2.InnerText = row["NazwaFirmy"].ToString();
         htmlrow.Cells.Add(htmlcell2);
         htmlcell3.InnerText = row["email"].ToString();
         htmlrow.Cells.Add(htmlcell3);
         htmlcell4.InnerText = row["Telefon"].ToString();
         htmlrow.Cells.Add(htmlcell4);
         htmlcell5.InnerText = row["NIP"].ToString();
         htmlrow.Cells.Add(htmlcell5);
         tabelaZleceniodawcy.Rows.Add(htmlrow);
         tabelaZleceniodawcy.DataBind();
     }
 }
예제 #3
0
        protected void btnLiteralTable_Click(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlTable     tableT = new System.Web.UI.HtmlControls.HtmlTable();
            System.Web.UI.HtmlControls.HtmlTableRow  rowR   = new System.Web.UI.HtmlControls.HtmlTableRow();
            System.Web.UI.HtmlControls.HtmlTableCell cellA  = new System.Web.UI.HtmlControls.HtmlTableCell();
            System.Web.UI.HtmlControls.HtmlTableCell cellB  = new System.Web.UI.HtmlControls.HtmlTableCell();

            System.Web.UI.HtmlControls.HtmlTableCell cellC = new System.Web.UI.HtmlControls.HtmlTableCell();
            cellA.InnerText = "t2 C1Header";
            cellB.InnerText = "t2 C2Header";
            cellC.InnerText = "t2 C3Header";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);
            cellA           = new HtmlTableCell();
            cellB           = new HtmlTableCell();
            cellC           = new HtmlTableCell();
            rowR            = new HtmlTableRow();
            cellA.InnerText = "r1c1";
            cellB.InnerHtml = "r2c2";
            cellC.InnerText = "r3c3";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);

            this.Controls.Add(tableT);
        }
예제 #4
0
        private void AddTopFormControls(HtmlTable table)
        {
            using (HtmlTableRow row = new HtmlTableRow())
            {
                this.AddDateTextBoxCell(row);

                if (this.ShowStore)
                {
                    AddStoreSelectCell(row);
                }

                AddPartyCodeInputTextCell(row);
                AddPartySelectCell(row);

                if (this.ShowPriceTypes)
                {
                    AddPriceTypeSelectCell(row);
                }

                this.AddReferenceNumberInputTextCell(row);
                this.AddCashTransactionDivCell(row);
                this.AddPaymentTermSelectCell(row);

                table.Controls.Add(row);
            }
        }
예제 #5
0
파일: Labels.cs 프로젝트: hoanien/mixerp
        private void AddTopFormLabels(HtmlTable table)
        {
            using (HtmlTableRow header = new HtmlTableRow())
            {
                TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.ValueDate, "DateTextBox"));

                if (this.ShowStore)
                {
                    TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.SelectStore, "StoreSelect"));
                }

                TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.SelectParty, "PartyCodeInputText"));
                TableHelper.AddCell(header, string.Empty);

                if (this.ShowPriceTypes)
                {
                    TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.PriceType, "PriceTypeSelect"));
                }

                TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.ReferenceNumberAbbreviated, "ReferenceNumberInputText"));
                TableHelper.AddCell(header, string.Empty);
                TableHelper.AddCell(header, string.Empty);

                table.Rows.Add(header);
            }
        }
        private void LoadWeights()
        {
            ConnectorDataContext db = new ConnectorDataContext();

            Stopwatch w = Stopwatch.StartNew();
            List<FeatureScore> fScores = db.FeatureScores.ToList();
            w.Stop();
            ILog log = LogManager.GetLogger("QueryLogger");
            log.Info(" Elapsed time: " + w.Elapsed + ", select all feature scores");

            foreach (var item in fScores)
            {
                HtmlTableCell service = new HtmlTableCell();
                HtmlTableCell feature = new HtmlTableCell();
                HtmlTableCell weight = new HtmlTableCell();

                service.InnerText = item.ServiceInstance.name;
                feature.InnerText = item.feature;
                weight.InnerText = item.score.ToString();
                weight.Attributes.Add("class", "center");
                weight.Attributes.Add("contenteditable", "true");

                HtmlTableRow tr = new HtmlTableRow();
                tr.Cells.Add(service);
                tr.Cells.Add(feature);
                tr.Cells.Add(weight);

                WeightTable.Rows.Add(tr);
            }
        }
예제 #7
0
        private void LoadEmotionIcos()
        {
            int averageCell = 6;
            HtmlTableRow emotionRow = null;
            List<string> emotionIcos = Emotion.GetEmotionIcos();

            for (int i = 0; i < emotionIcos.Count; i++)
            {
                if (i % averageCell == 0)
                {
                    emotionRow = new HtmlTableRow();
                    tableEmotion.Rows.Add(emotionRow);
                }

                HtmlTableCell emotionCell = new HtmlTableCell();
                emotionCell.InnerHtml = string.Format(
                    "<img alt=\"{2}\" src=\"../{0}/{1}\" emotion=\"{1}\" onmousedown=\"Emotion.setContentEmotion(this);\" style=\"cursor: pointer;\" />",
                    Emotion.EmotionIcosPath,
                    Path.GetFileName(emotionIcos[i]),
                    Path.GetFileNameWithoutExtension(emotionIcos[i])
                    );

                emotionRow.Cells.Add(emotionCell);

            }
        }
예제 #8
0
 private static HtmlTableRow AddRow(JobControl_Get_Result controlResult)
 {
     HtmlTableRow row = new HtmlTableRow();
     row.Cells.Add(AddLabel(controlResult.ControlName));
     row.Cells.Add(AddControl(controlResult));
     return row;
 }
        public override Control AddTo(Control container)
        {
            HtmlTableCell labelCell = new HtmlTableCell();
            Label label = AddLabel(labelCell);

            HtmlTableCell editorCell = new HtmlTableCell();
            Control editor = AddEditor(editorCell);
            if (label != null && editor != null && !string.IsNullOrEmpty(editor.ID))
                label.AssociatedControlID = editor.ID;

            HtmlTableCell extraCell = new HtmlTableCell();
            if (Required)
                AddRequiredFieldValidator(extraCell, editor);
            if (Validate)
                AddRegularExpressionValidator(extraCell, editor);

            AddHelp(extraCell);

            HtmlTableRow row = new HtmlTableRow();
            row.Cells.Add(labelCell);
            row.Cells.Add(editorCell);
            row.Cells.Add(extraCell);

            HtmlTable editorTable = new HtmlTable();
            editorTable.Attributes["class"] = "editDetail";
            editorTable.Controls.Add(row);
            container.Controls.Add(editorTable);

            return editor;
        }
예제 #10
0
        private void AddCashTransactionDivCell(HtmlTableRow row)
        {
            using (HtmlTableCell cell = TableHelper.GetFieldCell())
            {
                if (this.ShowTransactionType)
                {
                    using (HtmlGenericControl toggleCheckBox = HtmlControlHelper.GetToggleCheckBox())
                    {
                        toggleCheckBox.ID = "CashTransactionDiv";
                        using (HtmlInputCheckBox cashTransactionInputCheckBox = new HtmlInputCheckBox())
                        {
                            cashTransactionInputCheckBox.ID = "CashTransactionInputCheckBox";
                            cashTransactionInputCheckBox.Attributes.Add("checked", "checked");
                            toggleCheckBox.Controls.Add(cashTransactionInputCheckBox);
                        }

                        using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.CashTransaction))
                        {
                            toggleCheckBox.Controls.Add(label);
                        }

                        cell.Controls.Add(toggleCheckBox);
                    }
                }

                row.Cells.Add(cell);
            }
        }
예제 #11
0
        private DateTime CreateOneDayCell(DateTime idxDate, HTML.HtmlTableRow row)
        {
            HTML.HtmlTableCell cell = new HTML.HtmlTableCell();
            cell.EnableViewState = false;
            cell.ID = idxDate.ToString("cell_MM_dd", System.Globalization.CultureInfo.InvariantCulture) + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);

            // Creating actual LinkButton which is the "clickable part" of the calendar days
            LinkButton btn = new LinkButton();

            btn.Text = idxDate.Day.ToString();
            btn.ID   = idxDate.ToString("yyyy_MM_dd", System.Globalization.CultureInfo.InvariantCulture);
            if (idxDate == Value.Date)
            {
                btn.CssClass = "selected";
            }
            else if (idxDate.Month != Value.Month)
            {
                btn.CssClass = "offMonth";
            }
            btn.Click          += new EventHandler(btn_Click);
            btn.EnableViewState = false;
            cell.Controls.Add(btn);

            if (RenderDay != null)
            {
                RenderDay(this, new RenderDayEventArgs(idxDate.Date, cell));
            }

            row.Cells.Add(cell);

            idxDate = idxDate.AddDays(1);
            return(idxDate);
        }
예제 #12
0
        private void Test()
        {
            string _discountName = "asdfghij";
            //row.Where(r => r.Cells.Any(c => c.InnerText.Contains(discountName)));
            List<HtmlTableRow> _discountTable = new List<HtmlTableRow>();
            for (int _row = 0; _row < 2; _row++)
            {
                HtmlTableRow _newRow = new HtmlTableRow();
                for (int _cells = 0; _cells < 5; _cells++)
                {
                    HtmlTableCell _cell = new HtmlTableCell();
                    _cell.InnerText = "Cell" + _cells.ToString();
                    _newRow.Cells.Add(_cell);
                }
                _discountTable.Add(_newRow);
            }

            List<HtmlTableRow> _resultRows = new List<HtmlTableRow>();
            foreach (HtmlTableRow _htmlTableRow in _discountTable)
            {
                if (_htmlTableRow.Cells.Cast<HtmlTableCell>().Any(_cell => _cell.InnerText.Contains(_discountName)))
                {
                    _resultRows.Add(_htmlTableRow);
                }
            }
        }
예제 #13
0
        protected void btnLiteralTable_Click(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlTable tableT = new System.Web.UI.HtmlControls.HtmlTable();
            System.Web.UI.HtmlControls.HtmlTableRow rowR = new System.Web.UI.HtmlControls.HtmlTableRow();
            System.Web.UI.HtmlControls.HtmlTableCell cellA = new System.Web.UI.HtmlControls.HtmlTableCell();
            System.Web.UI.HtmlControls.HtmlTableCell cellB = new System.Web.UI.HtmlControls.HtmlTableCell();

            System.Web.UI.HtmlControls.HtmlTableCell cellC = new System.Web.UI.HtmlControls.HtmlTableCell();
            cellA.InnerText = "t2 C1Header";
            cellB.InnerText = "t2 C2Header";
            cellC.InnerText = "t2 C3Header";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);
            cellA = new HtmlTableCell();
            cellB = new HtmlTableCell();
            cellC = new HtmlTableCell();
            rowR = new HtmlTableRow();
            cellA.InnerText = "r1c1";
            cellB.InnerHtml = "r2c2";
            cellC.InnerText = "r3c3";
            rowR.Cells.Add(cellA);
            rowR.Cells.Add(cellB);
            rowR.Cells.Add(cellC);
            tableT.Rows.Add(rowR);

            this.Controls.Add(tableT);
        }
        public void LoadUDFs()
        {
            var udfList = UDF.GetUDFList(_udfLevel, _levelID);

            if (udfList.Count > 0)
            {
                var udfTable = new HtmlTable();
                udfTable.Attributes["class"] = "fieldValueTable";
                udfTable.Width = "100%";

                foreach (UDF udf in udfList)
                {
                    var tableRow = new HtmlTableRow();
                    var labelCell = new HtmlTableCell();
                    var valueCell = new HtmlTableCell();

                    labelCell.Attributes["class"] = "fieldLabel";
                    labelCell.InnerHtml = udf.Name + ":";

                    valueCell.InnerHtml = udf.Value;

                    tableRow.Cells.Add(labelCell);
                    tableRow.Cells.Add(valueCell);

                    udfTable.Rows.Add(tableRow);

                    udfInformationContainer.Controls.Add(udfTable);
                    udfTable.DataBind();
                }
            }
        }
예제 #15
0
        private void RefreshCheckpointList()
        {
            CheckpointsTable.Rows.Clear();

            HtmlTableRow tr = new HtmlTableRow();

            foreach (JobCheckpoint cp in checkpoints)
            {
                HtmlTableCell value = new HtmlTableCell();
                value.InnerText = cp.Name;

                switch (cp.ExecutionStatus)
                {
                    case JobExecutionState.Unknown:
                    case JobExecutionState.Scheduled:
                        value.Attributes.Add("class", "Checkpoint");
                        break;
                    default:
                        value.Attributes.Add("class", "Checkpoint Checkpoint" + cp.ExecutionStatus.ToString());
                        break;
                }

                tr.Cells.Add(value);
            }

            CheckpointsTable.Rows.Add(tr);
        }
예제 #16
0
 private void BindUserGorupMaxspacephotosize()
 {
     #region 绑定用户组照片空间大小
     DataTable dt = DatabaseProvider.GetInstance().GetUserGroupMaxspacephotosize();
     int i = 1;
     HtmlTableRow tr = new HtmlTableRow();
     foreach (DataRow dr in dt.Rows)
     {
         if (i % 2 == 1)
         {
             tr = new HtmlTableRow();
         }
         HtmlTableCell td = new HtmlTableCell("td");
         td.Controls.Add(new LiteralControl(dr["grouptitle"].ToString()));
         tr.Cells.Add(td);
         td = new HtmlTableCell("td");
         Discuz.Control.TextBox tb = new Discuz.Control.TextBox();
         tb.ID = "maxspacephotosize" + dr["groupid"].ToString();
         tb.Size = 10;
         tb.MaxLength = 9;
         tb.Text = dr["maxspacephotosize"].ToString();
         tb.RequiredFieldType = "数据校验";
         td.Controls.Add(tb);
         tr.Cells.Add(td);
         tr.Cells.Add(GetTD("maxspacephotosize" + dr["groupid"].ToString()));
         groupphotosize.Rows.Add(tr);
         i++;
     }
     #endregion
 }
예제 #17
0
 private HtmlTableCell AddCell(HtmlTableRow row, string text)
 {
     var cell = new HtmlTableCell();
     cell.InnerHtml = text;
     row.Cells.Add(cell);
     return cell;
 }
예제 #18
0
        private void FutureAppointmentRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            switch (e.Item.ItemType)
            {
            case ListItemType.Item:
            case ListItemType.AlternatingItem:
                System.Web.UI.HtmlControls.HtmlTableRow approw = (System.Web.UI.HtmlControls.HtmlTableRow)e.Item.FindControl("approw");

                Literal startdate = (Literal)e.Item.FindControl("startdate");
                long    idrow     = (long)DataBinder.Eval(e.Item.DataItem, "id");

                DateTime dd = Convert.ToDateTime(DataBinder.Eval(e.Item.DataItem, "startdate"));

                startdate.Text = UC.LTZ.ToLocalTime(dd).ToShortDateString();

                if (idDate.Count > 0)
                {
                    foreach (ViewReminder vr in idDate)
                    {
                        if (vr.id == idrow)
                        {
                            startdate.Text = UC.LTZ.ToLocalTime(vr.Date).ToShortDateString();
                            break;
                        }
                    }
                }
                approw.Attributes.Add("onclick", string.Format("location.href='/calendar/agenda.aspx?Date={0}'", startdate.Text));

                break;
            }
        }
        protected void BuildStudentGrowthTable()
        {
            var table = new HtmlTable();
            var headerRow = new HtmlTableRow();

            table.Width = "100%";
            table.Attributes["class"] = "sgTable";

            //Add header row
            foreach(DataColumn column in _ds.Tables[1].Columns)
            {
                var headerCell = new HtmlTableCell();
                headerCell.Attributes["class"] = "sgTableHeadCell";
                headerCell.InnerHtml = column.ColumnName;
                headerRow.Cells.Add(headerCell);
            }
            table.Rows.Add(headerRow);
            
            //Add body rows
            foreach(DataRow row in _ds.Tables[1].Rows)
            {
                var tableRow = new HtmlTableRow();
                foreach(DataColumn column in _ds.Tables[1].Columns)
                {
                    var tableCell = new HtmlTableCell();
                    tableCell.Attributes["class"] = table.Rows.Count % 2 == 0 ? "" : "altTD";
                    tableCell.InnerHtml = row[column].ToString();
                    tableRow.Cells.Add(tableCell);
                }
                table.Rows.Add(tableRow);
            }

            if (_ds.Tables[1].Rows.Count > 1 || (_ds.Tables[1].Rows.Count > 0 && !_ds.Tables[1].Rows[0][0].ToString().Contains("N/A")))
            {

                //Add spacer row
                var spacerRow = new HtmlTableRow();
                var spacerCell = new HtmlTableCell();
                spacerCell.ColSpan = _ds.Tables[1].Columns.Count;
                spacerCell.InnerHtml = "&nbsp;";
                spacerCell.BgColor = "bababa";
                spacerRow.Cells.Add(spacerCell);
                table.Rows.Add(spacerRow);

                //Add aggregate concordant row
                var concordRow = new HtmlTableRow();
                var concordCell1 = new HtmlTableCell();
                var concordCell2 = new HtmlTableCell();
                concordCell1.ColSpan = _ds.Tables[1].Columns.Count - 1;
                concordCell2.InnerHtml = "Aggregate Concordant = <span class=\"normalText\">" + _aggregateConcordant + "</span>";
                concordCell2.Attributes["class"] = "sgTableHeadCell";
                concordRow.Cells.Add(concordCell1);
                concordRow.Cells.Add(concordCell2);
                table.Rows.Add(concordRow);
            }

            //Add table to panel
            studentGrowDataTable.Controls.Add(table);
        }
예제 #20
0
파일: sz.aspx.cs 프로젝트: JuRogn/OA
 public static void BuildTableRow(HtmlTable table, TmpAward item)
 {
     var tr = new HtmlTableRow();
     var cell = new HtmlTableCell();
     cell.InnerText = item.TicketNO;
     tr.Cells.Add(cell);
     table.Rows.Add(tr);
 }
예제 #21
0
 protected void lstNotes_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Footer)
     {
         System.Web.UI.HtmlControls.HtmlTableRow myNoDataRow = (System.Web.UI.HtmlControls.HtmlTableRow)e.Item.FindControl("myNoDataRow");
         myNoDataRow.Visible = this.lstNotes.Items.Count == 0;
     }
 }
        private void LoadData()
        {
            /* Get our standard from TileParms collection. */
            var oStd = (Thinkgate.Base.Classes.Standards)Tile.TileParms.GetParm("standards");

            /* populate controls from our standard. */
            StdsPage_StdsContent_DivStdTitle.InnerText = BuildStdTitle(oStd);
            StdsPage_StdsContent_DivStdText.InnerHtml = oStd.Desc;

            /* populate parent information if our standard has a parent */

            if (oStd.Parent != null)
            {
                StdsPage_StdsContent_DivStdParentTitle.InnerText = BuildStdTitle(oStd.Parent);
                StdsPage_StdsContent_DivStdParentText.InnerHtml = oStd.Parent.Desc;
            }
            else
            {
                StdsPage_StdsContent_DivStdParentTitle.InnerText = "";
                StdsPage_StdsContent_DivStdParentText.InnerText = "";
            }

            /* populate children informationif our standard has children */
            if (oStd.Children.Count >0)
            {
                sb = new StringBuilder("");

                HtmlTable oTbl = new HtmlTable();
                HtmlTableRow oRow;
                HtmlTableCell oCell;
                System.Web.UI.HtmlControls.HtmlGenericControl oDiv;

                foreach (Thinkgate.Base.Classes.Standards oChildStd in oStd.Children)
                {
                    oRow = new HtmlTableRow();
                    oCell = new HtmlTableCell();

                    oDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                    oDiv.Attributes.Add("class", "stdTitle");
                    oDiv.Style.Add("display","block");
                    oDiv.InnerText = BuildStdTitle(oChildStd);

                    oCell.Controls.Add(oDiv);

                    oDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                    oDiv.Attributes.Add("class", "stdText");
                    oDiv.Style.Add("display", "block");
                    oDiv.InnerHtml = oChildStd.Desc;

                    oCell.Controls.Add(oDiv);

                    oRow.Cells.Add(oCell);
                    oTbl.Rows.Add(oRow);
                }

                StdsPage_StdsContent_divStdChildren.Controls.Add(oTbl);
            }
        }
예제 #23
0
		override protected void OnInit(EventArgs e)
		{
			base.OnInit(e);

			node = new cms.businesslogic.CMSNode(int.Parse(helper.Request("id")));

			HtmlTable ht = new HtmlTable();
			ht.CellPadding = 4;

			HtmlTableRow captions = new HtmlTableRow();
			captions.Cells.Add(new HtmlTableCell());

            ArrayList actionList = BusinessLogic.Actions.Action.GetAll();
            foreach (interfaces.IAction a in actionList)
            {
				if (a.CanBePermissionAssigned) 
				{
					HtmlTableCell hc = new HtmlTableCell();
					hc.Attributes.Add("class", "guiDialogTinyMark");
					hc.Controls.Add(new LiteralControl(ui.Text("actions", a.Alias)));
					captions.Cells.Add(hc);
				}
			}
			ht.Rows.Add(captions);

			foreach (BusinessLogic.User u in BusinessLogic.User.getAll()) 
			{
				// Not disabled users and not system account
				if (!u.Disabled && u.Id > 0) 
				{
					HtmlTableRow hr = new HtmlTableRow();

					HtmlTableCell hc = new HtmlTableCell();
					hc.Attributes.Add("class", "guiDialogTinyMark");
					hc.Controls.Add(new LiteralControl(u.Name));
					hr.Cells.Add(hc);

					foreach (interfaces.IAction a in BusinessLogic.Actions.Action.GetAll()) 
					{
						CheckBox c = new CheckBox();
						c.ID = u.Id + "_" + a.Letter;
						if (a.CanBePermissionAssigned) 
						{
							if (u.GetPermissions(node.Path).IndexOf(a.Letter) > -1)
								c.Checked = true;
							HtmlTableCell cell = new HtmlTableCell();
							cell.Style.Add("text-align", "center");
							cell.Controls.Add(c);
							permissions.Add(c);
							hr.Cells.Add(cell);
						}
							
					}
					ht.Rows.Add(hr);
				}
			}
			PlaceHolder1.Controls.Add(ht);
		}
예제 #24
0
        /// <summary>
        /// Renders a row containing control cells to a table.
        /// </summary>
        /// <param name="table">The output table.</param>
        /// <param name="controls">The collection of controls.</param>
        protected override void RenderRow(HtmlTable table, Control[] controls)
        {
            HtmlTableRow tr = new HtmlTableRow();

            HtmlTableCell controlcell = ComposeCell(ControlCellStyle, ControlCellWidth, controls);
            tr.Controls.Add(controlcell);

            table.Controls.Add(tr);
        }
예제 #25
0
        protected void createTable()
        {
            var b = db.LostAndFound_Admin;
            var a = from t in b select t;
            int c = b.Count();
            int count = 0;
            string[] nameList = new string[c];
            string[] dateList = new string[c];
            string[] desList = new string[c];
            string[] imageList = new string[c];
            string[] roomList = new string[c];
            
            foreach (var d in a)
            {
                
                var name = d.Name;
                nameList[count] = name;
                var room = d.Room;
                roomList[count] = room;
                var lostDate = d.LostTime;
                dateList[count] = lostDate.ToString("yyyy-MM-dd");
                var des = d.Description;
                desList[count] = des;
                var image = d.ImageName;
                imageList[count] = image;
                count++;
            }

            int row = count / 3 ;
            if (count % 3 > 0) row++;
            //Response.Write(row.ToString()+"   "+count.ToString());
            int cnt = 0;

            for ( int i = 0; i < row; i ++)
            {
                HtmlTableRow htr = new HtmlTableRow();
                for (int j = 0; j < 3; j++)
                {
                    HtmlTableCell htc = new HtmlTableCell();

                    htr.Cells.Add(htc);
                    htc.Width = "266";
                    htc.Height = "300";

                    htc.InnerHtml = "<img src=\"File/" + imageList[i * 3 + j] + "\" width=\"250px\" height=\"190px\" style=\"margin-top:10px;\">" +
                           "<h5>" + "名称:"+nameList[i * 3 + j] + "</h5>" +
                           "<h5>" + "机房:"+roomList[i * 3 + j] + "</h5>" +
                           "<h5>" + "日期:"+dateList[i * 3 + j] + "</h5>" +
                           "<h5>" + "描述:"+desList[i * 3 + j] + "</h5>";
                           ;
                    cnt++;
                    if (cnt == count)
                        break;
                }
                d_table.Rows.Add(htr);
            }
        }
 private void AddTR(string title, int colspan)
 {
     HtmlTableRow tr = new HtmlTableRow();
     HtmlTableCell td = new HtmlTableCell("td");
     td.InnerHtml = title;
     td.ColSpan = colspan;
     tr.Cells.Add(td);
     tblProducts.Rows.Add(tr);
 }
 private void AddTH(string title, int colspan)
 {
     HtmlTableRow tr = new HtmlTableRow();
     HtmlTableCell th = new HtmlTableCell("th");
     th.InnerHtml = title;
     th.ColSpan = colspan;
     tr.Cells.Add(th);
     tblProducts.Rows.Add(tr);
 }
예제 #28
0
        private void LoadTopPanel(Panel topPanel)
        {
            topPanel.CssClass = this.TopPanelCssClass;
            using (HtmlTable table = new HtmlTable())
            {
                using (HtmlTableRow row = new HtmlTableRow())
                {
                    using (HtmlTableCell dropDownListCell = new HtmlTableCell())
                    {
                        filterDropDownList = new DropDownList();

                        filterDropDownList.ID = "FilterDropDownList";
                        filterDropDownList.CssClass = this.FilterDropDownListCssClass;
                        filterDropDownList.DataTextField = "column_name";
                        filterDropDownList.DataValueField = "column_name";
                        filterDropDownList.DataBound += this.FilterDropDownList_DataBound;

                        dropDownListCell.Controls.Add(filterDropDownList);
                        row.Cells.Add(dropDownListCell);

                    }
                    using (HtmlTableCell textBoxCell = new HtmlTableCell())
                    {
                        filterTextBox = new TextBox();
                        filterTextBox.ID = "FilterTextBox";
                        filterTextBox.CssClass = this.FilterTextBoxCssClass;
                        textBoxCell.Controls.Add(filterTextBox);
                        row.Cells.Add(textBoxCell);
                    }

                    using (HtmlTableCell buttonCell = new HtmlTableCell())
                    {
                        goButton = new Button();
                        goButton.ID = "GoButton";
                        goButton.CssClass = this.ButtonCssClass;

                        if (this.ButtonHeight != null)
                        {
                            goButton.Height = this.ButtonHeight;
                        }

                        if (this.ButtonWidth != null)
                        {
                            goButton.Width = this.ButtonWidth;
                        }

                        goButton.Click += this.GoButton_Click;
                        goButton.Text = Resources.ScrudResource.Go;
                        buttonCell.Controls.Add(goButton);
                        row.Cells.Add(buttonCell);
                    }

                    table.Rows.Add(row);
                    topPanel.Controls.Add(table);
                }
            }
        }
예제 #29
0
        internal static void AddCell(HtmlTableRow row, string text)
        {
            using (HtmlTableCell cell = new HtmlTableCell())
            {
                cell.InnerHtml = text;

                row.Cells.Add(cell);
            }
        }
예제 #30
0
        protected void btnRowTable_Click(object sender, EventArgs e)
        {
            HtmlTable table = new HtmlTable();
            HtmlTableRow row = new HtmlTableRow();
            HtmlTableRow rowB = new HtmlTableRow();
            HtmlTableRow rowC = new HtmlTableRow();
            HtmlTableCell cell = new HtmlTableCell();
            HtmlTableCell cell1 = new HtmlTableCell();
            HtmlTableCell cell2 = new HtmlTableCell();
            HtmlTableCell cell3 = new HtmlTableCell();
            HtmlTableCell cell4 = new HtmlTableCell();
            HtmlTableCell cell5 = new HtmlTableCell();
            HtmlTableCell cell6 = new HtmlTableCell();
            HtmlTableCell cell7 = new HtmlTableCell();
            HtmlTableCell cell8 = new HtmlTableCell();
            HtmlTableCell cell9 = new HtmlTableCell();
            cell.InnerText = "This is Column 1";
            cell2.InnerText = "This is Column 2";
            cell3.InnerText = " This is Column 3";
            row.Cells.Add(cell);
            row.Cells.Add(cell2);
            row.Cells.Add(cell3);
            table.Rows.Add(row);
            row = new HtmlTableRow();
            cell = new HtmlTableCell();
            cell2 = new HtmlTableCell();
            cell3 = new HtmlTableCell();
            cell.InnerText = "column 4a";
            cell2.InnerText = "column 5a";
            cell3.InnerText = "Column 6a";
            row.Cells.Add(cell);
            row.Cells.Add(cell2);
            row.Cells.Add(cell3);
            table.Rows.Add(row);

            cell = new HtmlTableCell();
            cell.InnerText = "this is the new cell";
            cell1 = new HtmlTableCell();
            cell1.InnerText = "this is the new cell1";
            cell2 = new HtmlTableCell();
            cell2.InnerText = "this is the new cell3";
            row = new HtmlTableRow();
            row.Cells.Add(cell);
            row.Cells.Add(cell1);
            row.Cells.Add(cell2);
            table.Rows.Add(row);

            //cell7.InnerText = "again with 4";
            //cell8.InnerText = "again with 5";
            //cell9.InnerText = "again with 6";
            //rowC.Cells.Add(cell7);
            //rowC.Cells.Add(cell8);
            //rowC.Cells.Add(cell9);
            //table.Rows.Add(rowC);

            this.Controls.Add(table);
        }
        protected void productNamesDDL_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {

                Product p = new Product();
                GridView gvProperties = new GridView();
                Category c = new Category();
                categoryProducts = c.GetAllCategoryProducts(categories[categoriesNamesDDL.Text].ToString());
                gvProperties = p.productPropertiesStatistics(categoryProducts[productNamesDDL.Text]);
                foreach (GridViewRow row in gvProperties.Rows)
                {
                    HtmlTableRow tr = new HtmlTableRow();
                    HtmlTableCell tc = new HtmlTableCell();
                    HtmlTableCell tc1 = new HtmlTableCell();
                    HtmlTableCell tc2 = new HtmlTableCell();
                    tc.InnerHtml = row.Cells[0].Text;
                    tc1.InnerHtml = row.Cells[1].Text;
                    tc2.InnerHtml = '%' + row.Cells[2].Text;
                    tr.Controls.Add(tc);
                    tr.Controls.Add(tc1);
                    tr.Controls.Add(tc2);
                    productPropertiesStatistics.Controls.Add(tr);
                }
                GridView productHistory = p.GetHistoryScan(categoryProducts[productNamesDDL.Text]);
                int count = 0;
                foreach (GridViewRow row in productHistory.Rows)
                {

                    for (int i = 0; i < row.Cells.Count - 2; i++)
                    {
                        count += Convert.ToInt32(row.Cells[i].Text);
                    }
                    for (int i = 0; i < row.Cells.Count - 2; i++)
                    {
                        HtmlTableRow tr = new HtmlTableRow();
                        HtmlTableCell tc = new HtmlTableCell();
                        HtmlTableCell tc1 = new HtmlTableCell();
                        HtmlTableCell tc2 = new HtmlTableCell();
                        tc.InnerHtml = DateTime.Now.AddMonths(-i).Month.ToString() + "/" + DateTime.Now.AddMonths(-i).Year.ToString();
                        tc1.InnerHtml = row.Cells[i].Text;
                        int ss = Convert.ToInt32(row.Cells[i].Text);
                        tc2.InnerHtml = '%' + ((Convert.ToDouble(row.Cells[i].Text) / count) * 100).ToString();
                        tr.Controls.Add(tc);
                        tr.Controls.Add(tc1);
                        tr.Controls.Add(tc2);
                        prodyctHistoryStatistics.Controls.Add(tr);
                    }
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
예제 #32
0
파일: Common.cs 프로젝트: porter1130/C-A
 public static void IsShowComments(HtmlTableRow trComments, HtmlTable tblCommentsList)
 {
     SPListItem item = SPContext.Current.ListItem;
     string strFlag = item["Flag"] + "";
     if (strFlag == "Save")
     {
         trComments.Style.Add("display", "none");
         tblCommentsList.Style.Add("display", "none");
     }
 }
        private void CreateDimension(short AxisOrdinal, HtmlTable hostTable , Dimension dim)
        {
            HtmlTableRow tr=new HtmlTableRow();
            HtmlTableCell td;
            System.Web.UI.WebControls.Button btn;

            // --- node contr col--
            tr=new HtmlTableRow();
            td= new HtmlTableCell();
            td.Attributes.Add("class","sel_C1");
            td.NoWrap=true;
            tr.Cells.Add(td);

            // --- node name col--
            td= new HtmlTableCell();

            btn=new System.Web.UI.WebControls.Button();
            if(dim.IsOpen)
            {
                btn.ToolTip="Close";
                btn.ID="sel_dclose:"+ dim.UniqueName;
                btn.CssClass="sel_close";
            }
            else
            {
                btn.ToolTip="Open";
                btn.ID="sel_dopen:"+ dim.UniqueName;
                btn.CssClass="sel_open";
            }
            td.Controls.Add(btn);

            Literal lit=new Literal();
            lit.Text=dim.Name;
            td.Controls.Add(lit);
            td.Attributes.Add("class","sel_C");
            td.NoWrap=true;
            tr.Cells.Add(td);

            // --- node select col--
            td= new HtmlTableCell();
            td.Attributes.Add("class","sel_C");
            td.NoWrap=true;
            tr.Cells.Add(td);

            hostTable.Rows.Add(tr);

            if(dim.IsOpen==false)
                return;

            // members level depth=0
            for(int j=0;j<dim.Hierarchies.Count;j++)
                if(dim.Hierarchies[j].Axis.Ordinal==AxisOrdinal) // only if axis matches
                    CreateHierarchy(AxisOrdinal, hostTable, dim.Hierarchies[j],  1); //treedepth is 1 because 0 is dim
        }
예제 #34
0
 private DateTime CreateWeekNumberCell(DateTime idxDate, HTML.HtmlTableRow row)
 {
     // Creating week number cell
     // Calculates according to ISO-8601
     HTML.HtmlTableCell week = new HTML.HtmlTableCell();
     week.EnableViewState = false;
     week.Attributes.Add("class", "weekno");
     week.InnerHtml = GetWeekNumber(idxDate).ToString();
     row.Cells.Add(week);
     return(idxDate);
 }
예제 #35
0
        // carrega a página
        public Boolean loadPage(HtmlTable table, Boolean showEdit, Boolean showFirst, Boolean zebra, String editText, String editFunc)
        {
            // classe mãe
            if (!base.loadPage()){
                return false;
            }
            else
            {
                CDataBase db = new CDataBase();
                HtmlTableRow row;
                HtmlTableCell cell;

                CQuery query = db.select(this._isqlload, this._fields);

                if (query == null)
                    return false;

                int initRow = table.Rows.Count;

                for (int i = 0; i < query.Count(); i++)
                {

                    row = new HtmlTableRow();

                    for (int j = (showFirst ? 0 : 1); j < query.Row(i).Count(); j++)
                    {

                        cell = new HtmlTableCell();
                        cell.InnerHtml = query.Field(i, j);

                        row.Cells.Add(cell);
                    }

                    if (showEdit)
                    {
                        cell = new HtmlTableCell();
                        cell.InnerHtml = "<a href=\"#\" onclick=\"" + mountFunction(editFunc, query.Row(i)) + "\"" +
                            " onmouseenter=\"javascript:document.getElementById('" + table.ID + "').rows[" + (int)(i + initRow) + "].style.color = 'EB151C';\"" +
                            " onmouseleave=\"javascript:document.getElementById('" + table.ID + "').rows[" + (int)(i + initRow) + "].style.color = '';\"" +
                            ">" + editText + "</a>";
                        row.Cells.Add(cell);
                    }

                    if (i % 2 == 1 && zebra)
                        row.Style.Add("background-color", "Gainsboro");

                    table.Rows.Add(row);

                }

                return true;
            }
        }
예제 #36
0
    private void addNewRow()
    {
        System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow();
        TextBox tb1 = new TextBox();

        tb1.Height = 30;
        tb1.ID     = "box" + (5 * itemList.Rows.Count + 1);//一定要保证ID的唯一性,这样每次增加才能保留原来的值
        System.Web.UI.HtmlControls.HtmlTableCell name = new System.Web.UI.HtmlControls.HtmlTableCell();
        name.Controls.Add(tb1);
        row.Cells.Add(name);

        System.Web.UI.HtmlControls.HtmlTableCell version = new System.Web.UI.HtmlControls.HtmlTableCell();
        TextBox tb2 = new TextBox();

        tb2.Height = 30;
        tb2.ID     = "box" + (5 * itemList.Rows.Count + 2);
        version.Controls.Add(tb2);
        row.Cells.Add(version);

        System.Web.UI.HtmlControls.HtmlTableCell price = new System.Web.UI.HtmlControls.HtmlTableCell();
        TextBox tb4 = new TextBox();

        tb4.Height = 30;
        tb4.ID     = "box" + (5 * itemList.Rows.Count + 3);
        price.Controls.Add(tb4);
        row.Cells.Add(price);

        System.Web.UI.HtmlControls.HtmlTableCell count = new System.Web.UI.HtmlControls.HtmlTableCell();
        TextBox tb3 = new TextBox();

        tb3.Height = 30;
        tb3.ID     = "box" + (5 * itemList.Rows.Count + 4);
        count.Controls.Add(tb3);
        row.Cells.Add(count);

        System.Web.UI.HtmlControls.HtmlTableCell allExpense = new System.Web.UI.HtmlControls.HtmlTableCell();
        TextBox tb5 = new TextBox();

        tb5.Height = 30;
        tb5.ID     = "box" + (5 * itemList.Rows.Count + 5);
        allExpense.Controls.Add(tb5);
        row.Cells.Add(allExpense);


        itemList.Rows.Add(row);
    }
예제 #37
0
    private void addNewRow()
    {
        System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow();

        DropDownList db1 = new DropDownList();

        db1.Height = 30;
        db1.Items.Add("设计费");
        db1.Items.Add("专用费");
        db1.Items.Add("材料费");
        db1.Items.Add("外协费");
        db1.Items.Add("燃料动力费");
        db1.Items.Add("固定资产使用费");
        db1.Items.Add("工资费");
        db1.Items.Add("劳务费");
        db1.Items.Add("差旅费");
        db1.Items.Add("会议费");
        db1.Items.Add("事务费");
        db1.Items.Add("专家咨询费");
        db1.Items.Add("管理费");
        db1.Items.Add("不可预见费");
        db1.ID = "box" + (3 * itemList.Rows.Count + 1);//一定要保证ID的唯一性,这样每次增加才能保留原来的值
        System.Web.UI.HtmlControls.HtmlTableCell itemType = new System.Web.UI.HtmlControls.HtmlTableCell();
        itemType.Controls.Add(db1);
        row.Cells.Add(itemType);

        System.Web.UI.HtmlControls.HtmlTableCell itemDetail = new System.Web.UI.HtmlControls.HtmlTableCell();
        TextBox tb2 = new TextBox();

        tb2.Height = 30;
        tb2.ID     = "box" + (3 * itemList.Rows.Count + 2);
        itemDetail.Controls.Add(tb2);
        row.Cells.Add(itemDetail);

        System.Web.UI.HtmlControls.HtmlTableCell budget = new System.Web.UI.HtmlControls.HtmlTableCell();
        TextBox tb3 = new TextBox();

        tb3.Height = 30;
        tb3.ID     = "box" + (3 * itemList.Rows.Count + 3);
        budget.Controls.Add(tb3);
        row.Cells.Add(budget);


        itemList.Rows.Add(row);
    }
예제 #38
0
        private static DateTime CreateWeekDaysAtTop(DateTime idxDate, HTML.HtmlTable tbl)
        {
            HTML.HtmlTableRow rowDays = new HTML.HtmlTableRow();
            rowDays.EnableViewState = false;
            rowDays.Cells.Add(new HTML.HtmlTableCell());
            rowDays.Attributes.Add("class", "weekdays");
            DateTime idxWeekDay = idxDate;

            for (int idx = 0; idx < 7; idx++)
            {
                HTML.HtmlTableCell cell = new HTML.HtmlTableCell();
                cell.EnableViewState = false;
                cell.InnerHtml       = idxWeekDay.ToString("ddd", System.Threading.Thread.CurrentThread.CurrentUICulture);
                rowDays.Cells.Add(cell);
                idxWeekDay = idxWeekDay.AddDays(1);
            }
            tbl.Rows.Add(rowDays);
            return(idxDate);
        }
예제 #39
0
        private void RenderTableBody(HtmlTextWriter writer)
        {
            //生成表体标记(开始)
            writer.RenderBeginTag(HtmlTextWriterTag.Tbody);

            if (Utility.IsEmptyCollection(this.DataSource))
            {
                if (_emptyTemplate != null)
                {
                    var tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                    var td = new System.Web.UI.HtmlControls.HtmlTableCell()
                    {
                        ColSpan = this.Columns.Count,
                    };

                    tr.Controls.Add(td);
                    _emptyTemplate.InstantiateIn(td);
                    tr.RenderControl(writer);
                }
            }
            else
            {
                IEnumerable dataSource = this.DataSource as IEnumerable;

                if (dataSource == null)
                {
                    this.GenerateRow(writer, this.DataSource, 1);
                }
                else
                {
                    int index = 0;
                    foreach (var dataItem in dataSource)
                    {
                        FormExtension.PushDataItem(this.Page, dataItem, index);
                        this.GenerateRow(writer, dataItem, index++);
                        FormExtension.PopDataItem(this.Page);
                    }
                }
            }

            //生成表体标记(结束)
            writer.RenderEndTag();
        }
예제 #40
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Control.HtmlTable    table     = new Control.HtmlTable();
            Control.HtmlTableRow headerRow = new Control.HtmlTableRow();
            headerRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "Color"
            });
            headerRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "Count"
            });
            table.Rows.Add(headerRow);
            foreach (String[] data in tableRows)
            {
                table.Rows.Add(new Control.HtmlTableRow
                {
                    Cells =
                    {
                        new Control.HtmlTableCell {
                            InnerText = data[0]
                        },
                        new Control.HtmlTableCell {
                            InnerText = data[1]
                        },
                    }
                });
            }

            Control.HtmlTableRow footRow = new Control.HtmlTableRow();
            footRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "Total"
            });
            footRow.Cells.Add(new Control.HtmlTableCell("th")
            {
                InnerText = "46"
            });
            table.Rows.Add(footRow);

            container.Controls.Add(table);
        }
예제 #41
0
        private void CreateTodayButton(HTML.HtmlTable tbl)
        {
            HTML.HtmlTableRow bottomRow = new HTML.HtmlTableRow();
            bottomRow.EnableViewState = false;
            bottomRow.ID = "stat_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            HTML.HtmlTableCell bottomCell = new HTML.HtmlTableCell();
            bottomCell.EnableViewState     = false;
            bottomCell.Style["text-align"] = "center";
            bottomCell.ID      = "bottC_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            bottomCell.ColSpan = 8;
            LinkButton today = new LinkButton();

            today.ID              = "todayBtn";
            today.Text            = "Today";
            today.Click          += new EventHandler(today_Click);
            today.EnableViewState = false;
            bottomCell.Controls.Add(today);
            bottomRow.Cells.Add(bottomCell);
            tbl.Rows.Add(bottomRow);
        }
예제 #42
0
파일: Add.aspx.cs 프로젝트: aPaXuC/DBBonus
    private void fillOpinion(string kgNum)
    {
        Dictionary <string, object> data = new Dictionary <string, object>();

        data.Add("kgID", kgNum);

        System.Data.DataTable dt = DBConnection.runProcWithResults("getAllKgOpinions", data);
        foreach (System.Data.DataRow item in dt.Rows)
        {
            System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow();
            tr.Attributes.Add("class", int.Parse(item["grade"].ToString()) > 5 ? "success" : "danger");
            System.Web.UI.HtmlControls.HtmlTableCell tc = new System.Web.UI.HtmlControls.HtmlTableCell();
            tc.InnerText = item["talk"].ToString();
            tr.Controls.Add(tc);
            System.Web.UI.HtmlControls.HtmlTableCell tc1 = new System.Web.UI.HtmlControls.HtmlTableCell();
            tc1.InnerText = item["grade"].ToString();
            tr.Controls.Add(tc1);
            opinionTable.Rows.Add(tr);
        }
    }
예제 #43
0
        private void CreateYearMonthPicker(HTML.HtmlTable tbl)
        {
            // Creating header row (with month and year picker)
            HTML.HtmlTableRow headerRow = new HTML.HtmlTableRow();
            headerRow.EnableViewState = false;
            headerRow.ID = "head_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            HTML.HtmlTableCell headerCell = new HTML.HtmlTableCell();
            headerCell.EnableViewState     = false;
            headerCell.Style["text-align"] = "center";
            headerCell.ID      = "headC_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);
            headerCell.ColSpan = 8;

            // Year SelectList
            CreateYearPicker(headerCell);

            // Month SelectList
            CreateMonthPicker(headerCell);

            headerRow.Cells.Add(headerCell);
            tbl.Rows.Add(headerRow);
        }
예제 #44
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bool Opt_isUseCheckCode = _Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
            if (Opt_isUseCheckCode)
            {
                System.Web.UI.HtmlControls.HtmlTableRow textCheckCodeHidden = tbLogin1.FindControl("textCheckCodeHidden") as System.Web.UI.HtmlControls.HtmlTableRow;

                this.textCheckCodeHidden.Visible = true;
            }
            else
            {
                textCheckCodeHidden.Visible = false;
            }

            if (_User != null)
            {
                Response.Redirect("index.aspx");
            }
        }
    }
예제 #45
0
 protected override void AttachChildControls()
 {
     this.litOldQuestion        = (System.Web.UI.WebControls.Literal) this.FindControl("litOldQuestion");
     this.txtOdeAnswer          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtOdeAnswer");
     this.txtQuestion           = (System.Web.UI.WebControls.TextBox) this.FindControl("txtQuestion");
     this.txtAnswer             = (System.Web.UI.WebControls.TextBox) this.FindControl("txtAnswer");
     this.LkUpdateTradePassword = (System.Web.UI.HtmlControls.HtmlGenericControl) this.FindControl("one2");
     this.btnOK3 = ButtonManager.Create(this.FindControl("btnOK3"));
     this.StatusPasswordProtection = (SmallStatusMessage)this.FindControl("StatusPasswordProtection");
     this.tblrOldQuestion          = (System.Web.UI.HtmlControls.HtmlTableRow) this.FindControl("tblrOldQuestion");
     this.tblrOldAnswer            = (System.Web.UI.HtmlControls.HtmlTableRow) this.FindControl("tblrOldAnswer");
     PageTitle.AddSiteNameTitle("修改密码保护", HiContext.Current.Context);
     this.btnOK3.Click += new System.EventHandler(this.btnOK3_Click);
     if (!this.Page.IsPostBack)
     {
         this.BindAnswerAndQuestion();
         Member member = Users.GetUser(HiContext.Current.User.UserId, false) as Member;
         if (!member.IsOpenBalance)
         {
             this.LkUpdateTradePassword.Visible = false;
         }
     }
 }
예제 #46
0
    protected void Page_Load(object sender, EventArgs e)
    {
        System.Xml.Linq.XElement xeErrors = null;
        xeErrors = commonVariables.ErrorsXML;

        #region Logout
        if (string.Compare(Convert.ToString(this.RouteData.DataTokens["logout"]), "true", true) == 0)
        {
            commonVariables.ClearSessionVariables(); commonCookie.ClearCookies();
        }
        if (string.Compare(Convert.ToString(this.RouteData.DataTokens["expire"]), "true", true) == 0)
        {
            commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); txtMessage.InnerHtml = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors).Replace("\\n", "<br />");
        }
        if (string.Compare(Convert.ToString(this.RouteData.DataTokens["invalid"]), "true", true) == 0)
        {
            commonVariables.ClearSessionVariables(); commonCookie.ClearCookies(); txtMessage.InnerHtml = commonCulture.ElementValues.getResourceString("SessionExpired", xeErrors).Replace("\\n", "<br />");
        }
        #endregion

        if (!Page.IsPostBack)
        {
            customConfig.OperatorSettings opSettings = new customConfig.OperatorSettings("W88");
            string        arrStrLanguageSelection    = opSettings.Values.Get("LanguageSelection");
            List <string> lstLanguageSelection       = arrStrLanguageSelection.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim()).ToList();

            foreach (string language in lstLanguageSelection)
            {
                System.Web.UI.HtmlControls.HtmlTableRow  trRow  = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableCell tdCell = new System.Web.UI.HtmlControls.HtmlTableCell();

                tdCell.InnerHtml = string.Format("<a href='/_Secure/Login?lang={0}'>{0}</a>", language.Trim());
                trRow.Cells.Add(tdCell);
                tblLanguage.Rows.Add(trRow);
            }
        }
    }
예제 #47
0
    private void fillActivityInfo(int rowNum)
    {
        if (act.Rows.Count != 0)
        {
            //fill activity card
            tbActID.Text         = act.Rows[rowNum]["ID"].ToString();
            tbActName.Text       = act.Rows[rowNum]["name"].ToString();
            tbOperLastName.Text  = act.Rows[rowNum]["surName"].ToString();
            tbOperFirstName.Text = act.Rows[rowNum]["firstName"].ToString();
            tbDayInWeek.Text     = act.Rows[rowNum]["dayInWeek"].ToString();
            tbstartTime.Text     = act.Rows[rowNum]["startTime"].ToString();
            tbEndTime.Text       = act.Rows[rowNum]["endTime"].ToString();
            tbCost.Text          = act.Rows[rowNum]["cost"].ToString();

            //fill charts card


            //fill opinions card
            Dictionary <string, object> data = new Dictionary <string, object>();
            data.Add("activityID", tbActID.Text);

            System.Data.DataTable dt = DBConnection.runProcWithResults("getAllActivityOpinions", data);
            foreach (System.Data.DataRow item in dt.Rows)
            {
                System.Web.UI.HtmlControls.HtmlTableRow tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                tr.Attributes.Add("class", int.Parse(item["grade"].ToString()) > 5 ? "success" : "danger");
                System.Web.UI.HtmlControls.HtmlTableCell tc = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc.InnerText = item["talk"].ToString();
                tr.Controls.Add(tc);
                System.Web.UI.HtmlControls.HtmlTableCell tc1 = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc1.InnerText = item["grade"].ToString();
                tr.Controls.Add(tc1);
                opinionTable.Rows.Add(tr);
            }
        }
    }
 public void Add(HtmlTableRow row)
 {
 }
 public void Insert(int index, HtmlTableRow row)
 {
 }
예제 #50
0
        public void LoadHtmlTable()
        {
            System.Web.UI.HtmlControls.HtmlTable tblPivot = new System.Web.UI.HtmlControls.HtmlTable();
            tblPivot.CellPadding = 0;
            tblPivot.CellSpacing = 0;
            tblPivot.Width       = "100%";
            tblPivot.Height      = "100%";
            tblPivot.Attributes.Add("class", "tbl1_T");
            pnlPivot.Controls.Add(tblPivot);

            if (_report == null || _report.Cellset.IsValid == false)
            {
                return;
            }

            int Ax0MemCount = _report.Cellset.Axis0TupleMemCount;
            int Ax1MemCount = _report.Cellset.Axis1TupleMemCount;
            int Ax0PosCount = _report.Cellset.Axis0PosCount;
            int Ax1PosCount = _report.Cellset.Axis1PosCount;

            int ax0OrderPos = _report.GetOrderPosition(_report.Axes[0]);
            int ax1OrderPos = _report.GetOrderPosition(_report.Axes[1]);

            Hierarchy ax1Hier = null;
            Hierarchy ax0Hier = null;

            //table
            System.Web.UI.HtmlControls.HtmlTableRow  tr = null;
            System.Web.UI.HtmlControls.HtmlTableCell td = null;

            if (Ax0PosCount == 0 && Ax1PosCount == 0)
            {
                tr = new HtmlTableRow();
                tblPivot.Rows.Add(tr);
                td = new HtmlTableCell();
                tr.Cells.Add(td);
                td.Attributes.Add("class", "tbl1_err");
                td.Attributes.Add("nowrap", "true");
                td.InnerText = "Query successfully executed, cellset contains no data";
                return;
            }


            for (int i = 0; i < Ax0MemCount; i++)
            {
                tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                tblPivot.Rows.Add(tr);

                for (int j = 0; j < Ax1MemCount; j++)
                {
                    td = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.Attributes.Add("class", "tbl1_HC");
                    td.NoWrap = true;
                    tr.Cells.Add(td);

                    //hier controls in last row
                    if (i == Ax0MemCount - 1)
                    {
                        this.CreateHierControls(_report.Axes[1].Hierarchies[j], td);
                    }
                }

                ax0Hier = _report.Axes[0].Hierarchies[i];
                for (int j = 0; j < Ax0PosCount; j++)
                {
                    CellsetMember mem          = _report.Cellset.GetCellsetMember(0, i, j);
                    bool          inOrderTuple = false;

                    //if same as prev, continue
                    if (j != 0 && _report.Cellset.GetCellsetMember(0, i, j - 1).UniqueName == mem.UniqueName)
                    {
                        continue;
                    }

                    td        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.NoWrap = true;

                    // handle order position highlight
                    if (j == ax0OrderPos)                  // in order tuple
                    {
                        inOrderTuple = true;
                    }


                    // handle colspan
                    int spanCount = 1;
                    for (int n = j + 1; n < Ax0PosCount; n++)
                    {
                        CellsetMember nextMem = _report.Cellset.GetCellsetMember(0, i, n);
                        if (nextMem.UniqueName == mem.UniqueName)
                        {
                            spanCount++;

                            // handle order position highlight
                            if (n == ax0OrderPos)
                            {
                                inOrderTuple = true;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }

                    // handle order position highlight
                    if (inOrderTuple)                    // in order tuple
                    {
                        td.Attributes.Add("class", "tbl1_H3");
                    }
                    else
                    {
                        td.Attributes.Add("class", "tbl1_H2");
                    }

                    // if we span
                    if (spanCount > 1)
                    {
                        td.ColSpan = spanCount;
                    }


                    if (mem.ChildCount == 0)
                    {                     // leaf-level
                        System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                        img.Src = "../images/leaf.gif";
                        td.Controls.Add(img);
                    }

                    System.Web.UI.HtmlControls.HtmlInputCheckBox chb = new System.Web.UI.HtmlControls.HtmlInputCheckBox();
                    chb.ID = "m:" + _contr.IdentifierFromCellsetPosition(0, j, i);
                    chb.EnableViewState = false;
                    td.EnableViewState  = false;
                    td.Controls.Add(chb);

                    System.Web.UI.LiteralControl literal = new System.Web.UI.LiteralControl(mem.Name);
                    td.Controls.Add(literal);

                    tr.Cells.Add(td);
                }


                // hier controls in last col
                td = new System.Web.UI.HtmlControls.HtmlTableCell();
                td.Attributes.Add("class", "tbl1_HC");
                td.NoWrap = true;
                CreateHierControls(ax0Hier, td);
                tr.Cells.Add(td);
            }



            for (int i = 0; i < Ax1PosCount; i++)
            {
                tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                tblPivot.Rows.Add(tr);

                for (int j = 0; j < Ax1MemCount; j++)
                {
                    ax1Hier = _report.Axes[1].Hierarchies[j];
                    CellsetMember mem          = _report.Cellset.GetCellsetMember(1, j, i);
                    bool          inOrderTuple = false;

                    //if same as prev, continue
                    if (i != 0 && _report.Cellset.GetCellsetMember(1, j, i - 1).UniqueName == mem.UniqueName)
                    {
                        continue;
                    }

                    td        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.NoWrap = true;

                    // handle order position highlight
                    if (i == ax1OrderPos)                  // in order tuple
                    {
                        inOrderTuple = true;
                    }


                    // handle rowspan
                    int spanCount = 1;
                    for (int n = i + 1; n < Ax1PosCount; n++)
                    {
                        CellsetMember nextMem = _report.Cellset.GetCellsetMember(1, j, n);
                        if (nextMem.UniqueName == mem.UniqueName)
                        {
                            spanCount++;

                            // handle order position highlight
                            if (n == ax1OrderPos)
                            {
                                inOrderTuple = true;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }

                    // handle order position highlight
                    if (inOrderTuple)                    // in order tuple
                    {
                        td.Attributes.Add("class", "tbl1_H1");
                    }
                    else
                    {
                        td.Attributes.Add("class", "tbl1_H");
                    }

                    // if we span
                    if (spanCount > 1)
                    {
                        td.RowSpan = spanCount;
                    }



                    if (mem.ChildCount == 0)
                    {                     // leaf-level
                        System.Web.UI.HtmlControls.HtmlImage img = new System.Web.UI.HtmlControls.HtmlImage();
                        img.Src = "../images/leaf.gif";
                        td.Controls.Add(img);
                    }

                    System.Web.UI.HtmlControls.HtmlInputCheckBox chb = new System.Web.UI.HtmlControls.HtmlInputCheckBox();
                    chb.ID = "m:" + _contr.IdentifierFromCellsetPosition(1, i, j);
                    chb.EnableViewState = false;
                    td.EnableViewState  = false;
                    td.Controls.Add(chb);

                    System.Web.UI.LiteralControl literal = new System.Web.UI.LiteralControl(mem.Name);
                    td.Controls.Add(literal);


                    tr.Cells.Add(td);
                }

                for (int j = 0; j < Ax0PosCount; j++)
                {
                    td = new System.Web.UI.HtmlControls.HtmlTableCell();
                    td.Attributes.Add("class", "tbl1_C");
                    td.NoWrap = true;
                    Cell olapCell = _report.Cellset.GetCell(j, i);
                    td.InnerText = olapCell.FormattedValue;
                    tr.Cells.Add(td);
                }
            }
        }
 public void Remove(HtmlTableRow row)
 {
 }
예제 #52
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString.HasKeys())
        {
            string numTemplates = Request.QueryString["HD_NumberTemplates"];
            // Get the number of templates that remain to be uploaded.
            int.TryParse(numTemplates, out RemainingTemplates);

            // If this is the first time at the page, the number of remaining templates is the same as the total number of templates.
            if (string.IsNullOrEmpty(TotalTemplateCount.Value))
            {
                TotalTemplateCount.Value = RemainingTemplates.ToString();
                SuccessfulUploadItems.Clear();
                ConflictUploadItems.Clear();
                CanceledUploadItems.Clear();
            }
            TotalNumTemplates = int.Parse(TotalTemplateCount.Value);
        }

        UpdatePanelVisibility();

        if (RemainingTemplates > 0)
        {
            UploadedTemplatesGrid.Rows.Clear();


            for (int i = 0; i < GridSize; i++)
            {
                System.Web.UI.HtmlControls.HtmlTableRow  tr = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableCell tc;

                // Template Title
                tc       = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc.Width = "30%";
                TextBox templateTitle = new TextBox();
                templateTitle.ID       = string.Format("HD_Template_Title{0}", i.ToString());
                templateTitle.Rows     = 3;
                templateTitle.TextMode = TextBoxMode.MultiLine;
                tc.Controls.Add(templateTitle);
                tr.Controls.Add(tc);

                // Template Description
                tc       = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc.Width = "70%";
                TextBox templateDescription = new TextBox();
                templateDescription.ID       = string.Format("HD_Template_Description{0}", i.ToString());
                templateDescription.Rows     = 3;
                templateDescription.TextMode = TextBoxMode.MultiLine;
                tc.Controls.Add(templateDescription);
                tr.Controls.Add(tc);

                // Hidden controls
                tc = new System.Web.UI.HtmlControls.HtmlTableCell();
                tc.Style.Add("display", "none");

                // The upload item type can be a template, a file, or a URL. This field is utilized by HotDocs 11 (and later). The
                // Upload plugin for HotDocs 10 does not set this field.
                HiddenField uploadItemType = new HiddenField();
                uploadItemType.ID = "HD_Template_UploadItemType" + i;
                tc.Controls.Add(uploadItemType);

                // Main Template File Name
                HiddenField templateMain = new HiddenField();
                templateMain.ID = "HD_Template_FileName" + i;
                tc.Controls.Add(templateMain);

                HiddenField libraryPath = new HiddenField();
                libraryPath.ID = "HD_Template_Library_Path" + i;
                tc.Controls.Add(libraryPath);

                HiddenField expirationDate = new HiddenField();
                expirationDate.ID = "HD_Template_Expiration_Date" + i;
                tc.Controls.Add(expirationDate);

                HiddenField expirationWarningDays = new HiddenField();
                expirationWarningDays.ID = "HD_Template_Warning_Days" + i;
                tc.Controls.Add(expirationWarningDays);

                HiddenField expirationExtensionDays = new HiddenField();
                expirationExtensionDays.ID = "HD_Template_Extension_Days" + i;
                tc.Controls.Add(expirationExtensionDays);

                HiddenField commandLineSwitches = new HiddenField();
                commandLineSwitches.ID = "HD_Template_CommandLineSwitches" + i;
                tc.Controls.Add(commandLineSwitches);

                // Template package file upload control
                FileUpload ulCtrl = new FileUpload();
                ulCtrl.ID = string.Format("HD_Upload{0}", i.ToString());
                tc.Controls.Add(ulCtrl);

                // Template manifest file upload control
                FileUpload ulPackageManifestXML = new FileUpload();
                ulPackageManifestXML.ID = string.Format("HD_Package_Manifest{0}", i.ToString());
                tc.Controls.Add(ulPackageManifestXML);

                tr.Controls.Add(tc);

                UploadedTemplatesGrid.Rows.Add(tr);
            }

            if (GridSize > 1)
            {
                submitBtn.Text = string.Format("Upload Templates {0}-{1} of {2}", (TotalNumTemplates - RemainingTemplates) + 1, GridSize, TotalNumTemplates);
            }
            else
            {
                submitBtn.Text = string.Format("Upload Template {0} of {1}", (TotalNumTemplates - RemainingTemplates) + 1, TotalNumTemplates);
            }
        }

        if (Request.Files.Count > 0)
        {
            int templateIndex = 0;
            int fileIndex     = 0;
            while (fileIndex < Request.Files.Count)
            {
                HttpPostedFile postedFile = Request.Files[fileIndex];

                if (postedFile.ContentLength > 0 && !string.IsNullOrEmpty(postedFile.FileName))
                {
                    FileInfo finfo = new FileInfo(postedFile.FileName);
                    if (finfo.Extension.ToLower() != ".xml")
                    {
                        string ext          = Path.GetExtension(postedFile.FileName).ToLower();
                        string baseFileName = Path.GetFileNameWithoutExtension(postedFile.FileName);
                        // note: there are three possibilities here:
                        // 1) The fileName is a template package, formatted <guid>.pkg
                        // 2) The fileName is a url, formatted <guid>.url
                        // 3) The filename is a raw file, formatted with the a non-guid base file name and extension:
                        // Note: Here in this sample portal we ignore 2) and 3) because we are only concerned
                        // with uploading templates:
                        if (!IsGuid(baseFileName) || ext == ".url")
                        {
                            return;
                        }
                        string packageID   = baseFileName;
                        string packagePath = PackageCache.GetLocalPackagePath(packageID);
                        if (!string.IsNullOrEmpty(packageID))
                        {
                            FileStream fs = File.OpenWrite(packagePath);
                            postedFile.InputStream.CopyTo(fs);
                            fs.Close();

                            UploadItem infoItem = new UploadItem
                            {
                                Title                = Request.Form["HD_Template_Title" + templateIndex],
                                Description          = Request.Form["HD_Template_Description" + templateIndex],
                                MainTemplateFileName = Request.Form["HD_Template_FileName" + templateIndex],

                                /// LibraryPath is an optional field that is intended to give this portal an indication
                                /// of where the current template was stored in the user's HotDocs library on the desktop.
                                /// This Sample Portal application does not save this value, and it is included
                                /// here as sample code.
                                LibraryPath = Request.Form["HD_Library_Path" + templateIndex],

                                /// CommandLineSwitches is an optional field that contains any command line parameters
                                /// that were used for the current template with the desktop HotDocs software. This
                                /// Sample Portal application does not save this value, and it is included here
                                /// as sample code because these command line parameters may be of use.
                                CommandLineSwitches = Request.Form["HD_Template_CommandLineSwitches" + templateIndex],

                                /// ItemType can be an HD11+ template, a file, or a URL. HotDocs 11 (and later)
                                /// sets this field, and HotDocs 10 does not set this field.  The current
                                /// Asp.Net web app could distinguish between HotDocs 11 templates and HotDocs 10
                                /// templates by examining this field to be non-empty for HotDocs 11 and empty
                                /// for HotDocs 10. This Sample Portal application does not save this value,
                                /// and it is included here as sample code.
                                ItemType = Request.Form["HD_Template_UploadItemType" + templateIndex],

                                /// ExpirationDate is an optional field that gives publishers the option of specifying
                                /// a date when the current template will expire. This Sample Portal application
                                /// does not save this value, and it is included here as sample code.
                                ExpirationDate = Request.Form["HD_Template_Expiration_Date" + templateIndex],

                                /// ExpirationWarningDays is an optional field used in conjunction with ExpirationDate
                                /// that allows the user to be warned that the current template will expire the given
                                /// number of days before the expireation date. This Sample Portal application
                                /// does not save this value, and it is included here as sample code.
                                ExpirationWarningDays = Request.Form["HD_Template_Warning_Days" + templateIndex],

                                /// ExpirationExtensionDays is an optional field used in conjunction with ExpirationDate
                                /// that allows the user to continue using the current template after the given
                                /// expiration date has passed. This Sample Portal application does not save this
                                /// value, and it is included here as sample code.
                                ExpirationExtensionDays = Request.Form["HD_Template_Extension_Days" + templateIndex],
                                PackageID    = packageID,
                                FullFilePath = packagePath
                            };

                            using (SamplePortal.Data.Templates templates = new SamplePortal.Data.Templates())
                            {
                                if (templates.TemplateExists(infoItem.MainTemplateFileName, infoItem.Title))
                                {
                                    ConflictUploadItems.Add(infoItem);
                                }
                                else
                                {
                                    templates.InsertNewTemplate(infoItem);
                                    SuccessfulUploadItems.Add(infoItem);
                                }
                            }
                        }
                        templateIndex++;
                    }
                    else
                    {
                        string     filename = Path.Combine(Settings.TemplatePath, finfo.Name);
                        FileStream fs       = File.OpenWrite(filename);
                        postedFile.InputStream.CopyTo(fs);
                        fs.Close();
                    }
                    fileIndex++;
                }
                else
                {
                    panelHDError.Visible = true;
                    break;
                }
            }
            UpdatePanelVisibility();
        }
    }
예제 #53
0
        public void Add_Movie_Cart(Movie movie, int array_seq)
        {
            System.Web.UI.HtmlControls.HtmlTableRow  r  = new System.Web.UI.HtmlControls.HtmlTableRow();
            System.Web.UI.HtmlControls.HtmlTableCell c1 = new System.Web.UI.HtmlControls.HtmlTableCell();

            HtmlGenericControl figure = new HtmlGenericControl("figure");

            figure.Attributes.Add("class", "media");

            HtmlGenericControl div_img_wrap = new HtmlGenericControl("div");

            div_img_wrap.Attributes.Add("class", "img-wrap");

            Image cell_image = new Image();

            cell_image.ImageUrl = movie.MovieUrl;
            cell_image.CssClass = "img-thumbnail img-sm";
            cell_image.Width    = 90;
            cell_image.Height   = 120;
            div_img_wrap.Controls.Add(cell_image);

            HtmlGenericControl div_media_body = new HtmlGenericControl("div");

            div_media_body.Attributes.Add("class", "media-body");

            Label cell_label_title = new Label();

            cell_label_title.Text     = movie.Title;
            cell_label_title.CssClass = "title text-truncate";
            div_media_body.Controls.Add(cell_label_title);

            figure.Controls.Add(div_img_wrap);
            figure.Controls.Add(div_media_body);

            c1.Controls.Add(figure);

            r.Cells.Add(c1);

            System.Web.UI.HtmlControls.HtmlTableCell c2 = new System.Web.UI.HtmlControls.HtmlTableCell();

            HtmlGenericControl div_price_wrap_1 = new HtmlGenericControl("div");

            div_price_wrap_1.Attributes.Add("class", "price-wrap");

            Label cell_label_writer = new Label();

            cell_label_writer.Text     = movie.Writer;
            cell_label_writer.CssClass = "title text-truncate";
            div_price_wrap_1.Controls.Add(cell_label_writer);

            c2.Controls.Add(div_price_wrap_1);

            r.Cells.Add(c2);

            System.Web.UI.HtmlControls.HtmlTableCell c3 = new System.Web.UI.HtmlControls.HtmlTableCell();

            HtmlGenericControl div_price_wrap_2 = new HtmlGenericControl("div");

            div_price_wrap_2.Attributes.Add("class", "price-wrap");

            Label cell_label_director = new Label();

            cell_label_director.Text     = movie.Director;
            cell_label_director.CssClass = "title text-truncate";
            div_price_wrap_2.Controls.Add(cell_label_director);

            c3.Controls.Add(div_price_wrap_2);

            r.Cells.Add(c3);

            System.Web.UI.HtmlControls.HtmlTableCell c4 = new System.Web.UI.HtmlControls.HtmlTableCell();

            HtmlGenericControl div_price_wrap_3 = new HtmlGenericControl("div");

            div_price_wrap_3.Attributes.Add("class", "price-wrap");

            Label cell_label_year = new Label();

            cell_label_year.Text     = movie.Year.ToString();
            cell_label_year.CssClass = "title text-truncate";
            div_price_wrap_3.Controls.Add(cell_label_year);

            c4.Controls.Add(div_price_wrap_3);

            r.Cells.Add(c4);

            System.Web.UI.HtmlControls.HtmlTableCell c5 = new System.Web.UI.HtmlControls.HtmlTableCell();

            HtmlGenericControl div_price_wrap_4 = new HtmlGenericControl("div");

            div_price_wrap_4.Attributes.Add("class", "price-wrap text-right");

            Button cell_delete_button = new Button();

            cell_delete_button.Text     = "Remove";
            cell_delete_button.CssClass = "btn btn-outline-danger";
            cell_delete_button.ID       = "Button" + array_seq.ToString();
            cell_delete_button.Click   += btn_delete_Click;
            div_price_wrap_4.Controls.Add(cell_delete_button);

            c5.Controls.Add(div_price_wrap_4);

            r.Cells.Add(c5);

            Panel_element.Controls.Add(r);


            //HtmlGenericControl div_go_default = new HtmlGenericControl("div");
            //Button btn_go_default = new Button();
            //btn_go_default.Text = "Return To Main Page";
            //btn_go_default.ID = "btn_go_default";
            //btn_go_default.CssClass = "btn btn-outline-info btn-lg btn-block";
            //btn_go_default.Click += btn_go_default_Click;


            //div_go_default.Controls.Add(btn_go_default);

            //Panel_Cart.Controls.Add(div_go_default);
        }
예제 #54
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BusinessObjects.Person person = new BusinessObjects.Person(1);

            litPersonID.Text  = person.ID.ToString();
            litTitle.Text     = person.Title;
            litFirstName.Text = person.FirstName;
            litLastName.Text  = person.LastName;

            if (person.Addresses.Count > 0)
            {
                System.Web.UI.HtmlControls.HtmlTable    addressTable    = new System.Web.UI.HtmlControls.HtmlTable();
                System.Web.UI.HtmlControls.HtmlTableRow addressIDRow    = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableRow addressDataRow  = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableRow addressDataRow2 = new System.Web.UI.HtmlControls.HtmlTableRow();


                System.Web.UI.HtmlControls.HtmlTableCell addressIDLabelCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str1LabelCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str2LabelCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell citLabelCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell stLabelCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell zLabelCell         = new System.Web.UI.HtmlControls.HtmlTableCell();

                System.Web.UI.HtmlControls.HtmlTableCell addressIDLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str1LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell str2LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell citLiteralCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell stLiteralCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                System.Web.UI.HtmlControls.HtmlTableCell zLiteralCell         = new System.Web.UI.HtmlControls.HtmlTableCell();


                Label   lblAddID = new Label();
                Literal litAddID = new Literal();
                Label   lblStr1  = new Label();
                Literal litStr1  = new Literal();
                Label   lblStr2  = new Label();
                Literal litStr2  = new Literal();
                Label   lblCit   = new Label();
                Literal litCit   = new Literal();
                Label   lblSt    = new Label();
                Literal litSt    = new Literal();
                Label   lblZ     = new Label();
                Literal litZ     = new Literal();

                lblAddID.Text = "Address ID: ";
                lblStr1.Text  = "Street 1: ";
                lblStr2.Text  = "Street 2: ";
                lblCit.Text   = "City: ";
                lblSt.Text    = "State: ";
                lblZ.Text     = "Zip: ";
                int i = 0;
                litAddID.Text = person.Addresses[i].AddressID.ToString();
                litStr1.Text  = person.Addresses[i].Street1.ToString();
                litStr2.Text  = person.Addresses[i].Street2.ToString();
                litCit.Text   = person.Addresses[i].City.ToString();
                litSt.Text    = person.Addresses[i].State.ToString();
                litZ.Text     = person.Addresses[i].Zip.ToString();


                addressIDLabelCell.Controls.Add(lblAddID);  //the addressIDLabelCell
                addressIDLiteralCell.Controls.Add(litAddID);
                str1LabelCell.Controls.Add(lblStr1);
                // str1LiteralCell.Controls.Add(litStr1);
                str2LabelCell.Controls.Add(lblStr2);
                //   str2LiteralCell.Controls.Add(litStr2);
                citLabelCell.Controls.Add(lblCit);
                // citLiteralCell.Controls.Add(litCit);
                stLabelCell.Controls.Add(lblSt);
                //  stLiteralCell.Controls.Add(litSt);
                zLabelCell.Controls.Add(lblZ);
                //  zLiteralCell.Controls.Add(litZ);

                //This is what displays the labels on the first row. AddressID, Street, Street, City, State, Zip
                addressTable.Rows.Add(addressIDRow);
                addressIDRow.Cells.Add(addressIDLabelCell);
                addressIDRow.Cells.Add(str1LabelCell);
                addressIDRow.Cells.Add(str2LabelCell);
                addressIDRow.Cells.Add(citLabelCell);
                addressIDRow.Cells.Add(stLabelCell);
                addressIDRow.Cells.Add(zLabelCell);


                foreach (BusinessObjects.PersonAddress personAddresses in person.Addresses)
                {
                    //69 to 99 on webform 3
                    addressDataRow       = new HtmlTableRow();
                    addressIDLiteralCell = new System.Web.UI.HtmlControls.HtmlTableCell();
                    str1LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                    str2LiteralCell      = new System.Web.UI.HtmlControls.HtmlTableCell();
                    citLiteralCell       = new System.Web.UI.HtmlControls.HtmlTableCell();
                    stLiteralCell        = new System.Web.UI.HtmlControls.HtmlTableCell();
                    zLiteralCell         = new System.Web.UI.HtmlControls.HtmlTableCell();

                    litAddID.Text = person.Addresses[i].AddressID.ToString();
                    litStr1.Text  = person.Addresses[i].Street1.ToString();
                    litStr2.Text  = person.Addresses[i].Street2.ToString();
                    litCit.Text   = person.Addresses[i].City.ToString();
                    litSt.Text    = person.Addresses[i].State.ToString();
                    litZ.Text     = person.Addresses[i].Zip.ToString();

                    addressIDLiteralCell.Controls.Add(litAddID);
                    //str1LabelCell.Controls.Add(lblStr1);
                    str1LiteralCell.Controls.Add(litStr1);
                    //str2LabelCell.Controls.Add(lblStr2);
                    str2LiteralCell.Controls.Add(litStr2);
                    //citLabelCell.Controls.Add(lblCit);
                    citLiteralCell.Controls.Add(litCit);
                    // stLabelCell.Controls.Add(lblSt);
                    stLiteralCell.Controls.Add(litSt);
                    // zLabelCell.Controls.Add(lblZ);
                    zLiteralCell.Controls.Add(litZ);

                    addressDataRow.Cells.Add(addressIDLiteralCell);
                    addressDataRow.Cells.Add(str1LiteralCell);

                    addressDataRow.Cells.Add(str2LiteralCell);
                    addressDataRow.Cells.Add(citLiteralCell);
                    addressDataRow.Cells.Add(stLiteralCell);
                    addressDataRow.Cells.Add(zLiteralCell);

                    addressTable.Rows.Add(addressDataRow);


                    Page.Form.Controls.Add(addressTable);
                    this.Controls.Add(addressTable);
                }
            }
        }
예제 #55
0
        private void CreateCalendarControls()
        {
            // Finding date to start on
            DateTime idxDate = FindStartDate();

            // Creating table to wrap the whole thing inside of
            HTML.HtmlTable tbl = new HTML.HtmlTable();
            tbl.EnableViewState = false;
            tbl.ID = "tbl_" + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);

            // Creating the header row which contains the Year and Month DropDownLists
            CreateYearMonthPicker(tbl);

            // Creating Weekdays at top of calendar
            idxDate = CreateWeekDaysAtTop(idxDate, tbl);

            // Looping through creating childcontrols
            while (true)
            {
                HTML.HtmlTableRow row = new HTML.HtmlTableRow();
                row.EnableViewState = false;
                row.ID = idxDate.ToString("MM_dd", System.Globalization.CultureInfo.InvariantCulture) + Value.ToString("dd_MM_yyyy", System.Globalization.CultureInfo.InvariantCulture);

                idxDate = CreateWeekNumberCell(idxDate, row);

                // Creating week cells for actual dates...
                for (int idx = 0; idx < 7; idx++)
                {
                    idxDate = CreateOneDayCell(idxDate, row);
                }
                tbl.Rows.Add(row);
                if (idxDate.Month != Value.Month)
                {
                    break;
                }
            }

            // Creating "extra controls" to append at bottom
            if (CreateFooterControls != null)
            {
                CreateFooterControlsEventArgs evt = new CreateFooterControlsEventArgs();
                CreateFooterControls(this, evt);
                int idxNo = 0;
                foreach (ASP.Control idx in evt.Controls)
                {
                    HTML.HtmlTableRow row = new HTML.HtmlTableRow();
                    row.ID = "extraRow" + idxNo;
                    HTML.HtmlTableCell cell = new HTML.HtmlTableCell();
                    cell.ID      = "extraCell" + idxNo;
                    cell.ColSpan = 8;
                    cell.Controls.Add(idx);
                    row.Cells.Add(cell);
                    tbl.Rows.Add(row);
                    idxNo += 1;
                }
            }

            // Today button...
            CreateTodayButton(tbl);

            // Rooting the Table as the LAST thing we do...!
            _content.Controls.Add(tbl);
        }
예제 #56
0
 /// <devdoc>
 ///    <para>
 ///       Adds the specified HtmlTableRow control to the end of the collection.
 ///    </para>
 /// </devdoc>
 public void Add(HtmlTableRow row)
 {
     Insert(-1, row);
 }
예제 #57
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(Index), this.Page);
        LotteryID = 5;
        if (!IsPostBack)
        {
            int Logout = Shove._Convert.StrToInt(this.Request.QueryString["Logout"], -1);
            if (Logout != -1)
            {
                imgbtnLogout_Click(this.Page, new EventArgs());
            }

            BindDataForFlash();
            GetFCExpertList();
            BindWinList();
            BinddTEndIsuses();
            BindDataGetFuCaiWinNumber();
            BindDataGetTiCaiWinNumber();
            BindDataGetZuCaiWinNumber();
            GetFocusNews();
            GetSiteAffiches();

            RepFuCai.DataSource = GetNews("福彩资讯");
            RepFuCai.DataBind();
            RepTiCai.DataSource = GetNews("体彩资讯");
            RepTiCai.DataBind();

            JoinBuyData();
            BigJoinBuyData();
            FootBallJoinBuyData();
            tdLuckNumber.InnerHtml = InitLuckLotteryNumber();

            bool Opt_isUseCheckCode = _Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
            if (Opt_isUseCheckCode)
            {
                System.Web.UI.HtmlControls.HtmlTableRow textCheckCodeHidden = tbLogin1.FindControl("textCheckCodeHidden") as System.Web.UI.HtmlControls.HtmlTableRow;
                textCheckCodeHidden.Visible = true;
            }
            else
            {
                textCheckCodeHidden.Visible = false;
            }
            if (_User != null)
            {
                tbLogin1.Visible = false;
                tbLogin2.Visible = true;
                lbUserName.Text  = _User.Name + ",您好!";
                if (_User.Competences.CompetencesList != "")
                {
                    lbUserType.Text = "级别:管理员";
                }
                else
                {
                    switch (_User.UserType)
                    {
                    case 1:
                        lbUserType.Text = "级别:普通";
                        break;

                    case 2:
                        lbUserType.Text = "级别:高级";
                        break;
                    }
                }
                string UseLotteriesList = DAL.Functions.F_GetExpertsLotteryList(_Site.ID, _User.ID);
                if (UseLotteriesList != "")
                {
                    lbUserType.Text += "(专家)";
                }
            }
            else
            {
                tbLogin1.Visible = true;
                tbLogin2.Visible = false;
            }
        }
    }
예제 #58
0
 /// <devdoc>
 ///    <para>
 ///       Deletes the specified <see langword='HtmlTableRow'/>
 ///       control
 ///       from the collection.
 ///    </para>
 /// </devdoc>
 public void Remove(HtmlTableRow row)
 {
     owner.Controls.Remove(row);
 }
예제 #59
0
 /// <devdoc>
 ///    <para>
 ///       Adds an <see langword='HtmlTableRow'/> control to a specified
 ///       location in the collection.
 ///    </para>
 /// </devdoc>
 public void Insert(int index, HtmlTableRow row)
 {
     owner.Controls.AddAt(index, row);
 }
예제 #60
0
    /// <summary>
    /// Loads the LeadQualification entities and displays the corresponding data for the current Lead.
    /// </summary>
    protected void LoadLeadQualifications()
    {
        ILead lead = GetCurrentLead();
        IQualificationCategory currentCategory = null;

        if (lead != null)
        {
            currentCategory = lead.QualificationCategory;
        }
        if (currentCategory == null)
        {
            /* Set the list to the first category?...or the last selected category? */
            ListItem selected_item = cboQualifications.SelectedItem;
            if (selected_item != null)
            {
                currentCategory = EntityFactory.GetById <IQualificationCategory>(selected_item.Value);
            }
        }
        else
        {
            ListItem item;
            item = cboQualifications.Items.FindByValue(currentCategory.Id.ToString());
            if (item != null)
            {
                cboQualifications.SelectedValue = item.Value;
            }
        }
        ILeadQualification         lead_qual;
        IList <IQualification>     qualifications      = GetQualifications(currentCategory);
        IList <ILeadQualification> lead_qualifications = GetLeadQualifications(currentCategory, qualifications, lead);
        string strChkStyle;
        string strTxtStyle;
        string strNotes;
        bool   bChecked;
        bool   bShowNotes;
        bool   bVisible;
        string qualId;
        int    sortPos;
        string desc;

        for (int i = 0; i < 8; i++)
        {
            if (i < qualifications.Count)
            {
                IQualification qual = qualifications[i];

                bVisible = qual.Visible.HasValue ? qual.Visible.Value : false;
                if (bVisible)
                {
                    lead_qual = FindLeadQualification(qual, lead_qualifications);
                    bChecked  = (lead_qual != null)
                                   ? (lead_qual.Checked.HasValue ? lead_qual.Checked.Value : false)
                                   : false;
                    strNotes   = (lead_qual != null) ? lead_qual.Notes : string.Empty;
                    bShowNotes = qual.ShowNotes.HasValue ? qual.ShowNotes.Value : false;

                    strChkStyle = (bVisible) ? string.Empty : cDisplayNone;
                    strTxtStyle = (bShowNotes) ? string.Empty : cDisplayNone;
                    qualId      = qual.Id.ToString();
                    sortPos     = qual.SortPosition.Value;
                    desc        = qual.Description;
                    System.Web.UI.HtmlControls.HtmlTableRow container = (System.Web.UI.HtmlControls.HtmlTableRow) this.FindControl("container" + (i + 1));
                    container.Style[HtmlTextWriterStyle.Display] = "table-row";
                }
                else
                {
                    System.Web.UI.HtmlControls.HtmlTableRow container = (System.Web.UI.HtmlControls.HtmlTableRow) this.FindControl("container" + (i + 1));
                    container.Style[HtmlTextWriterStyle.Display] = "None";
                    continue;
                }
            }
            else
            {
                System.Web.UI.HtmlControls.HtmlTableRow container = (System.Web.UI.HtmlControls.HtmlTableRow) this.FindControl("container" + (i + 1));
                container.Style[HtmlTextWriterStyle.Display] = "None";
                continue;
            }

            switch (sortPos)
            {
            case 1:
                chkQualificationSelected1.Style.Value    = strChkStyle;
                chkQualificationSelected1.Checked        = bChecked;
                chkQualificationSelected1_lz.Style.Value = strChkStyle;
                txtQualificationDescription1.Style.Value = strTxtStyle;
                txtQualificationDescription1.Text        = strNotes;
                chkQualificationSelected1_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected1, txtQualificationDescription1, qualId);
                break;

            case 2:
                chkQualificationSelected2.Style.Value    = strChkStyle;
                chkQualificationSelected2.Checked        = bChecked;
                chkQualificationSelected2_lz.Style.Value = strChkStyle;
                txtQualificationDescription2.Style.Value = strTxtStyle;
                txtQualificationDescription2.Text        = strNotes;
                chkQualificationSelected2_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected2, txtQualificationDescription2, qualId);
                break;

            case 3:
                chkQualificationSelected3.Style.Value    = strChkStyle;
                chkQualificationSelected3.Checked        = bChecked;
                chkQualificationSelected3_lz.Style.Value = strChkStyle;
                txtQualificationDescription3.Style.Value = strTxtStyle;
                txtQualificationDescription3.Text        = strNotes;
                chkQualificationSelected3_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected3, txtQualificationDescription3, qualId);
                break;

            case 4:
                chkQualificationSelected4.Style.Value    = strChkStyle;
                chkQualificationSelected4.Checked        = bChecked;
                chkQualificationSelected4_lz.Style.Value = strChkStyle;
                txtQualificationDescription4.Style.Value = strTxtStyle;
                txtQualificationDescription4.Text        = strNotes;
                chkQualificationSelected4_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected4, txtQualificationDescription4, qualId);
                break;

            case 5:
                chkQualificationSelected5.Style.Value    = strChkStyle;
                chkQualificationSelected5.Checked        = bChecked;
                chkQualificationSelected5_lz.Style.Value = strChkStyle;
                txtQualificationDescription5.Style.Value = strTxtStyle;
                txtQualificationDescription5.Text        = strNotes;
                chkQualificationSelected5_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected5, txtQualificationDescription5, qualId);
                break;

            case 6:
                chkQualificationSelected6.Style.Value    = strChkStyle;
                chkQualificationSelected6.Checked        = bChecked;
                chkQualificationSelected6_lz.Style.Value = strChkStyle;
                txtQualificationDescription6.Style.Value = strTxtStyle;
                txtQualificationDescription6.Text        = strNotes;
                chkQualificationSelected6_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected6, txtQualificationDescription6, qualId);
                break;

            case 7:
                chkQualificationSelected7.Style.Value    = strChkStyle;
                chkQualificationSelected7.Checked        = bChecked;
                chkQualificationSelected7_lz.Style.Value = strChkStyle;
                txtQualificationDescription7.Style.Value = strTxtStyle;
                txtQualificationDescription7.Text        = strNotes;
                chkQualificationSelected7_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected7, txtQualificationDescription7, qualId);
                break;

            case 8:
                chkQualificationSelected8.Style.Value    = strChkStyle;
                chkQualificationSelected8.Checked        = bChecked;
                chkQualificationSelected8_lz.Style.Value = strChkStyle;
                txtQualificationDescription8.Style.Value = strTxtStyle;
                txtQualificationDescription8.Text        = strNotes;
                chkQualificationSelected8_lz.Text        = desc;
                AddQualficationIdAttributeTo(chkQualificationSelected8, txtQualificationDescription8, qualId);
                break;

            default:
                System.Web.UI.HtmlControls.HtmlTableRow container = (System.Web.UI.HtmlControls.HtmlTableRow) this.FindControl("container" + i);
                container.Visible = false;
                break;
            }
        }
    }