public DataSet GetAll(string empresaid, tb_pt_componentes BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPtComponentes_SEARCH", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@componenteid", SqlDbType.Char, 6).Value = BE.componenteid; cmd.Parameters.Add("@componentename", SqlDbType.VarChar, 80).Value = BE.componentename; cmd.Parameters.Add("@componenteabrev", SqlDbType.VarChar, 20).Value = BE.componenteabrev; cmd.Parameters.Add("@usuar", SqlDbType.Char, 15).Value = BE.usuar; } try { cnx.Open(); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(ds); } return ds; } catch (Exception ex) { throw new Exception(ex.Message); } } } }
public bool Delete(string empresaid, tb_pt_componentes BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPtComponentes_DELETE", cnx)) { { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@componenteid", SqlDbType.Char, 6).Value = BE.componenteid; } try { cnx.Open(); if (cmd.ExecuteNonQuery() > 0) { return true; } else { return false; } } catch (Exception ex) { throw new Exception(ex.Message); } } } }
public bool Update(string empresaid, tb_pt_componentes BE) { return tablaDA.Update(empresaid, BE); }
public bool Insert(string empresaid, tb_pt_componentes BE) { return tablaDA.Insert(empresaid, BE); }
public DataSet GetAll(string empresaid, tb_pt_componentes BE) { return tablaDA.GetAll(empresaid, BE); }
public bool Update(string empresaid, tb_pt_componentes BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPtComponentes_UPDATE", cnx)) { { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@componenteid", SqlDbType.Char, 6).Value = BE.componenteid; cmd.Parameters.Add("@componentename", SqlDbType.VarChar, 80).Value = BE.componentename; cmd.Parameters.Add("@componenteabrev", SqlDbType.VarChar, 20).Value = BE.componenteabrev; cmd.Parameters.Add("@orden", SqlDbType.Decimal).Value = BE.orden; cmd.Parameters.Add("@usuar", SqlDbType.Char, 15).Value = BE.usuar; } try { cnx.Open(); if (cmd.ExecuteNonQuery() > 0) { return true; } else { return false; } } catch (Exception ex) { throw new Exception(ex.Message); } } } }