Esempio n. 1
0
        protected void SummaryReportGridView_OnDataBound(object sender, EventArgs e)
        {
            GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
            TableHeaderCell cell = new TableHeaderCell();
            cell.Text = "";
            cell.ColumnSpan = 2;
            row.Controls.Add(cell);

            row.BackColor = ColorTranslator.FromHtml("#9e1b34");
            row.ForeColor = ColorTranslator.FromHtml("White");

            SummaryReportGridView.Rows[7].Style.Add(HtmlTextWriterStyle.FontWeight, "Bold");

            row.HorizontalAlign = HorizontalAlign.Center;

            foreach (GridViewRow row2 in SummaryReportGridView.Rows)
            {
                LinkButton lb = (LinkButton)row2.Cells[0].Controls[0];
                lb.ForeColor = ColorTranslator.FromHtml("#0000EE");

            }

            LinkButton lb2 = (LinkButton)SummaryReportGridView.Rows[7].Cells[0].Controls[0];
            lb2.Enabled = false;
            lb2.ControlStyle.Font.Underline = false;
            lb2.ForeColor = ColorTranslator.FromHtml("Black");
            lb2.ControlStyle.Font.Bold = true;
        }
Esempio n. 2
0
        public static void BindGrid(this GridView grid, object dataSource, string emptyText)
        {
            grid.DataSource = dataSource;
            grid.DataBind();

            if (grid.Rows.Count == 0)
            {
                var table = new Table();
                table.CssClass = grid.CssClass;
                var tr = new TableHeaderRow();
                foreach (DataControlField column in grid.Columns)
                {
                    if (column.Visible)
                    {
                        var th = new TableHeaderCell();
                        th.Width = column.HeaderStyle.Width;
                        th.Text = column.HeaderText;
                        tr.Controls.Add(th);
                    }
                }
                table.Controls.Add(tr);
                if (!string.IsNullOrEmpty(emptyText))
                {
                    var emptyRow = new TableRow();
                    var emptyCell = new TableCell();
                    emptyCell.CssClass = "empty";
                    emptyCell.ColumnSpan = tr.Controls.Count;
                    emptyCell.Text = emptyText;
                    emptyRow.Controls.Add(emptyCell);
                    table.Controls.Add(emptyRow);
                }
                grid.Parent.Controls.Add(table);
            }
        }
Esempio n. 3
0
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here


			base.GHTTestBegin((HtmlForm)this.FindControl("Form1"));

			try 
			{
				base.GHTSubTestBegin("TableHeaderCell");
				base.GHTActiveSubTest.Controls.Add(Table1);

				// Create a header for the table.
				System.Web.UI.WebControls.TableHeaderCell header = new System.Web.UI.WebControls.TableHeaderCell();
				header.Text = "Table of (x,y) Values";

				// Add the header row to the table.
				Table1.Rows.AddAt(0, new TableRow());
				Table1.Rows[0].Cells.Add(header);
			}
			catch (Exception ex) 
			{
				base.GHTSubTestUnexpectedExceptionCaught(ex);
			}
			base.GHTSubTestEnd();
			base.GHTTestEnd();

		}
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlDataSource sds = DatabaseManager.CreateSQLDataSource("SELECT INS_REQ_ID รหัส,PS_CITIZEN_ID รหัสบัตรประชาชน,INS_GRADEINSIGNIA_ID ลำดับเครื่องราช,REQ_DATE วันที่ขอ,STATE สถานะการขอ FROM INSG_REQUEST ");
            GridView1.DataSource = sds;
            GridView1.DataBind();

            Util.NormalizeGridViewDate(GridView1, 3);

            TableHeaderCell newHeader = new TableHeaderCell();
            newHeader.Text = "เลือก";
            GridView1.HeaderRow.Cells.Add(newHeader);

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

                string id = GridView1.Rows[i].Cells[0].Text;
                Form1Package f1 = DatabaseManager.GetForm1Package(id);

                LinkButton lbu = new LinkButton();
                lbu.Text = "เลือก";
                lbu.CssClass = "ps-button";
                lbu.Click += (e2, e3) =>
                {
                    MultiView1.ActiveViewIndex = 1;
                };
                TableCell cell = new TableCell();
                cell.Controls.Add(lbu);
                GridView1.Rows[i].Cells.Add(cell);
            }
        }
Esempio n. 5
0
        private TableHeaderCell GetHeaderCell(string innerText, string AssociatedControlId, bool alignRight, int width)
        {
            using (TableHeaderCell header = new TableHeaderCell())
            {
                if (alignRight)
                {
                    header.Attributes.Add("class", "text-right");
                }

                if (width > 0)
                {
                    header.Attributes.Add("style", "width:" + width.ToString(CultureInfo.InvariantCulture) + "px;");
                }

                if (string.IsNullOrWhiteSpace(AssociatedControlId))
                {
                    header.Text = innerText;
                }
                else
                {
                    using (HtmlGenericControl label = new HtmlGenericControl())
                    {
                        label.TagName = "label";
                        label.Attributes.Add("for", AssociatedControlId);
                        label.InnerText = innerText;

                        header.Controls.Add(label);
                    }
                }

                return header;
            }
        }
