public static bool actualizarRegistro(eCAMBIO_DETALLE oeCAMBIO_DETALLE) { ValidationResult result = _balCAMBIO_DETALLE.Validate(oeCAMBIO_DETALLE); bool flag = false; if (result.IsValid) { if (_dalCAMBIO_DETALLE.obtenerRegistro(oeCAMBIO_DETALLE).Rows.Count > 0) { if (_dalCAMBIO_DETALLE.actualizarRegistro(oeCAMBIO_DETALLE)) { flag = true; } else { throw new CustomException("El registro no se pudo actualizar."); } } else { throw new CustomException("El registro que desea actualizar no existe."); } } else { throw new CustomException(CustomException.getMensajeList(result)); } return(flag); }
public static bool insertarRegistro(eDETALLE_IMPUESTO oeDETALLE_IMPUESTO) { ValidationResult result = _balDETALLE_IMPUESTO.Validate(oeDETALLE_IMPUESTO); bool flag = false; if (result.IsValid) { if (_dalDETALLE_IMPUESTO.obtenerRegistro(oeDETALLE_IMPUESTO).Rows.Count == 0) { if (_dalDETALLE_IMPUESTO.insertarRegistro(oeDETALLE_IMPUESTO)) { flag = true; } else { throw new CustomException("El registro no se pudo insertar."); } } else { throw new CustomException("El registro que desea insertar ya existe."); } } else { throw new CustomException(CustomException.getMensajeList(result)); } return(flag); }
public static bool insertarRegistro(eMOTIVO_DEVOLUCION oeMOTIVO_DEVOLUCION) { ValidationResult result = _balMOTIVO_DEVOLUCION.Validate(oeMOTIVO_DEVOLUCION); bool flag = false; if (result.IsValid) { if (_dalMOTIVO_DEVOLUCION.obtenerRegistro(oeMOTIVO_DEVOLUCION).Rows.Count == 0) { if (_dalMOTIVO_DEVOLUCION.insertarRegistro(oeMOTIVO_DEVOLUCION)) { flag = true; } else { throw new CustomException("El registro no se pudo insertar."); } } else { throw new CustomException("El registro que desea insertar ya existe."); } } else { throw new CustomException(CustomException.getMensajeList(result)); } return(flag); }
public static bool actualizarRegistroMaestroDetalle(eCOMPRA oeCOMPRA, List <eDETALLE_COMPRA> oeDETALLE_COMPRA) { bool bandera = true; bool flag = false; ValidationResult result = _balCOMPRA.Validate(oeCOMPRA); for (int i = 0; i < oeDETALLE_COMPRA.Count; i++) { eDETALLE_COMPRA o = new eDETALLE_COMPRA(); o = oeDETALLE_COMPRA[i]; ValidationResult result2 = _balDETALLE_COMPRA.Validate(o); if (!result2.IsValid) { bandera = false; } } if (bandera && result.IsValid) { if (_dalCOMPRA.obtenerRegistro(oeCOMPRA).Rows.Count > 0) { if (_dalCOMPRA.actualizarRegistroMaestroDetalle(oeCOMPRA, oeDETALLE_COMPRA)) { flag = true; } else { throw new CustomException("El registro no se pudo actualizar."); } } else { throw new CustomException("El registro que desea actualizar no existe."); } } else { throw new CustomException(CustomException.getMensajeList(result)); } return(flag); }
public static bool insertarRegistroMaestroDetalle(eVENTA oeVENTA, List <eDETALLE_VENTA> oeDETALLE_VENTA) { bool bandera = true; bool flag = false; ValidationResult result = _balVENTA.Validate(oeVENTA); for (int i = 0; i < oeDETALLE_VENTA.Count; i++) { eDETALLE_VENTA o = new eDETALLE_VENTA(); o = oeDETALLE_VENTA[i]; ValidationResult result2 = _balDETALLE_VENTA.Validate(o); if (!result2.IsValid) { bandera = false; } } if (bandera && result.IsValid) { if (_dalVENTA.obtenerRegistro(oeVENTA).Rows.Count == 0) { if (_dalDETALLE_VENTA.insertarRegistroMaestroDetalle(oeVENTA, oeDETALLE_VENTA)) { flag = true; } else { throw new CustomException("El registro no se pudo insertar."); } } else { throw new CustomException("El registro que desea insertar ya existe."); } } else { throw new CustomException(CustomException.getMensajeList(result)); } return(flag); }
public static bool actualizarFila(eDETALLE_IMPUESTO oeDETALLE_IMPUESTO) { ValidationResult result = _balDETALLE_IMPUESTO.Validate(oeDETALLE_IMPUESTO); bool flag = false; if (result.IsValid) { if (_dalDETALLE_IMPUESTO.actualizarFila(oeDETALLE_IMPUESTO)) { flag = true; } else { throw new CustomException("El registro que desea insertar ya existe."); } } else { throw new CustomException(CustomException.getMensajeList(result)); } return(flag); }