public bool InsertUserAccess(string empId, string accessPointId, string accesslevel)
        {
            try
            {
                AccessLevel level = AccessLevel.None;
                if (accesslevel.ToLower().Contains("access") || accesslevel.ToLower().Contains("allow"))
                    level = AccessLevel.Access;
                else if (accesslevel.ToLower().Contains("manage"))
                    level = AccessLevel.Manage;
                else if (accesslevel.ToLower().Contains("monitor"))
                    level = AccessLevel.Monitor;

                UserAccessDTO dto = new UserAccessDTO { AccessLevelId = (int)level, AccessPointId = int.Parse(accessPointId), EmployeeId = int.Parse(empId) };
                return AccessPointDataService.InsertAccessPointPermission(dto) > 0;
            }
            catch(Exception ex)
            {
                return false;
            }
        }
        public int InsertAccessPointPermission(UserAccessDTO accessDetails)
        {
            const string command = @"INSERT INTO UserPermissions (EmployeeId, AccessPointId, AccessTypeId)
                                        VALUES(@empId, @accessId, @accessTypeId)";

            var effectedRows = 0;
            try
            {
                using (var conn = SqlHelper.GetConnection())
                {
                    SqlCommand cmd = CommandFactory.CreateSimpleTextCommand(conn, command);
                    SqlParameter unParam = cmd.Parameters.AddWithValue("@empId", accessDetails.EmployeeId);
                    SqlParameter psParam = cmd.Parameters.AddWithValue("@accessId", accessDetails.AccessPointId);
                    SqlParameter atParam = cmd.Parameters.AddWithValue("@accessTypeId", accessDetails.AccessLevelId);

                    effectedRows = cmd.ExecuteNonQuery();
                }
            }
            catch (Exception ex)
            {
                //log later
            }
            return effectedRows;
        }