Esempio n. 6
0
        protected void fillButtons()
        {
            // Create the row
            // We are going to use one row only
            TableRow row = new TableRow();

            // Create the cells
            TableHeaderCell addRecordsCell = new TableHeaderCell();
            TableHeaderCell addTimeOffCell = new TableHeaderCell();
            TableHeaderCell addIncomeCell = new TableHeaderCell();
            TableHeaderCell addDocumentCell = new TableHeaderCell();

            // Add the links to cells Text
            addRecordsCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddRecord.aspx?id="+employee.Id+"'><i class='icon-pencil icon-white'></i> Add a Record</a>";
            addTimeOffCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddTimeOff.aspx?id=" + employee.Id + "'><i class='icon-calendar icon-white'></i> Add a Time Off</a>";
            addIncomeCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddIncome.aspx?id=" + employee.Id + "'><i class='icon-plus icon-white'></i> Add an Income</a>";
            addDocumentCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddDocument.aspx?id=" + employee.Id + "'><i class='icon-folder-open icon-white'></i> Add a Document</a>";

            // Add the cells to the row
            row.Cells.Add(addRecordsCell);
            row.Cells.Add(addTimeOffCell);
            row.Cells.Add(addIncomeCell);
            row.Cells.Add(addDocumentCell);

            // Add the row to the table
            ButtonsTable.Rows.Add(row);

            // Add the bootstrap table class to the table
            ButtonsTable.CssClass = "table centerTD no-border-table buttons-table";
        }
        private void BuildCampaignsTable()
        {
            TableHeaderCell hCell = null;
            TableHeaderRow hRow = null;

            this.campaignsTable.Rows.Clear();

            hRow = new TableHeaderRow();

            hCell = new TableHeaderCell();
            hCell.Text = "Id";
            hCell.ID = "campaignIdHeaderTH";
            hCell.CssClass = "EditorTableHeaders";
            hRow.Cells.Add(hCell);

            hCell = new TableHeaderCell();
            hCell.Text = "Description";
            hCell.ID = "campaignDescriptionHeaderTH";
            hCell.CssClass = "EditorTableHeaders";
            hRow.Cells.Add(hCell);

            hCell = new TableHeaderCell();
            hCell.Text = "Status";
            hCell.ID = "statusHeaderTH";
            hCell.CssClass = "EditorTableHeaders";
            hRow.Cells.Add(hCell);

            this.campaignsTable.Rows.Add(hRow);

            this.countLabel.Text = "Campaign Schedules Found: 0";

            this.campaignsTable.Attributes.Add("class", "sortable EditorTables");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            List<Models.CallType> allCallTypes = CallTypeController.getAllCallTypes();
            TableRow headerRow = new TableRow();

            TableHeaderCell header = new TableHeaderCell();
            header.Text = "ID";
            headerRow.Cells.Add(header);

            header = new TableHeaderCell();
            header.Text = "Call Type";
            headerRow.Cells.Add(header);

            this.callTypeResultsTable.Rows.Add(headerRow);

            foreach (Models.CallType aType in allCallTypes)
            {
                TableRow row = new TableRow();
                TableCell cellId = new TableCell();
                TableCell cellText = new TableCell();

                cellId.Text = aType.Id.ToString();
                cellText.Text = aType.CallType1;
                row.Cells.Add(cellId);
                row.Cells.Add(cellText);
                this.callTypeResultsTable.Rows.Add(row);
            }
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            for (int rowCount = 0; rowCount < brochure.Length; rowCount++) {
                TableRow row = new TableRow();
                row.ID = "row" + rowCount;
                table1.Rows.Add(row);
                for (int colCount = 0; colCount < 2; colCount++) {
                    TableCell cell = new TableCell();
                    cell.ID = String.Format("cell {0}{1}", rowCount, colCount);
                    row.Cells.Add(cell);
                    if (colCount == 0) {
                        Label label = new Label();
                        label.ID = String.Format("label{0}{1}", rowCount, colCount);
                        label.Text = brochure[rowCount];
                        cell.Controls.Add(label);
                    }
                    else {
                        TextBox textBox = new TextBox();
                        textBox.ID = String.Format("textBox{0}{1}", rowCount, colCount);
                        Debug.WriteLine(textBox.ID);
                        cell.Controls.Add(textBox);
                    }

                }

            }
            TableHeaderRow tableHeader = new TableHeaderRow();
            TableHeaderCell cell1 = new TableHeaderCell();
            TableHeaderCell cell2 = new TableHeaderCell();
            cell1.Text = "Brochure";
            cell2.Text = "Antal";
            tableHeader.Cells.Add(cell1);
            tableHeader.Cells.Add(cell2);
            table1.Rows.AddAt(0, tableHeader);
        }
Esempio n. 10
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here


            base.GHTTestBegin((HtmlForm)this.FindControl("Form1"));

            try
            {
                base.GHTSubTestBegin("TableHeaderCell");
                base.GHTActiveSubTest.Controls.Add(Table1);

                // Create a header for the table.
                System.Web.UI.WebControls.TableHeaderCell header = new System.Web.UI.WebControls.TableHeaderCell();
                header.Text = "Table of (x,y) Values";

                // Add the header row to the table.
                Table1.Rows.AddAt(0, new TableRow());
                Table1.Rows[0].Cells.Add(header);
            }
            catch (Exception ex)
            {
                base.GHTSubTestUnexpectedExceptionCaught(ex);
            }
            base.GHTSubTestEnd();
            base.GHTTestEnd();
        }
 private static TableCell AddHeaderCell(TableRow trow, string text)
 {
     TableHeaderCell cell = new TableHeaderCell {
         Text = text
     };
     trow.Cells.Add(cell);
     return cell;
 }
Esempio n. 12
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Request.Cookies["UserSettings"] != null)
            {
                if (Request.Cookies["UserSettings"]["Name"] != null)
                    linkBtnUsername.Text = Request.Cookies["UserSettings"]["Name"];
                else
                    Response.Redirect("login.aspx");
            }
            else
                Response.Redirect("login.aspx");

            if (Session["userID"] == null)
                Response.Redirect("board.aspx");

            List<string> results = (List<string>)Session["links"];
            TableHeaderRow thr = new TableHeaderRow();
            TableHeaderCell thc = new TableHeaderCell();
            TableHeaderCell thc1 = new TableHeaderCell();
            TableHeaderCell thc2 = new TableHeaderCell();
            TableHeaderCell thc3 = new TableHeaderCell();
            thr.Cells.Add(thc);
            thc.Text = "Title";
            thr.Cells.Add(thc1);
            thc1.Text = "Start Date";
            thr.Cells.Add(thc2);
            thc2.Text = "End Date";
            thr.Cells.Add(thc3);
            thc3.Text = "Assignee";

            TableSearchResults.Rows.Add(thr);
            foreach (string li in results)
            {
                TableRow tr = new TableRow();

                string[] str = li.Split('+');
                TableCell tc = new TableCell();
                TableCell tc1 = new TableCell();
                TableCell tc2 = new TableCell();
                TableCell tc3 = new TableCell();

                tc.Text = str[0];
                tc1.Text = str[1];
                tc2.Text = str[2];
                tc3.Text = str[3];

                tr.Cells.Add(tc);
                tr.Cells.Add(tc1);
                tr.Cells.Add(tc2);
                tr.Cells.Add(tc3);

                TableSearchResults.Rows.Add(tr);
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!CtoF.Checked && !FtoC.Checked || CtoF.Checked && FtoC.Checked) {
                ModelState.AddModelError(String.Empty,
                    "Välj konvertering från Celsius till Fahrenheit eller från Fahrenheit till Celsius");
            }

            if (IsValid) {
                var start = int.Parse(Start.Text);
                var end = int.Parse(End.Text);
                var step = int.Parse(Step.Text);

                var thead = new TableHeaderRow();
                var theadC = new TableHeaderCell {
                    Text = "&deg;C"
                };
                var theadF = new TableHeaderCell {
                    Text = "&deg;F"
                };

                if (CtoF.Checked) {
                    thead.Cells.Add(theadC);
                    thead.Cells.Add(theadF);
                } else {
                    thead.Cells.Add(theadF);
                    thead.Cells.Add(theadC);
                }

                Table.Rows.Add(thead);

                for (int temp = start; temp <= end; temp += step) {
                    var trow = new TableRow();
                    trow.Cells.Add(new TableCell {
                        Text = temp.ToString()
                    });

                    if (CtoF.Checked) {
                        trow.Cells.Add(new TableCell {
                            Text = TemperatureConverter.CelsiusToFahrenheit(temp).ToString()
                        });
                    } else {
                        trow.Cells.Add(new TableCell {
                            Text = TemperatureConverter.FahrenheitToCelsius(temp).ToString()
                        });
                    }

                    Table.Rows.Add(trow);
                }

                Table.Visible = true;
            } else {
                Table.Visible = false;
            }
        }
