using pavesys_iRAP.Business;
using pavesys_iRAP.DTO;
using System;
using System.Linq;

namespace pavesys_iRAP.Helper
{
    class UserHelper
    {
        public int CountUser()
        {
            

            return CrudHelper.dbCtx.Users.Count();
        }

        public void InsertUser(string login, string name, string password)
        {
            User user = new User();
            user.Login = login;
            user.Name = name;
            user.Password = password;
            user.ProfileType = (short)ProfileType.ADMIN;
            user.Active = 1;

            
            CrudHelper.dbCtx.Users.Add(user);
            CrudHelper.dbCtx.SaveChanges();
        }
    }
}
