public static bool InsertPrecioDeVenta(PrecioDeVenta _precio) { bool exito = false; try { ValidarDatos(_precio); exito = DAO.AgregarDao.InsertPrecioDeVenta(_precio); } catch (Exception ex) { } return(exito); }
public static bool InsertPrecioDeVenta(PrecioDeVenta _precio) { bool exito = false; if (_precio.Precio > 0) { exito = InsertarPrecioVenta(_precio.idProducto, _precio.Precio, _precio.FechaActual, _precio.idUsuario); } else { exito = false; } return(exito); }
private static void ValidarDatos(PrecioDeVenta _precio) { var precio = Convert.ToString(_precio.Precio); if (precio == "0") { const string message = "El campo precio es obligatorio."; const string caption = "Error"; var result = MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); throw new Exception(); } }