Esempio n. 14
0
        public static void AddHeaderRow(this Table table, int cellCount, string header)
        {
            TableRow row = new TableRow();

              TableHeaderCell cell = new TableHeaderCell();
              cell.ColumnSpan = cellCount;
              cell.HorizontalAlign = HorizontalAlign.Left;
              cell.Text = header;
              row.Cells.Add(cell);

              table.Rows.Add(row);
        }
Esempio n. 15
0
        public void TablaEscuelaBusqueda(string escBusca,int nivel, int edo, int mun, int loc)
        {
            try
            {
                //Creamos tabla inicial de escuelas
                DataTable dt = Escuelas.getDatosEscuelaConsulta(escBusca, nivel, edo, mun, loc);
                DataRow header = dt.Rows[0];

                foreach (DataColumn col in dt.Columns)
                {
                    Debug.WriteLine("data: " + col.ColumnName);
                    TableHeaderCell celda = new TableHeaderCell();
                    celda.Text = col.ColumnName;
                    headerTable.Cells.Add(celda);
                }
                foreach (DataRow st in dt.Rows)
                {
                    Debug.WriteLine("row: " + st);
                    TableRow fila = new TableRow();
                    foreach (string valor in st.ItemArray)
                    {
                        TableCell tc = new TableCell();
                        if (valor.Equals(st.ItemArray[0]))
                        {
                            HyperLink link = new HyperLink();
                            tc.ID = valor.ToString();
                            link.NavigateUrl = "Pages/BusquedaA.aspx?idEscuela=" + tc.ID;
                            link.Text = valor.ToString();
                            tc.Controls.Add(link);

                            //Usamos el nombre d ela escuela como indentificador
                        }
                        else
                        {
                            tc.Text = valor.ToString();
                        }

                        fila.Cells.Add(tc);

                        string color = "#F0F0EF";
                        fila.BackColor = ColorTranslator.FromHtml(color);
                    }

                    tblResults.Rows.Add(fila);
                }

                tblResults.DataBind();
            }
            catch (Exception ex) {
                Debug.WriteLine("Error en la busqueda: " + ex);
            }
        }
Esempio n. 16
0
        protected void fillContact()
        {
            TableRow headerRow = new TableRow();
            TableRow valuesRow = new TableRow();

            TableHeaderCell address1Header = new TableHeaderCell();
            TableHeaderCell address2Header = new TableHeaderCell();
            TableHeaderCell cityHeader = new TableHeaderCell();
            TableHeaderCell stateHeader = new TableHeaderCell();
            TableHeaderCell zipHeader = new TableHeaderCell();
            TableHeaderCell phoneHeader = new TableHeaderCell();

            TableCell address1 = new TableCell();
            TableCell address2 = new TableCell();
            TableCell city = new TableCell();
            TableCell status = new TableCell();
            TableCell zipcode = new TableCell();
            TableCell phone = new TableCell();

            address1Header.Text = "Address 1".ToUpper();
            address2Header.Text = "Address 2".ToUpper();
            cityHeader.Text = "City".ToUpper();
            stateHeader.Text = "State".ToUpper();
            zipHeader.Text = "Zip Code".ToUpper();
            phoneHeader.Text = "Phone".ToUpper();

            address1.Text = employee.Address.Address1;
            address2.Text = employee.Address.Address2;
            city.Text = employee.Address.City;
            status.Text = employee.Address.State;
            zipcode.Text = employee.Address.ZipCode.ToString();
            phone.Text = employee.Phone;

            headerRow.Cells.Add(address1Header);
            headerRow.Cells.Add(address2Header);
            headerRow.Cells.Add(cityHeader);
            headerRow.Cells.Add(stateHeader);
            headerRow.Cells.Add(zipHeader);
            headerRow.Cells.Add(phoneHeader);

            valuesRow.Cells.Add(address1);
            valuesRow.Cells.Add(address2);
            valuesRow.Cells.Add(city);
            valuesRow.Cells.Add(status);
            valuesRow.Cells.Add(zipcode);
            valuesRow.Cells.Add(phone);

            AddressTable.Rows.Add(headerRow);
            AddressTable.Rows.Add(valuesRow);

            AddressTable.CssClass = "table";
        }
 protected void btnAddFoodItemToShoppingList_Click(object sender, EventArgs e)
 {
     double num;
     string amount = txtAmount.Text;
     bool isNum = Double.TryParse(amount, out num);
     if (amount != "")
     {
         if (isNum)
         {
             lbFoodItemID.Items.Add(ddlFoodItem.SelectedValue);
             lbFoodItemID.Items[lbFoodItemID.Items.Count - 1].Value = txtAmount.Text;
             tbFoodItem.Rows.Clear();
             TableHeaderRow tbHeaderRow = new TableHeaderRow();
             tbFoodItem.Rows.Add(tbHeaderRow);
             TableHeaderCell tbHeaderCellName = new TableHeaderCell();
             TableHeaderCell tbHeaderCellAmount = new TableHeaderCell();
             tbHeaderCellName.Text = "Name";
             tbHeaderCellAmount.Text = "Amount";
             tbHeaderRow.Cells.Add(tbHeaderCellName);
             tbHeaderRow.Cells.Add(tbHeaderCellAmount);
             for (int k = 0; k < lbFoodItemID.Items.Count; k++)
             {
                 string foodid = lbFoodItemID.Items[k].Text;
                 OleDbCommand command = new OleDbCommand("SELECT * FROM FoodItem WHERE FoodItemID = " + foodid.ToString(), myConnection);
                 command.CommandType = CommandType.Text;
                 OleDbDataReader reader = command.ExecuteReader();
                 bool notEoF = reader.Read();
                 while (notEoF)
                 {
                     TableRow tbRow = new TableRow();
                     tbFoodItem.Rows.Add(tbRow);
                     TableCell tbCellName = new TableCell();
                     TableCell tbCellAmount = new TableCell();
                     tbCellName.Text = reader["Name"].ToString();
                     tbCellAmount.Text = lbFoodItemID.Items[k].Value + " " + reader["UnitType"].ToString();
                     tbRow.Cells.Add(tbCellName);
                     tbRow.Cells.Add(tbCellAmount);
                     notEoF = reader.Read();
                 }
                 reader.Close();
             }
         }
         else
         {
             lblAmount.Text = "Amount is Invalid";
         }
     }
     else
     {
         lblAmount.Text = "Amount Required";
     }
 }
Esempio n. 18
0
        protected void RenderTable(bool CelciusToFahrenheit, int startValue, int endValue, int stepValue)
        {
            //skapar tableheader
            var thCell1 = new TableHeaderCell();
            var thCell2 = new TableHeaderCell();
            if (CelciusToFahrenheit)
            {
                thCell1.Controls.Add(new LiteralControl("°C"));
                thCell2.Controls.Add(new LiteralControl("°F"));
            }
            else
            {
                thCell1.Controls.Add(new LiteralControl("°F"));
                thCell2.Controls.Add(new LiteralControl("°C"));
            }
            var thRow = new TableHeaderRow();
            thRow.Controls.Add(thCell1);
            thRow.Controls.Add(thCell2);
            tblResults.Controls.Add(thRow);

            //skapar tablebody
            while (startValue <= endValue)
            {
                var row = new TableRow();
                var cell = new TableCell();
                cell.Controls.Add(
                    new LiteralControl(
                        startValue.ToString()));
                row.Controls.Add(cell);
                cell = new TableCell();

                if (CelciusToFahrenheit)
                {
                    cell.Controls.Add(
                        new LiteralControl(
                            TemperatureConverter.CelciusToFahrenheit(startValue).ToString()));
                }
                else
                {
                    cell.Controls.Add(
                        new LiteralControl(
                            TemperatureConverter.FahrenheitToCelcius(startValue).ToString()));
                }

                row.Controls.Add(cell);
                tblResults.Rows.Add(row);

                startValue += stepValue;

            }
        }
Esempio n. 19
0
 protected void OnDataBound(object sender, EventArgs e)
 {
     GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
     for (int i = 0; i < GridView1.Columns.Count; i++)
     {
         TableHeaderCell cell = new TableHeaderCell();
         TextBox txtSearch = new TextBox();
         txtSearch.Attributes["placeholder"] = GridView1.Columns[i].HeaderText;
         txtSearch.CssClass = "search_textbox";
         cell.Controls.Add(txtSearch);
         row.Controls.Add(cell);
     }
     GridView1.HeaderRow.Parent.Controls.AddAt(1, row);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Ado.ClasesComunes.Periodo _periodoActual = new Ado.ClasesComunes.Periodo();
            IMetodosAdministrador _metAdministrador = new MetodosAdministrador();
            _periodoActual = _metAdministrador.UltimoPeriodo();
            if (_periodoActual != null)
            {
                LinkedList<string> _encabezados = new LinkedList<string>();
                _encabezados.AddLast("Identificación");
                _encabezados.AddLast("Fecha de Inicio");
                _encabezados.AddLast("Fecha de Fin");
                _encabezados.AddLast("Estado");
                _encabezados.AddLast("Modalidad");
                _encabezados.AddLast("Año");
                _encabezados.AddLast("Número de Periodo");
                TableHeaderRow _encabezado = new TableHeaderRow();
                foreach (var _elemento in _encabezados)
                {
                    TableHeaderCell _celda = new TableHeaderCell();
                    _celda.Text = _elemento;
                    _encabezado.Cells.Add(_celda);
                }

                LinkedList<string> _periodo = new LinkedList<string>();
                _periodo.AddLast(_periodoActual.Id_Periodo.ToString());
                _periodo.AddLast(_periodoActual.Fec_Inicio.Date.ToString());
                _periodo.AddLast(_periodoActual.Fec_Fin.Date.ToString());
                _periodo.AddLast(_periodoActual.Txt_Estado);
                _periodo.AddLast(_periodoActual.Txt_Modalidad);
                _periodo.AddLast(_periodoActual.Num_Anno.ToString());
                _periodo.AddLast(_periodoActual.Num_Periodo.ToString());
                TableRow _fila = new TableRow();
                foreach (var _elemento in _periodo)
                {
                    TableCell _celda = new TableCell();
                    _celda.Text = _elemento;
                    _fila.Cells.Add(_celda);
                }
                //Lleno tabla
                tblPeriodo.Rows.Add(_encabezado);
                tblPeriodo.Rows.Add(_fila);

            }
            else
            {
                //Agrego Label que diga que no hay un periodo de recepcion en curso actualmente.
                lblSinPeriodo.Text = "-- El sistema no tiene actualmente un periodo de recepción de solicitudes en curso actualmente. --";
            }
        }
