public void Actualiza(InspectionCertificateBE pItem, List <InspectionCertificateDetailBE> pListaInspectionCertificateDetail) { try { using (TransactionScope ts = new TransactionScope()) { InspectionCertificateDL InspectionCertificate = new InspectionCertificateDL(); InspectionCertificateDetailDL InspectionCertificateDetail = new InspectionCertificateDetailDL(); foreach (var item in pListaInspectionCertificateDetail) { if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo { item.IdInspectionCertificate = pItem.IdInspectionCertificate; InspectionCertificateDetail.Inserta(item); } else { InspectionCertificateDetail.Actualiza(item); } } InspectionCertificate.Actualiza(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public Int32 Inserta(InspectionCertificateBE pItem, List <InspectionCertificateDetailBE> pListaInspectionCertificateDetail) { try { using (TransactionScope ts = new TransactionScope()) { InspectionCertificateDL InspectionCertificate = new InspectionCertificateDL(); InspectionCertificateDetailDL InspectionCertificateDetail = new InspectionCertificateDetailDL(); int IdInspectionCertificate = 0; IdInspectionCertificate = InspectionCertificate.Inserta(pItem); foreach (var item in pListaInspectionCertificateDetail) { item.IdInspectionCertificate = IdInspectionCertificate; InspectionCertificateDetail.Inserta(item); } ts.Complete(); return(IdInspectionCertificate); } } catch (Exception ex) { throw ex; } }
public void Inserta(InspectionCertificateDetailBE pItem) { try { InspectionCertificateDetailDL InspectionCertificateDetail = new InspectionCertificateDetailDL(); InspectionCertificateDetail.Inserta(pItem); } catch (Exception ex) { throw ex; } }