public DataSet GetAll(string empresaid, tb_pp_hojacostorubro BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPpHojacostorubro_SEARCH", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@articid", SqlDbType.Char, 4).Value = BE.articid; cmd.Parameters.Add("@version", SqlDbType.Char, 3).Value = BE.version; //cmd.Parameters.Add("@rubroid", SqlDbType.Char, 2).Value = BE.rubroid; //cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid; //cmd.Parameters.Add("@importe", SqlDbType.Decimal).Value = BE.importe; //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_pp_hojacostorubro BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPpHojacostorubro_DELETE", cnx)) { { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@articid", SqlDbType.Char, 4).Value = BE.articid; cmd.Parameters.Add("@version", SqlDbType.Char, 3).Value = BE.version; cmd.Parameters.Add("@rubroid", SqlDbType.Char, 2).Value = BE.rubroid; cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid; } try { cnx.Open(); if (cmd.ExecuteNonQuery() > 0) { return true; } else { return false; } } catch (Exception ex) { throw new Exception(ex.Message); } } } }
private void CargarDetalle2() { var BL = new tb_pp_hojacostorubroBL(); var BE = new tb_pp_hojacostorubro(); TablaCostoRubro = new DataTable(); BE.articid = articid.Text.Trim(); BE.version = version.Text.Trim(); TablaCostoRubro = BL.GetAll(EmpresaID, BE).Tables[0]; if (TablaCostoRubro.Rows.Count > 0) { dgb_hojacostorubro.DataSource = TablaCostoRubro; } else { dgb_hojacostorubro.DataSource = TablaCostoRubro; } }
public bool Update(string empresaid, tb_pp_hojacostorubro BE) { return tablaDA.Update(empresaid, BE); }
public bool Insert(string empresaid, tb_pp_hojacostorubro BE) { return tablaDA.Insert(empresaid, BE); }
public DataSet GetAll(string empresaid, tb_pp_hojacostorubro BE) { return tablaDA.GetAll(empresaid, BE); }