Esempio n. 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     int shoppingListID = 0;
     if (Request.QueryString["ShoppingListID"] != null && Request.QueryString["ShoppingListID"] != "")
     {
         shoppingListID = Convert.ToInt32(Request.QueryString["ShoppingListID"]);
     }
     else
     {
         Response.Redirect("ShoppingListHistory.aspx");
     }
     myConnection.ConnectionString = connstr;
     myConnection.Open();
     OleDbCommand cmd = new OleDbCommand("SELECT * FROM ShoppingList WHERE ShoppingListID = " + shoppingListID, myConnection);
     cmd.CommandType = CommandType.Text;
     OleDbDataReader reader = cmd.ExecuteReader();
     bool notEoF = reader.Read();
     while (notEoF)
     {
         lblCreatedDate.Text = reader["CreatedDate"].ToString().Split(' ')[0].ToString();
         notEoF = reader.Read();
     }
     reader.Close();
     TableHeaderRow tbHeaderRow = new TableHeaderRow();
     tbFoodItem.Rows.Add(tbHeaderRow);
     TableHeaderCell tbHeaderCellName = new TableHeaderCell();
     TableHeaderCell tbHeaderCellAmount = new TableHeaderCell();
     tbHeaderCellName.Text = "Name";
     tbHeaderCellAmount.Text = "Amount";
     tbHeaderRow.Cells.Add(tbHeaderCellName);
     tbHeaderRow.Cells.Add(tbHeaderCellAmount);
     OleDbCommand cmd2 = new OleDbCommand("SELECT * FROM FoodItem AS f INNER JOIN ShoppingListFoodItem AS sf ON f.FoodItemID = sf.FoodItemID WHERE sf.ShoppingListID = " + shoppingListID, myConnection);
     cmd2.CommandType = CommandType.Text;
     OleDbDataReader reader2 = cmd2.ExecuteReader();
     bool notEoF2 = reader2.Read();
     while (notEoF2)
     {
         TableRow tbRow = new TableRow();
         tbFoodItem.Rows.Add(tbRow);
         TableCell tbCellName = new TableCell();
         TableCell tbCellAmount = new TableCell();
         tbCellName.Text = reader2["Name"].ToString();
         tbCellAmount.Text = reader2["Amount"].ToString() + " " + reader2["UnitType"].ToString();
         tbRow.Cells.Add(tbCellName);
         tbRow.Cells.Add(tbCellAmount);
         notEoF2 = reader2.Read();
     }
     reader2.Close();
 }
 protected void gridViewDetail_RowCreated(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Header)
     {
         GridViewRow gvr = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
         TableHeaderCell thc = new TableHeaderCell();
         thc.ColumnSpan = 4;
         thc.Text = "General Info";
         //thc.BackColor = System.Drawing.Color.Yellow;
         gvr.Cells.Add(thc);
         System.Drawing.Color backcolor = System.Drawing.ColorTranslator.FromHtml("#164BDB");
         System.Drawing.Color forecolor = System.Drawing.Color.White;
         Department dept = new Department();
         JobTypeDepartment jobtypeDepartment = new JobTypeDepartment();
         //var departments = dept.GetJobOverviewDepartment();
         int rowIndex = 4;
         for (int i = 0; i < joboverviewDepartment.Count; i++)
         {
             if (i % 2 != 0)
             {
                 backcolor = System.Drawing.ColorTranslator.FromHtml("#0D72FF");
                 //forecolor = System.Drawing.ColorTranslator.FromHtml("#2e6e9e");
                 forecolor = System.Drawing.Color.White;
             }
             else
             {
                 backcolor = System.Drawing.ColorTranslator.FromHtml("#164BDB");
                 forecolor = System.Drawing.Color.White;
             }
             //var jobtypes = jobtypeDepartment.GetJobOverviewJobType(joboverviewDepartment[i].Id);
             if (joboverviewJobType[i].Count > 0)
             {
                 thc = new TableHeaderCell();
                 thc.BackColor = backcolor;
                 thc.ForeColor = forecolor;
                 thc.ColumnSpan = joboverviewJobType[i].Count;
                 thc.Text = joboverviewDepartment[i].Description;
                 gvr.Cells.Add(thc);
             }
             for (int x = 0; x < joboverviewJobType[i].Count; x++)
             {
                 e.Row.Cells[rowIndex].BackColor = backcolor;
                 e.Row.Cells[rowIndex].ForeColor = forecolor;
                 rowIndex++;
             }
         }
         gridViewDetail.Controls[0].Controls.AddAt(0, gvr);
     }
 }
 public void cargar_encabezado()
 {
     Table1.CssClass = "table";
     TableRow fila = new TableRow();
     fila.CssClass = "tr";
     String[] titulos ={"Tema","Pregunta","Fecha creacion","Usuario","Abrir","Modificar","Eliminar"};
     for (int i = 0; i < titulos.Length;i++ )
     {
         TableHeaderCell celda = new TableHeaderCell();
         celda.CssClass = "th";
         celda.Text = titulos[i];
         fila.Cells.Add(celda);
     }
     Table1.Rows.Add(fila);
 }
        protected void convertButton_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                TempTable.Visible = true;
                var StartTemp = int.Parse(startTemp.Text);
                var EndTemp = int.Parse(endTemp.Text);
                var TempStep = int.Parse(tempStep.Text);

                TableHeaderRow tableHeaderRow = new TableHeaderRow();
                TableHeaderCell tableHeaderCell = new TableHeaderCell();
                TableHeaderCell tableHeaderCellFarenheit = new TableHeaderCell();

                if (CelFa.Checked)
                {
                    CellToFar.Text = "°C";
                    FarToCell.Text = "°F";
                }
                else if (FarCe.Checked)
                {
                    CellToFar.Text = "°F";
                    FarToCell.Text = "°C";
                }
                for (int temp = StartTemp; temp <= EndTemp; temp += TempStep)
                {
                    TableCell cellOne = new TableCell();
                    TableCell cellTwo = new TableCell();
                    TableRow row = new TableRow();

                    TempTable.Rows.Add(row);
                    TempTable.Rows.Add(tableHeaderRow);

                    row.Cells.Add(cellOne);
                    row.Cells.Add(cellTwo);

                    if (CelFa.Checked == true)
                    {
                        cellOne.Text = temp.ToString();
                        cellTwo.Text = TemperatureConverter.CelsiusToFahrenheit(temp).ToString();
                    }
                    else if (FarCe.Checked == true)
                    {
                        cellOne.Text = temp.ToString();
                        cellTwo.Text = TemperatureConverter.FahrenheitToCelsius(temp).ToString();
                    }
                }
            }
        }
Esempio n. 25
0
        protected void parseData(string fileName)
        {
            string[] lines = System.IO.File.ReadAllLines(@"" + fileName);
            string[] colums = lines[0].Split(',');

            TableRow row = new TableRow();
            foreach (string c in colums)
            {
                TableHeaderCell headerCell = new TableHeaderCell();
                headerCell.Text = c;
                row.Cells.Add(headerCell);
            }
            marketTable.Rows.Add(row);

            for (int i = 1; i < lines.Length; i++)
            {
                row = new TableRow();
                string[] data = lines[i].Split(',');
                foreach (string s in data)
                {
                    TableCell cell = new TableCell();
                    cell.Text = s;
                    row.Cells.Add(cell);
                }
                marketTable.Rows.Add(row);
            }
            double sellPrice = double.MaxValue;
            double buyPrice = 0;
            double profit = 0;
            double margin = 0;
            for (int i = 1; i < lines.Length; i++)
            {
                string[] data = lines[i].Split(',');
                if (data[7].Equals("False"))
                    if (double.Parse(data[0]) < sellPrice)
                        sellPrice = double.Parse(data[0]);

                if (data[7].Equals("True"))
                    if (double.Parse(data[0]) > buyPrice)
                        buyPrice = double.Parse(data[0]);
            }
            profit = Math.Round((sellPrice - buyPrice), 2);
            margin = Math.Round((profit / sellPrice * 100), 2);
            buyLabel.Text = "Best buy price: " + buyPrice;
            sellLabel.Text = "Best Sell Price: " + sellPrice;
            profitLabel.Text = "profit per unit: " + profit;
            marginLabel.Text = "Margin: " + margin;
        }
Esempio n. 26
0
        public void CreateUserBookingTable()
        {
            UserName.Text = string.Format("UserName: {0}", UserDB.GetUserById(1).UserName);
            foreach (var booking in BookingDB.GetBookingsByUserId(1))
            {
                TableHeaderRow tbHeaderRow = new TableHeaderRow() { };

                TableHeaderCell tbHeaderCell = new TableHeaderCell() { Text = string.Format("<b>Booking id:</b> {0}", booking.Id), ColumnSpan = 6 };

                tbHeaderRow.Cells.Add(tbHeaderCell);
                MyBookingsTable.Rows.Add(tbHeaderRow);

                TableHeaderRow tbHeaderRowSession = new TableHeaderRow();
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Selected" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Session Id", CssClass = "no-spacing-right" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Date" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Time" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Court" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Session Cost" });
                MyBookingsTable.Rows.Add(tbHeaderRowSession);

                foreach (var session in SessionDB.GetAllSessionsByBookingId(booking.Id))
                {
                    TableRow trSession = new TableRow();
                    SessionItemCheckBox cb = new SessionItemCheckBox() {ID = session.Id.ToString() ,Session = session  };
                    TableCell tbCell = new TableCell();
                    ((IParserAccessor)tbCell).AddParsedSubObject(cb);

                    trSession.Cells.Add(tbCell);
                    trSession.Cells.Add(new TableCell() { Text = session.Id.ToString(), CssClass = "no-spacing-right" });
                    trSession.Cells.Add(new TableCell() { Text = session.StartDateTime.ToShortDateString() });
                    trSession.Cells.Add(new TableCell()
                    {
                        Text = session.StartDateTime.ToShortTimeString() + "-" + session.EndDateTime.ToShortTimeString()
                    });
                    trSession.Cells.Add(new TableCell() { Text = session.Court.Name + session.CourtId });
                    trSession.Cells.Add(new TableCell() { Text = session.SessionCost.ToString() });
                    MyBookingsTable.Rows.Add(trSession);

                }

                TableRow tbRow = new TableRow();
                tbRow.Cells.Add(new TableCell() { Text = "<hr>", ColumnSpan = 6 });

                MyBookingsTable.Rows.Add(tbRow);
            }
        }
