Esempio n. 1
0
        protected void FillSelectCampus()
        {
            //Select campus
            CampusData campusData = new CampusData();

            selectCampus.DataSource     = campusData.DataTableCampus();
            selectCampus.DataValueField = "Id";
            selectCampus.DataTextField  = "Name";
            selectCampus.DataBind();
        }
Esempio n. 2
0
 protected void FillSelectCampusToView()
 {
     //Select campus ti view
     CampusData campusData = new CampusData();
     DataTable dataTableCampus = new DataTable();
     if (Convert.ToInt32(Session["User-RoleId"]) == 3)
         dataTableCampus = campusData.DataTableCampus();
     else
         dataTableCampus = campusData.DataTableUserCampus(campusData.SendCampusList(campusData.GetUserCampus(Session["User-UserName"].ToString())));
     hiddenCampusToViewValue.Value = dataTableCampus.Rows[0]["Id"].ToString();
     selectCampusToView.DataSource = dataTableCampus;
     selectCampusToView.DataValueField = "Id";
     selectCampusToView.DataTextField = "Name";
     selectCampusToView.DataBind();
 }
Esempio n. 3
0
        protected void FillTable()
        {
            CampusData campusData = new CampusData();
            //Populating a DataTable from database.
            DataTable dt = campusData.DataTableCampus();

            //Building an HTML string.
            StringBuilder html = new StringBuilder();

            //Building the Header row.
            html.Append("<tbody>");
            html.Append("<tr>");
            foreach (DataColumn column in dt.Columns)
            {
                html.Append("<th>");
                html.Append(column.ColumnName);
                html.Append("</th>");
            }
            html.Append("</tr>");

            //Building the Data rows.
            foreach (DataRow row in dt.Rows)
            {
                html.Append("<tr class='desmarcado'>");
                foreach (DataColumn column in dt.Columns)
                {
                    html.Append("<td onclick='getValue(this.parentNode)' style='cursor:pointer'>");
                    html.Append(row[column.ColumnName]);
                    html.Append("</td>");
                }
                html.Append("<td>");
                html.Append("<button onclick='setValues(this.parentNode.parentNode)' type='button'>Edit</button>");
                html.Append("</td>");
                html.Append("<td>");
                html.Append("<button onclick='deleteRole()' type='button'>Delete</button>");
                html.Append("</td>");
                html.Append("</tr>");
            }
            html.Append("</tbody>");

            //Append the HTML string to Placeholder.
            placeHolderTableCampus.Controls.Clear();
            placeHolderTableCampus.Controls.Add(new Literal {
                Text = html.ToString()
            });
        }
Esempio n. 4
0
        protected void FillTable()
        {
            CampusData campusData = new CampusData();
            //Populating a DataTable from database.
            DataTable dt = campusData.DataTableCampus();

            //Building an HTML string.
            StringBuilder html = new StringBuilder();

            //Building the Header row.
            html.Append("<tbody>");
            html.Append("<tr>");
            foreach (DataColumn column in dt.Columns)
            {
                html.Append("<th>");
                html.Append(column.ColumnName);
                html.Append("</th>");
            }
            html.Append("</tr>");

            //Building the Data rows.
            foreach (DataRow row in dt.Rows)
            {
                html.Append("<tr class='desmarcado'>");
                foreach (DataColumn column in dt.Columns)
                {
                    html.Append("<td onclick='getValue(this.parentNode)' style='cursor:pointer'>");
                    html.Append(row[column.ColumnName]);
                    html.Append("</td>");
                }
                html.Append("<td>");
                html.Append("<button onclick='setValues(this.parentNode.parentNode)' type='button'>Edit</button>");
                html.Append("</td>");
                html.Append("<td>");
                html.Append("<button onclick='deleteRole()' type='button'>Delete</button>");
                html.Append("</td>");
                html.Append("</tr>");
            }
            html.Append("</tbody>");

            //Append the HTML string to Placeholder.
            placeHolderTableCampus.Controls.Clear();
            placeHolderTableCampus.Controls.Add(new Literal { Text = html.ToString() });
        }
Esempio n. 5
0
        protected void FillSelectCampusToView()
        {
            //Select campus ti view
            CampusData campusData      = new CampusData();
            DataTable  dataTableCampus = new DataTable();

            if (Convert.ToInt32(Session["User-RoleId"]) == 3)
            {
                dataTableCampus = campusData.DataTableCampus();
            }
            else
            {
                dataTableCampus = campusData.DataTableUserCampus(campusData.SendCampusList(campusData.GetUserCampus(Session["User-UserName"].ToString())));
            }
            hiddenCampusToViewValue.Value     = dataTableCampus.Rows[0]["Id"].ToString();
            selectCampusToView.DataSource     = dataTableCampus;
            selectCampusToView.DataValueField = "Id";
            selectCampusToView.DataTextField  = "Name";
            selectCampusToView.DataBind();
        }
Esempio n. 6
0
 protected void FillSelectCampus()
 {
     //Select campus
     CampusData campusData = new CampusData();
     selectCampus.DataSource = campusData.DataTableCampus();
     selectCampus.DataValueField = "Id";
     selectCampus.DataTextField = "Name";
     selectCampus.DataBind();
 }