예제 #1
0
 public List <AccessBE> SeleccionaPerfil(int IdProfile)
 {
     try
     {
         AccessDL Access = new AccessDL();
         return(Access.SeleccionaPerfil(IdProfile));
     }
     catch (Exception ex)
     { throw ex; }
 }
예제 #2
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;
            }
        }