void getTableLineaAccion() { int contadorRegistrosLineaAccion = 0; LineaAccionDao laDao = new LineaAccionDao(); //Populating a DataTable from database. DataTable dt = laDao.getTableLineaAccion(); //Building an HTML string. StringBuilder html = new StringBuilder(); //Table start. html.Append("<table class='table table-bordered'"); //Building the Header row. html.Append("<tr>"); html.Append("<th>Id LineaAccion</th>"); html.Append("<th>Nombre De Linea Accion</th>"); html.Append("<th>Modificar</th>"); html.Append("<th>Eliminar</th>"); html.Append("</tr>"); //Building the Data rows. foreach (DataRow row in dt.Rows) { contadorRegistrosLineaAccion++; html.Append("<tr class='table-title'>"); DataColumn dc = new DataColumn(); foreach (DataColumn column in dt.Columns) { html.Append("<td>"); html.Append("<div>" + row[column.ColumnName] + "</div>"); html.Append("</td>"); } html.Append("<td><a href='#' id='btnModificar" + contadorRegistrosLineaAccion + "' onClick='getDate(" + row[0] + ")'>Modificar<a></td>"); html.Append("<td><a href='#' id='btnEliminar" + contadorRegistrosLineaAccion + "' onClick='getDate()'>Eliminar<a></td>"); html.Append("</tr>"); } //Table end. html.Append("</table>"); //Append the HTML string to Placeholder. ph_LineaAccion.Controls.Add(new Literal { Text = html.ToString() }); //PlaceHolderPrueba.Controls.Add(new Literal { Text = html.ToString() }); }
protected void btnGuardarLinea_Click(object sender, EventArgs e) { Alerta.Enabled = true; String strManLineaDescripcion = txtManLinea.Text; LineaAccionDao linDao = new LineaAccionDao(); if (linDao.insertLinea(strManLineaDescripcion) == "Ok") { Alerta.Text = "Se ha guardado correctamente"; } else { Alerta.Text = "No Se ha guardado correctamente"; } }
protected void btnGuardarLineaA_Click(object sender, EventArgs e) { int orderId = Convert.ToInt32(lbl_IdLineaAccionN.Text); LineaAccionDao linDao = new LineaAccionDao(); if (linDao.updateLineaAccion(orderId, vigencia) == "Ok") { Alerta.Text = "Datos Modificados en forma Correcta"; Response.Redirect("MantenedorLineaAccion"); } else { Alerta.Text = linDao.updateLineaAccion(orderId, vigencia); } }
protected void btnGuardarLineaAccion_Click(object sender, EventArgs e) { Alerta.Enabled = true; int manLineaAccionSubitem = int.Parse(ddlSubItem.SelectedItem.Value); String manLineaAccion = txtManLineaAccion.Text; LineaAccionDao linDao = new LineaAccionDao(); if (linDao.insertLinea(manLineaAccion, manLineaAccionSubitem) == "Ok") { Alerta.Text = "Se ha guardado correctamente"; Response.Redirect("MantenedorLineaAccion"); } else { Alerta.Text = linDao.insertLinea(manLineaAccion, manLineaAccionSubitem); } }
private void LoadEditData(int orderId) { lblIdLineaAccion.Text = Convert.ToString(orderId); LineaAccionDao linDao = new LineaAccionDao(); DataSet ds = new DataSet(); da = linDao.getLineaAccionId(orderId); DataTable dt = new DataTable(); dt = linDao.getTableLineaAccionId(); foreach (DataRow row in dt.Rows) { lbl_IdLineaAccionN.Text = row[0].ToString(); txt_DescripcionLineaAccion.Text = row[1].ToString(); txt_IdSubitem.Text = row[2].ToString(); txt_VigenciaLineaAccion.Text = row[3].ToString(); } }
void getTableLineaAccion() { LineaAccionDao linDao = new LineaAccionDao(); DataSet ds = new DataSet(); da = linDao.getLineaAccion(); da.Fill(ds); this.GV_lineaAccion.DataSource = ds; this.GV_lineaAccion.DataBind(); }