<commit_before>﻿using revashare_svc_webapi.Logic.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using revashare_svc_webapi.Logic.Models;
using revashare_svc_webapi.Logic.RevaShareServiceReference;
using revashare_svc_webapi.Logic.Mappers;

namespace revashare_svc_webapi.Logic
{
    public class AdminLogic : IAdminLogic
    {
        private RevaShareDataServiceClient dataClient = new RevaShareDataServiceClient();

        #region Admin CRUD Methods
        public bool InsertAdmin(UserDTO adminToAdd)
        {
            /* --- Waiting on WCF Function ---
            var newAdmin = UserMapper.mapToUserDAO(adminToAdd);

            if(dataClient.AddAdmin(newAdmin))
            {
                return true;
            }

            return false;
            */

            return true;
        }

        public List<UserDTO> RequestAdmins()
        {
            /* --- Waiting on WCF Function ---
            List<UserDTO> requestedAdmins = new List<UserDTO>();

            foreach (var user in dataClient.GetAdmins())
            {
                var admin = UserMapper.mapToUserDTO(user);
                requestedAdmins.Add(admin);
            }

            return requestedAdmins;
            */

            return new List<UserDTO>();
        }

        public bool ModifyAdmin(UserDTO adminToUpdate)
        {
            var updataUser = UserMapper.mapToUserDAO(adminToUpdate);

            if(dataClient.UpdateUser(updataUser))
            {
                return true;
            }

            return false;
        }

        public bool DeleteAdmin(UserDTO adminToRemove)
        {
            return true;
        }
        #endregion

        #region Driver CRUD Methods
        public bool InsertDriver(UserDTO driverToAdd)
        {
            return true;
        }

        public List<UserDTO> RequestDrivers()
        {
            return new List<UserDTO>();
        }

        public bool ModifyDriver(UserDTO driverToUpdate)
        {
            return true;
        }<commit_msg>Add Delete Admin Logic [#136384749]<commit_after>﻿using revashare_svc_webapi.Logic.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using revashare_svc_webapi.Logic.Models;
using revashare_svc_webapi.Logic.RevaShareServiceReference;
using revashare_svc_webapi.Logic.Mappers;

namespace revashare_svc_webapi.Logic
{
    public class AdminLogic : IAdminLogic
    {
        private RevaShareDataServiceClient dataClient = new RevaShareDataServiceClient();

        #region Admin CRUD Methods
        public bool InsertAdmin(UserDTO adminToAdd)
        {
            /* --- Waiting on WCF Function ---
            var newAdmin = UserMapper.mapToUserDAO(adminToAdd);

            if(dataClient.AddAdmin(newAdmin))
            {
                return true;
            }

            return false;
            */

            return true;
        }

        public List<UserDTO> RequestAdmins()
        {
            /* --- Waiting on WCF Function ---
            List<UserDTO> requestedAdmins = new List<UserDTO>();

            foreach (var user in dataClient.GetAdmins())
            {
                var admin = UserMapper.mapToUserDTO(user);
                requestedAdmins.Add(admin);
            }

            return requestedAdmins;
            */

            return new List<UserDTO>();
        }

        public bool ModifyAdmin(UserDTO adminToUpdate)
        {
            var updataUser = UserMapper.mapToUserDAO(adminToUpdate);

            if (dataClient.UpdateUser(updataUser))
            {
                return true;
            }

            return false;
        }

        public bool DeleteAdmin(UserDTO adminToRemove)
        {
            return dataClient.DeleteUser(adminToRemove.UserName);
        }
        #endregion

        #region Driver CRUD Methods
        public bool InsertDriver(UserDTO driverToAdd)
        {
            return true;
        }

        public List<UserDTO> RequestDrivers()
        {
            return new List<UserDTO>();
        }

        public bool ModifyDriver(UserDTO driverToUpdate)
        {
            return true;
        }
{'fraction_non_alphanumeric': 0.07507015902712816, 'fraction_numerical': 0.002104770813844715, 'mean_word_length': 1.7346547314578005, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '530733', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1166, 'n_words': 239}