Esempio n. 27
0
        internal static void CreateHeaderCell(TableRow row, string text, string targetControlId)
        {
            using (TableHeaderCell cell = new TableHeaderCell())
            {
                if (targetControlId != null)
                {
                    using (HtmlGenericControl label = HtmlControlHelper.GetLabel(text, targetControlId))
                    {
                        cell.Controls.Add(label);
                    }
                }
                else
                {
                    cell.Text = text;
                }

                row.Cells.Add(cell);
            }
        }
Esempio n. 28
0
        protected void FillTableHeaders()
        {
            // Creating a row
            TableRow row = new TableRow();

            // Creating the cells
            TableHeaderCell id = new TableHeaderCell();
            TableHeaderCell name = new TableHeaderCell();
            TableHeaderCell department = new TableHeaderCell();
            TableHeaderCell position = new TableHeaderCell();
            TableHeaderCell view = new TableHeaderCell();

            // Adding the text to each cell
            id.Text = "ID#";
            name.Text = "Name";
            department.Text = "Department";
            position.Text = "Position";
            view.Text = "Options";

            // add the cells to the row
            row.Cells.Add(id);
            row.Cells.Add(name);
            row.Cells.Add(department);
            row.Cells.Add(position);
            row.Cells.Add(view);

            // CREATE A CELL FOR ADMIN DELETE
            try
            {
                if (Session["admin"].ToString() == "True")
                {
                    TableHeaderCell deleteHeader = new TableHeaderCell();
                    deleteHeader.Text = "Delete";
                    row.Cells.Add(deleteHeader);
                }
            }
            catch (Exception e) {
                Response.Redirect("login.aspx");
            }

            // Add the row to the table
            Table1.Rows.Add(row);
        }
        void lookup()
        {
            DataGetter dataGetter = new DataGetter();

            List<DateTime> departs = dataGetter.Depart;
            List<DateTime> arrives = dataGetter.Arrive;

            TableTimes.Rows.Clear ();
            TableHeaderRow hRow = new TableHeaderRow ();
            TableTimes.Rows.Add (hRow);

            if (departs.Count == 0 || arrives.Count == 0) {
                TableHeaderCell cell = new TableHeaderCell ();
                cell.Text = "No Trains Found";
                cell.CssClass = "text-center";
                hRow.Cells.Add (cell);
                hRow.CssClass = "danger";
            } else {
                TableHeaderCell departHeaderCell = new TableHeaderCell ();
                departHeaderCell.Text = "Depart";
                departHeaderCell.CssClass = "text-center";
                hRow.Cells.Add (departHeaderCell);
                TableHeaderCell arriveHeaderCell = new TableHeaderCell ();
                arriveHeaderCell.Text = "Arrive";
                arriveHeaderCell.CssClass = "text-center";
                hRow.Cells.Add (arriveHeaderCell);

                for (int i = 0; i < departs.Count && i < arrives.Count; i++) {
                    if (Trip.Day > 0 || (Trip.Day == 0 && departs [i] > DateTime.Now)) {
                        TableCell departCell = new TableCell ();
                        departCell.Text = departs [i].ToShortTimeString ();
                        departCell.CssClass = "text-center";
                        TableCell arriveCell = new TableCell ();
                        arriveCell.Text = arrives [i].ToShortTimeString ();
                        arriveCell.CssClass = "text-center";
                        TableRow row = new TableRow ();
                        row.Cells.Add (departCell);
                        row.Cells.Add (arriveCell);
                        TableTimes.Rows.Add (row);
                    }
                }
            }
        }
