public String userLogIn(BLSystemUser userSystem)
        {
            DAOSystemUser dsu  = new DAOSystemUser();
            SystemUser    user = new SystemUser(userSystem.SystemUserName, userSystem.SystemUserPassword, userSystem.SystemUserRole);

            String result = dsu.checkUserCredentials(user);

            return(result);
        }
        public List <BLSystemUser> SystemUserList()
        {
            DAOSystemUser       Ds      = new DAOSystemUser();
            List <SystemUser>   list    = Ds.UserList();
            List <BLSystemUser> auxList = new List <BLSystemUser>();

            foreach (SystemUser user in list)
            {
                BLSystemUser auxUser = new BLSystemUser(user.SystemUserName, user.SystemUserPassword, user.SystemUserRole);
                auxList.Add(auxUser);
            }
            return(auxList);
        }
        public BLSystemUser ChargeUser(string code)
        {
            DAOSystemUser dv = new DAOSystemUser();

            if (!dv.checkNameUser(code))
            {
                SystemUser user = dv.ChargeUser(code);
                return(new BLSystemUser(user.SystemUserName, user.SystemUserPassword, user.SystemUserRole));
            }
            else
            {
                return(null);
            }
        }
        public bool addUser(BLSystemUser user)
        {
            DAOSystemUser dv     = new DAOSystemUser();
            SystemUser    toUser = new SystemUser()
            {
                SystemUserName = user.SystemUserName, SystemUserPassword = user.SystemUserPassword, SystemUserRole = user.SystemUserRole
            };

            if (dv.checkNameUser(toUser.SystemUserName))
            {
                dv.addUser(toUser);
                return(true);
            }
            return(false);
        }
        public void updateUser(BLSystemUser user)
        {
            List <BLSystemUser> list = SystemUserList();
            DAOSystemUser       dv   = new DAOSystemUser();

            foreach (BLSystemUser item in list)
            {
                if (user.SystemUserName == item.SystemUserName)
                {
                    SystemUser toUser = new SystemUser()
                    {
                        SystemUserName = user.SystemUserName, SystemUserPassword = user.SystemUserPassword, SystemUserRole = user.SystemUserRole
                    };
                    dv.updateUser(toUser);
                    return;
                }
            }
        }
        public void deleteUser(string name)
        {
            DAOSystemUser user = new DAOSystemUser();

            user.DeleteUser(name);
        }