private void btnActivate_Click(object sender, EventArgs e) { string DescripPrice = txtDescripPrice.Text; int Row = dgvPriceTag.CurrentRow.Index; int IdPriceTag = Convert.ToInt32(dgvPriceTag[0, Row].Value); if (dgvPriceTag[1, Row].Value == null || string.IsNullOrEmpty(DescripPrice.Trim())) { MetroMessageBox.Show(this, "Debe Seleccionar Al menos Algún Valor para Inactivar. \n Favor Intentelo Nuevamente", "Error en Validación", MessageBoxButtons.OK, MessageBoxIcon.Error); dgvPriceTag.Focus(); return; } else { if (MetroFramework.MetroMessageBox.Show(this, "¿Desea Eliminar el Precio : " + DescripPrice + "?", "Confirmación de Acción", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { try { ObjPrice.ID_Product = IdPriceTag; ObjPrice.IdSession = pIdSession; ApiAccess.ActivateProduct(ObjPrice); } catch (Exception) { throw; } CleanFields(); LoadDataGrid(); } } }