Esempio n. 30
0
        protected void AllocatedCostsGridView_OnDataBound(object sender, EventArgs e)
        {
            GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
            TableHeaderCell cell = new TableHeaderCell();
            cell.Text = "";
            cell.ColumnSpan = 2;
            row.Controls.Add(cell);

            row.BackColor = ColorTranslator.FromHtml("#9e1b34");
            row.ForeColor = ColorTranslator.FromHtml("White");

            row.HorizontalAlign = HorizontalAlign.Center;

            foreach (GridViewRow row2 in AllocatedCostsGridView.Rows)
            {
                LinkButton lb = (LinkButton)row2.Cells[0].Controls[0];
                lb.ForeColor = ColorTranslator.FromHtml("#0000EE");

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var allEmployees = EmployeeController.getAllEmployees();
            this.tblAllEmployees.Visible = true;

            TableRow headerRow = new TableRow();

            TableHeaderCell header = new TableHeaderCell();
            header.Text = "ID";
            headerRow.Cells.Add(header);

            header = new TableHeaderCell();
            header.Text = "Name";
            headerRow.Cells.Add(header);

            header = new TableHeaderCell();
            header.Text = "Email";
            headerRow.Cells.Add(header);

            this.tblAllEmployees.Rows.Add(headerRow);

            foreach (Employee empl in allEmployees)
            {
                TableRow row = new TableRow();
                TableCell cell = new TableCell();

                cell = new TableCell();
                cell.Text = empl.Id.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = empl.EmployeeName;
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = empl.EmployeeEmail;
                row.Cells.Add(cell);

                this.tblAllEmployees.Rows.Add(row);
            }
        }
        protected void createViewAthenTable()
        {
            clsAuthorizationDetails objAutho = new clsAuthorizationDetails();
            List <EntModuleDetails> lst      = objAutho.getModuleList();

            Session[clsConstant.SESS_MODULE] = lst;
            tblHrModuleView.ColumnSpan       = lst.Count * 2;
            tblAthenRow  = new TableRow();
            tblAthenCell = new TableCell();
            tblAthenRow.Controls.Add(tblAthenCell);
            for (int iloop = 0; iloop < lst.Count; iloop++)
            {
                tblModHrCell = new TableHeaderCell();
                if (lst[iloop].ModuleID == clsConstant.NOMIATION_ID)
                {
                    tblModHrCell.ColumnSpan = 4;
                }
                else
                {
                    tblModHrCell.ColumnSpan = 2;
                }
                lblHeading      = new Label();
                lblHeading.Text = Server.HtmlEncode(lst[iloop].ModuleName);
                lblHeading.ID   = "lblModule" + iloop;
                tblModHrCell.Controls.Add(lblHeading);
                tblAthenRow.Controls.Add(tblModHrCell);
            }
            tblAthenView.Controls.Add(tblAthenRow);
            tblAthenRow  = new TableRow();
            tblAthenCell = new TableCell();
            tblAthenRow.Controls.Add(tblAthenCell);
            for (int iloop = 0; iloop < lst.Count; iloop++)
            {
                tblModHrCell = new TableHeaderCell();
                tblModHrCell.HorizontalAlign = HorizontalAlign.Center;
                lblHeading      = new Label();
                lblHeading.Text = Server.HtmlEncode("VIEW");
                lblHeading.ID   = "lblView" + iloop;
                tblModHrCell.Controls.Add(lblHeading);
                tblAthenRow.Controls.Add(tblModHrCell);
                tblModHrCell.HorizontalAlign = HorizontalAlign.Center;
                if (lst[iloop].ModuleID == clsConstant.NOMIATION_ID)
                {
                    tblModHrCell    = new TableHeaderCell();
                    lblHeading      = new Label();
                    lblHeading.Text = Server.HtmlEncode("UPLOAD");
                    lblHeading.ID   = "lblUpload" + iloop;
                    tblModHrCell.Controls.Add(lblHeading);
                    tblAthenRow.Controls.Add(tblModHrCell);

                    tblModHrCell    = new TableHeaderCell();
                    lblHeading      = new Label();
                    lblHeading.Text = Server.HtmlEncode("SHORT-LIST");
                    lblHeading.ID   = "lblShortList" + iloop;
                    tblModHrCell.Controls.Add(lblHeading);
                    tblAthenRow.Controls.Add(tblModHrCell);

                    tblModHrCell    = new TableHeaderCell();
                    lblHeading      = new Label();
                    lblHeading.Text = Server.HtmlEncode("APPROVE");
                    lblHeading.ID   = "lblApprove" + iloop;
                    tblModHrCell.Controls.Add(lblHeading);
                    tblAthenRow.Controls.Add(tblModHrCell);
                }
                else
                {
                    tblModHrCell    = new TableHeaderCell();
                    lblHeading      = new Label();
                    lblHeading.Text = Server.HtmlEncode("EDIT");
                    lblHeading.ID   = "lblEdit" + iloop;
                    tblModHrCell.Controls.Add(lblHeading);
                    tblAthenRow.Controls.Add(tblModHrCell);
                }
            }
            tblAthenView.Controls.Add(tblAthenRow);
            objAutho = new clsAuthorizationDetails();
            List <entAthen> lstRole = objAutho.getRoleListFromAthen();


            List <entRoleCount> listRoleCount = objAutho.getRoleCountList();
            int iCount = 0;

            for (int iloop = 0; iloop < listRoleCount.Count; iloop++)
            {
                tblAthenRow = new TableRow();
                tblModCell  = new TableCell();
                lblHeading  = new Label();
                tblModCell.HorizontalAlign = HorizontalAlign.Center;
                lblHeading.Text            = Server.HtmlEncode(listRoleCount[iloop].RoleName);
                lblHeading.ID = "lblRole" + iloop;
                tblModCell.Controls.Add(lblHeading);
                tblAthenRow.Controls.Add(tblModCell);
                for (int jloop = 0; jloop < lst.Count; jloop++)
                {
                    if (lst[jloop].ModuleID == clsConstant.NOMIATION_ID)
                    {
                        List <EntNomAuthorizationDetails> lstNom;
                        lstNom = objAutho.GetNomAthenDetails(listRoleCount[iloop].RoleID);
                        bool isView      = false;
                        bool isUpload    = false;
                        bool isShortList = false;
                        bool isApprove   = false;
                        if (lstNom.Count > 0)
                        {
                            isView      = lstNom[0].isView;
                            isUpload    = lstNom[0].isUpload;
                            isShortList = lstNom[0].isShortList;
                            isApprove   = lstNom[0].isApprove;
                        }
                        tblModCell = new TableCell();
                        lblHeading = new Label();
                        tblModCell.HorizontalAlign = HorizontalAlign.Center;
                        lblHeading.Text            = isView.ToString();
                        lblHeading.ID = "lblView_" + iloop + "_" + iCount;
                        tblModCell.Controls.Add(lblHeading);
                        tblAthenRow.Controls.Add(tblModCell);

                        tblModCell = new TableCell();
                        lblHeading = new Label();
                        tblModCell.HorizontalAlign = HorizontalAlign.Center;
                        lblHeading.Text            = isUpload.ToString();
                        lblHeading.ID = "lblUpload_" + iloop + "_" + iCount;
                        tblModCell.Controls.Add(lblHeading);
                        tblAthenRow.Controls.Add(tblModCell);

                        tblModCell = new TableCell();
                        lblHeading = new Label();
                        tblModCell.HorizontalAlign = HorizontalAlign.Center;
                        lblHeading.Text            = isShortList.ToString();
                        lblHeading.ID = "lblShortList_" + iloop + "_" + iCount;
                        tblModCell.Controls.Add(lblHeading);
                        tblAthenRow.Controls.Add(tblModCell);

                        tblModCell = new TableCell();
                        lblHeading = new Label();
                        tblModCell.HorizontalAlign = HorizontalAlign.Center;
                        lblHeading.Text            = isApprove.ToString();
                        lblHeading.ID = "lblApprove_" + iloop + "_" + iCount;
                        tblModCell.Controls.Add(lblHeading);
                        tblAthenRow.Controls.Add(tblModCell);
                    }
                    else if (lstRole.Count > iCount)
                    {
                        if (lst[jloop].ModuleID == lstRole[iCount].ModuleID)
                        {
                            tblModCell = new TableCell();
                            lblHeading = new Label();
                            tblModCell.HorizontalAlign = HorizontalAlign.Center;
                            lblHeading.Text            = lstRole[iCount].isView.ToString();
                            lblHeading.ID = "lblView_" + iloop + "_" + iCount;
                            tblModCell.Controls.Add(lblHeading);
                            tblAthenRow.Controls.Add(tblModCell);

                            tblModCell = new TableCell();
                            lblHeading = new Label();
                            tblModCell.HorizontalAlign = HorizontalAlign.Center;
                            lblHeading.Text            = lstRole[iCount].isEdit.ToString();
                            lblHeading.ID = "lblEdit_" + iloop + "_" + iCount;
                            tblModCell.Controls.Add(lblHeading);
                            tblAthenRow.Controls.Add(tblModCell);
                        }
                        else
                        {
                            tblModCell = new TableCell();
                            lblHeading = new Label();
                            tblModCell.HorizontalAlign = HorizontalAlign.Center;
                            lblHeading.Text            = "False";
                            lblHeading.ID = "lblView_" + iloop + "_" + iCount;
                            tblModCell.Controls.Add(lblHeading);
                            tblAthenRow.Controls.Add(tblModCell);
                            tblModCell = new TableCell();
                            lblHeading = new Label();
                            tblModCell.HorizontalAlign = HorizontalAlign.Center;
                            lblHeading.Text            = "False";
                            lblHeading.ID = "lblEdit_" + iloop + "_" + iCount;
                            tblModCell.Controls.Add(lblHeading);
                            tblAthenRow.Controls.Add(tblModCell);
                        }
                    }
                    else
                    {
                        tblModCell = new TableCell();
                        lblHeading = new Label();
                        tblModCell.HorizontalAlign = HorizontalAlign.Center;
                        lblHeading.Text            = "False";
                        lblHeading.ID = "lblView_" + iloop + "_" + iCount;
                        tblModCell.Controls.Add(lblHeading);
                        tblAthenRow.Controls.Add(tblModCell);

                        tblModCell = new TableCell();
                        lblHeading = new Label();
                        tblModCell.HorizontalAlign = HorizontalAlign.Center;
                        lblHeading.Text            = "False";
                        lblHeading.ID = "lblEdit_" + iloop + "_" + iCount;
                        tblModCell.Controls.Add(lblHeading);
                        tblAthenRow.Controls.Add(tblModCell);
                    }
                    iCount = iCount + 1;
                }
                tblAthenView.Controls.Add(tblAthenRow);
            }

            tblAthenView.Controls.Add(tblAthenRow);
            tblHrModuleView.ColumnSpan = (lst.Count * 2) + 2;
        }
        protected Table createMouleTable(int iRow)
        {
            clsAuthorizationDetails objAutho = new clsAuthorizationDetails();
            List <EntModuleDetails> lst      = objAutho.getModuleList();

            Session[clsConstant.SESS_MODULE] = lst;
            tblModule             = new Table();
            tblModule.CellPadding = 2;
            tblModule.CellSpacing = 2;

            tblModHrRow = new TableHeaderRow();
            tblModRow   = new TableRow();
            for (int iloop = 0; iloop < lst.Count; iloop++)
            {
                tblModHrCell         = new TableHeaderCell();
                lblHeading           = new Label();
                lblHeading.Text      = Server.HtmlEncode(lst[iloop].ModuleName);
                lblHeading.ID        = "lblHeading" + iRow + "_" + iloop;
                lblHeading.Font.Bold = true;

                tblModHrCell.Controls.Add(lblHeading);

                tblModHrRow.Controls.Add(tblModHrCell);


                tblModCell  = new TableCell();
                chkbox      = new CheckBox();
                chkbox.Text = "View";
                chkbox.ID   = "chkView" + iRow + "_" + lst[iloop].ModuleID;

                tblModCell.Controls.Add(chkbox);

                if (lst[iloop].ModuleID == clsConstant.NOMIATION_ID)
                {
                    chkbox      = new CheckBox();
                    chkbox.Text = "Upload";
                    chkbox.ID   = "chkUpload" + iRow + "_" + lst[iloop].ModuleID;

                    tblModCell.Controls.Add(chkbox);

                    chkbox      = new CheckBox();
                    chkbox.Text = "Short List";
                    chkbox.ID   = "chkShortList" + iRow + "_" + lst[iloop].ModuleID;

                    tblModCell.Controls.Add(chkbox);

                    chkbox      = new CheckBox();
                    chkbox.Text = "Approve";
                    chkbox.ID   = "chkApprove" + iRow + "_" + lst[iloop].ModuleID;

                    tblModCell.Controls.Add(chkbox);
                }
                else
                {
                    chkbox      = new CheckBox();
                    chkbox.Text = "Edit";
                    chkbox.ID   = "chkEdit" + iRow + "_" + lst[iloop].ModuleID;

                    tblModCell.Controls.Add(chkbox);
                }


                tblModRow.Controls.Add(tblModCell);
            }
            tblModule.Controls.Add(tblModHrRow);
            tblModule.Controls.Add(tblModRow);
            return(tblModule);
        }
        //
        // Private methods
        //
        void WriteDayHeader(HtmlTextWriter writer, bool enabled)
        {
            int    i, first;
            string dayName;

            i = first = (int)(DisplayFirstDayOfWeek);
            TableCell cell;


            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            if (SelectionMode == CalendarSelectionMode.DayWeek)
            {
                cell = new TableCell();
                cell.HorizontalAlign = HorizontalAlign.Center;
                cell.ApplyStyle(DayHeaderStyle);

                // Empty Cell
                cell.RenderBeginTag(writer);
                cell.RenderEndTag(writer);
            }
            else
            {
                if (SelectionMode == CalendarSelectionMode.DayWeekMonth)
                {
                    TableCell selector = new TableCell();
                    selector.ApplyStyle(SelectorStyle);
                    selector.HorizontalAlign = HorizontalAlign.Center;

                    DateTime date = new DateTime(DisplayDate.Year, DisplayDate.Month, 1); // first date
                    int      days = DateTime.DaysInMonth(DisplayDate.Year, DisplayDate.Month);

                    selector.RenderBeginTag(writer);
                    writer.Write(BuildLink("R" + GetDaysFromZenith(date) + days, SelectMonthText, DayHeaderStyle.ForeColor, enabled));
                    selector.RenderEndTag(writer);
                }
            }

            DateTimeFormatInfo dti = DateInfo;

            while (true)
            {
                DayOfWeek dayOfWeek = (DayOfWeek)i;
                dayName = dti.GetDayName(dayOfWeek);

                if (UseAccessibleHeader)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Abbr, dayName);
                    writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col", false);
                    cell = new TableHeaderCell();
                }
                else
                {
                    cell = new TableCell();
                }

                cell.HorizontalAlign = HorizontalAlign.Center;
                cell.ApplyStyle(DayHeaderStyle);

                cell.RenderBeginTag(writer);

                switch (DayNameFormat)
                {
                case DayNameFormat.FirstLetter:
                    dayName = dayName.Substring(0, 1);
                    break;

                case DayNameFormat.FirstTwoLetters:
                    dayName = dayName.Substring(0, 2);
                    break;

                case DayNameFormat.Shortest:
                    dayName = dti.GetShortestDayName(dayOfWeek);
                    break;

                case DayNameFormat.Full:
                    break;

                case DayNameFormat.Short:
                default:
                    dayName = dti.GetAbbreviatedDayName(dayOfWeek);
                    break;
                }

                writer.Write(dayName);
                cell.RenderEndTag(writer);

                if (i >= daysInAWeek - 1)
                {
                    i = 0;
                }
                else
                {
                    i++;
                }

                if (i == first)
                {
                    break;
                }
            }

            writer.RenderEndTag();
        }