/// <summary> /// Metodo que elimina el precio seleccionado en la tabla /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEliminar_Click(object sender, EventArgs e) { IBLLPrecioEnvio _BLLPrecioKilometro = new BLLPrecioEnvio(); try { if (string.IsNullOrEmpty(dgvPrecios.SelectedRows[0].Cells[0].Value.ToString())) { erpErrores.SetError(dgvPrecios, "Debe seleccionar un item de la tabla"); } else { _BLLPrecioKilometro.BorrarEnvio(dgvPrecios.SelectedRows[0].Cells[0].Value.ToString()); MessageBox.Show("Se eliminó con éxito"); } } catch (Exception er) { StringBuilder msg = new StringBuilder(); msg.AppendFormat("Message {0}\n", er.Message); msg.AppendFormat("Source {0}\n", er.Source); msg.AppendFormat("InnerException {0}\n", er.InnerException); msg.AppendFormat("StackTrace {0}\n", er.StackTrace); msg.AppendFormat("TargetSite {0}\n", er.TargetSite); _MyLogControlEventos.ErrorFormat("Error {0}", msg.ToString()); MessageBox.Show("Se ha producido el siguiente error " + er.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void EliminarPrecio() { IBLLPrecioEnvio _BLLPrecioEnvio = new BLLPrecioEnvio(); string IDEnvio = "T"; string pEnvio = ""; pEnvio = _BLLPrecioEnvio.BorrarEnvio(IDEnvio); System.Diagnostics.Debug.Write(pEnvio); }