public void Elimina(CommimentBE pItem)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    CommimentDL       Commiment       = new CommimentDL();
                    CommimentDetailDL CommimentDetail = new CommimentDetailDL();

                    //Client SENSOR
                    List <CommimentDetailBE> lstCommimentDetail = null;
                    lstCommimentDetail = new CommimentDetailDL().ListaTodosActivo(pItem.IdCommiment);

                    foreach (var item in lstCommimentDetail)
                    {
                        CommimentDetail.Elimina(item);
                    }

                    Commiment.Elimina(pItem);

                    ts.Complete();
                }
            }
            catch (Exception ex)
            { throw ex; }
        }
        public Int32 Inserta(CommimentBE pItem, List <CommimentDetailBE> pListaCommimentDetail)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    CommimentDL       Commiment       = new CommimentDL();
                    CommimentDetailDL CommimentDetail = new CommimentDetailDL();

                    int IdCommiment = 0;
                    IdCommiment = Commiment.Inserta(pItem);

                    foreach (var item in pListaCommimentDetail)
                    {
                        item.IdCommiment = IdCommiment;
                        CommimentDetail.Inserta(item);
                    }

                    ts.Complete();

                    return(IdCommiment);
                }
            }
            catch (Exception ex)
            { throw ex; }
        }
        public void Actualiza(CommimentBE pItem, List <CommimentDetailBE> pListaCommimentDetail)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    CommimentDL       Commiment       = new CommimentDL();
                    CommimentDetailDL CommimentDetail = new CommimentDetailDL();

                    foreach (var item in pListaCommimentDetail)
                    {
                        if (item.TipoOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo
                        {
                            item.IdCommiment = pItem.IdCommiment;
                            CommimentDetail.Inserta(item);
                        }
                        else
                        {
                            CommimentDetail.Actualiza(item);
                        }
                    }


                    Commiment.Actualiza(pItem);

                    ts.Complete();
                }
            }
            catch (Exception ex)
            { throw ex; }
        }
Beispiel #4
0
 public void Elimina(CommimentDetailBE pItem)
 {
     try
     {
         CommimentDetailDL CommimentDetail = new CommimentDetailDL();
         CommimentDetail.Elimina(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
Beispiel #5
0
 public void Actualiza(CommimentDetailBE pItem)
 {
     try
     {
         CommimentDetailDL CommimentDetail = new CommimentDetailDL();
         CommimentDetail.Actualiza(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
Beispiel #6
0
 public List <CommimentDetailBE> ListaTodosActivo(int Client)
 {
     try
     {
         CommimentDetailDL CommimentDetail = new CommimentDetailDL();
         return(CommimentDetail.ListaTodosActivo(Client));
     }
     catch (Exception ex)
     { throw ex; }
 }
Beispiel #7
0
 public CommimentDetailBE Selecciona(int IdCommimentDetail)
 {
     try
     {
         CommimentDetailDL CommimentDetail = new CommimentDetailDL();
         CommimentDetailBE objEmp          = CommimentDetail.Selecciona(IdCommimentDetail);
         return(objEmp);
     }
     catch (Exception ex)
     { throw ex; }
 }