protected void btnModificar_Click(object sender, EventArgs e) { if (!ValidarCamposMod()) { return; } NavesBO nave = new NavesBO(); string codigo = txtCodMod.Text; string nombre = txtNomMod.Text; nave.Nav_cod = codigo; nave.Nav_nom = nombre; DataTable dt = new DataTable(); try { dt = new NavesBLL().sp_updt_navesBll(nave); } catch (Exception ex) { var visibilityClass = "alert alert-danger"; var style = "display:block;"; mensajeError.Attributes["class"] = visibilityClass; mensajeError.Attributes["style"] = style; cv_Resultado.Text = "Ocurrio un error al cargar los datos: " + ex.Message; } limpiarFormulario(); Response.Redirect("NavesDesc.aspx"); }
public static void EliminarNave(ref GlobalResponse globalResponse, string codigo) { NavesBO nave = new NavesBO(); nave.Nav_cod = codigo; DataTable dt = new DataTable(); try { dt = new NavesBLL().sp_del_navesBLL(nave); } catch (Exception ex) { globalResponse.Message = ex.Message; globalResponse.HasError = true; } }
public static void GuardarNaveEdit(ref GlobalResponse globalresponse, string codigo, string descripcion) { NavesBO nave = new NavesBO(); nave.Nav_cod = codigo; nave.Nav_nom = descripcion; DataTable dt = new DataTable(); try { dt = new NavesBLL().sp_updt_navesBll(nave); } catch (Exception ex) { globalresponse.Message = ex.Message; globalresponse.HasError = true; } }
public List <NavesBO> ObtNaves(ref GlobalResponse globalResponse) { var naves = new List <NavesBO>(); try { var resultados = new NavesBLL().sp_sel_navesBLL(); naves.AddRange(from DataRow row in resultados.Rows select new NavesBO { Nav_cod = row[0].ToString(), Nav_nom = row[1].ToString() }); } catch (Exception ex) { globalResponse.Message = ex.Message; globalResponse.HasError = true; } return(naves); }
public NavesBO EditarNaves(ref GlobalResponse globalResponse, string codigo) { DataTable dt = new DataTable(); NavesBO nave = new NavesBO(); try { dt = new NavesBLL().sp_sel_naveIDBLL(codigo); nave.Nav_cod = dt.Rows[0].ItemArray[0].ToString(); nave.Nav_nom = dt.Rows[0].ItemArray[1].ToString(); } catch (Exception ex) { globalResponse.Message = ex.Message; globalResponse.HasError = true; } return(nave); }
public static Dictionary <string, string> modificarNave(string codigo) { DataTable dt = new DataTable(); try { dt = new NavesBLL().sp_sel_naveIDBLL(codigo); } catch (Exception ex) { throw ex; } Dictionary <string, string> nave = new Dictionary <string, string>(); nave.Add("Cod_nave", dt.Rows[0].ItemArray[0].ToString()); nave.Add("Nom_nave", dt.Rows[0].ItemArray[1].ToString()); return(nave); }
public static string eliminarNaves(string codigo) { DataTable dt = new DataTable(); NavesBO nav = new NavesBO(); nav.Nav_cod = codigo; try { dt = new NavesBLL().sp_del_navesBLL(nav); } catch (Exception ex) { throw ex; } string codstring = dt.Rows[0].ItemArray[0].ToString(); return(codstring); }
private void cargarGrilla() { StringBuilder strblVideo = new StringBuilder(); Literal lTabla = new Literal(); string tabla = string.Empty; DataTable dt = new DataTable(); dt = new NavesBLL().sp_sel_navesBLL(); strblVideo.Append("<thead>"); strblVideo.Append("<th>ELIMINAR</th>"); strblVideo.Append("<th>EDITAR</th>"); strblVideo.Append("<th>CODIGO</th>"); strblVideo.Append("<th>NOMBRE</th>"); strblVideo.Append("</thead>"); strblVideo.Append("<tbody>"); foreach (DataRow row in dt.Rows) { strblVideo.Append("<tr class=odd gradeX>"); strblVideo.Append("<td><button id=" + row["cod_nave"] + " runat=\"server\" onclick=\"eliminar(this.id); \" class=\"btn red\" >" + "<i class=\"fa fa-trash-o\"></i></button>" + "</td>"); strblVideo.Append("<td><button id=" + row["cod_nave"] + " runat=\"server\" onclick=\"modificar(this.id);\" class=\"btn blue\" >" + "<i class=\"fa fa-edit\"></i></button>" + "</td>"); strblVideo.Append("<td>" + row["cod_nave"] + "</td>"); strblVideo.Append("<td>" + row["gls_nombre_nave"] + "</td>"); strblVideo.Append("</tr>"); } strblVideo.Append("</tbody>"); tabla = strblVideo.ToString(); lTabla.Text = tabla; pnlTablaVideos.Controls.Add(lTabla); pnlTablaVideos.Visible = true; UpdatePanel1.Update(); UpdatePanel1.Visible = true; }