protected void FillSelectCampus() { //Select campus CampusData campusData = new CampusData(); selectCampus.DataSource = campusData.DataTableCampus(); selectCampus.DataValueField = "Id"; selectCampus.DataTextField = "Name"; selectCampus.DataBind(); }
protected void FillSelectCampusToView() { //Select Campus CampusData campusData = new CampusData(); selectCampusToView.DataSource = campusData.DataTableUserCampus(campusData.SendCampusList(campusData.GetUserCampus(Session["User-UserName"].ToString()))); selectCampusToView.DataValueField = "Id"; selectCampusToView.DataTextField = "Name"; selectCampusToView.DataBind(); }
protected void FillSelectCampus(object sender, EventArgs e) { //Select Campus CampusData campusData = new CampusData(); selectCampus.DataSource = campusData.DataTableUserCampus(campusData.SendCampusList(campusData.GetUserCampus(Session["User-UserName"].ToString()))); selectCampus.DataValueField = "Id"; selectCampus.DataTextField = "Name"; selectCampus.DataBind(); FillSelectParking(sender, e); }
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(); }
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() }); }
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(); }
protected void FillSelectCampus() { //Select Campus CampusData campusData = new CampusData(); selectCampus.DataSource = campusData.DataTableUserCampus(campusData.SendCampusList(campusData.GetUserCampus(Session["User-UserName"].ToString()))); selectCampus.DataValueField = "Id"; selectCampus.DataTextField = "Name"; selectCampus.DataBind(); }