public void Actualiza(ProgramProductionBE pItem, List <ProgramProductionDetailBE> pListaProgramProductionDetail) { try { using (TransactionScope ts = new TransactionScope()) { ProgramProductionDL ProgramProduction = new ProgramProductionDL(); ProgramProductionDetailDL ProgramProductionDetail = new ProgramProductionDetailDL(); foreach (var item in pListaProgramProductionDetail) { if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo { item.IdProgramProduction = pItem.IdProgramProduction; ProgramProductionDetail.Inserta(item); } else { ProgramProductionDetail.Actualiza(item); } } ProgramProduction.Actualiza(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public void Elimina(ProgramProductionBE pItem) { try { using (TransactionScope ts = new TransactionScope()) { ProgramProductionDL ProgramProduction = new ProgramProductionDL(); ProgramProductionDetailDL ProgramProductionDetail = new ProgramProductionDetailDL(); //Client SENSOR List <ProgramProductionDetailBE> lstProgramProductionDetail = null; lstProgramProductionDetail = new ProgramProductionDetailDL().ListaTodosActivo(pItem.IdProgramProduction); foreach (var item in lstProgramProductionDetail) { ProgramProductionDetail.Elimina(item); } ProgramProduction.Elimina(pItem); ts.Complete(); } } catch (Exception ex) { throw ex; } }
public Int32 Inserta(ProgramProductionBE pItem, List <ProgramProductionDetailBE> pListaProgramProductionDetail) { try { using (TransactionScope ts = new TransactionScope()) { ProgramProductionDL ProgramProduction = new ProgramProductionDL(); ProgramProductionDetailDL ProgramProductionDetail = new ProgramProductionDetailDL(); int IdProgramProduction = 0; IdProgramProduction = ProgramProduction.Inserta(pItem); foreach (var item in pListaProgramProductionDetail) { item.IdProgramProduction = IdProgramProduction; ProgramProductionDetail.Inserta(item); } ts.Complete(); return(IdProgramProduction); } } catch (Exception ex) { throw ex; } }
public void Elimina(ProgramProductionDetailBE pItem) { try { ProgramProductionDetailDL ProgramProductionDetail = new ProgramProductionDetailDL(); ProgramProductionDetail.Elimina(pItem); } catch (Exception ex) { throw ex; } }
public List <ProgramProductionDetailBE> ListaNumberPO(int IdClient, string NumberPO) { try { ProgramProductionDetailDL ProgramProductionDetail = new ProgramProductionDetailDL(); return(ProgramProductionDetail.ListaNumberPO(IdClient, NumberPO)); } catch (Exception ex) { throw ex; } }
public List <ProgramProductionDetailBE> ListaTodosActivo(int IdProgramProduction) { try { ProgramProductionDetailDL ProgramProductionDetail = new ProgramProductionDetailDL(); return(ProgramProductionDetail.ListaTodosActivo(IdProgramProduction)); } catch (Exception ex) { throw ex; } }
public ProgramProductionDetailBE Selecciona(int IdProgramProductionDetail) { try { ProgramProductionDetailDL ProgramProductionDetail = new ProgramProductionDetailDL(); ProgramProductionDetailBE objEmp = ProgramProductionDetail.Selecciona(IdProgramProductionDetail); return(objEmp); } catch (Exception ex) { throw ex; } }