Пример #1
0
 public List <ProfileBE> ListaTodosActivo()
 {
     try
     {
         ProfileDL Profile = new ProfileDL();
         return(Profile.ListaTodosActivo());
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #2
0
 public ProfileBE Selecciona(int idProfile)
 {
     try
     {
         ProfileDL Profile = new ProfileDL();
         return(Profile.Selecciona(idProfile));
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #3
0
 public void Elimina(ProfileBE pItem)
 {
     try
     {
         ProfileDL Profile = new ProfileDL();
         Profile.Elimina(pItem);
     }
     catch (Exception ex)
     { throw ex; }
 }
Пример #4
0
        public void Inserta(ProfileBE pItem, List <AccessBE> pListaAccess)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    ProfileDL objProfile   = new ProfileDL();
                    AccessDL  objAccess    = new AccessDL();
                    Int32     intIdProfile = 0;

                    intIdProfile = objProfile.Inserta(pItem);
                    foreach (AccessBE item in pListaAccess)
                    {
                        if (item.TipOper == Convert.ToInt32(Operacion.Nuevo)) //Nuevo
                        {
                            item.IdProfile = intIdProfile;
                            item.Login     = pItem.Login;
                            item.Machine   = pItem.Machine;
                            item.IdCompany = pItem.IdCompany;
                            objAccess.Inserta(item);
                        }

                        if (item.TipOper == Convert.ToInt32(Operacion.Modificar)) //Modificar
                        {
                            item.Login     = pItem.Login;
                            item.Machine   = pItem.Machine;
                            item.IdCompany = pItem.IdCompany;
                            objAccess.Actualiza(item);
                        }

                        if (item.TipOper == Convert.ToInt32(Operacion.Eliminar)) //Eliminar
                        {
                            item.Login     = pItem.Login;
                            item.Machine   = pItem.Machine;
                            item.IdCompany = pItem.IdCompany;
                            objAccess.Elimina(item);
                        }
                    }
                    ts.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }