<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SysUt14Gr03.Classes;
using SysUt14Gr03.Models;

namespace SysUt14Gr03
{
    public partial class DeaktiveringAvRegistrerteTimer : System.Web.UI.Page
    {
        private int bruker_id;
        private List<Time> timeListe = null;
       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bruker_id = 2;
                timeListe = Queries.GetTimerForBruker((int)bruker_id);
                foreach (Time time in timeListe)
                {
                    Oppgave oppgListe = Queries.GetOppgave(time.Oppgave_id);
                    lbTimer.Visible = true;
                    lbTimer.Items.Add(new ListItem(time.Tid + " (t/m/s) : " + oppgListe.Tittel, oppgListe.Oppgave_id.ToString()));
                    // lblRegTimer.Text += "<br />" + time.Tid + " (t/m/s) " + oppgListe.Tittel + "\n";
                }
            }
        }

        protected void btnDeaktiver_Click(object sender, EventArgs e)
        {

        }

        protected void btnEndre_Click(object sender, EventArgs e)
        {
            lbEndre.Items.Clear();
            int oppg_id = Convert.ToInt32(lbTimer.SelectedValue);
            lbEndre.Visible = true;
            Oppgave oppg = Queries.GetOppgave(oppg_id);

            lbEndre.Items.Add(new ListItem(oppg.Tittel + " " + oppg.UserStory, oppg.Oppgave_id.ToString()));
        }

        protected void lbTimer_SelectedIndexChanged(object sender, EventArgs e)
        {
<commit_msg>Noen Endringer<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SysUt14Gr03.Classes;
using SysUt14Gr03.Models;

namespace SysUt14Gr03
{
    public partial class DeaktiveringAvRegistrerteTimer : System.Web.UI.Page
    {
        private int bruker_id;
        private List<Time> timeListe = null;
       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bruker_id = 2;
                timeListe = Queries.GetTimerForBruker((int)bruker_id);
                foreach (Time time in timeListe)
                {
                    Oppgave oppgListe = Queries.GetOppgave(time.Oppgave_id);
                    lbTimer.Visible = true;
                    lbTimer.Items.Add(new ListItem(time.Tid + " (t/m/s) : " + oppgListe.Tittel, time.Time_id.ToString()));
                    // lblRegTimer.Text += "<br />" + time.Tid + " (t/m/s) " + oppgListe.Tittel + "\n";
                }
            }
        }

        protected void btnDeaktiver_Click(object sender, EventArgs e)
        {

            using (var context = new Context())
            {
                int time_id = Convert.ToInt32(lbTimer.SelectedValue);

                var timer = (from time in context.Timer
                            where time.Time_id == time_id
                            select time).FirstOrDefault();
                timer.Aktiv = false;
                context.SaveChanges();
            }

        }

        protected void btnEndre_Click(object sender, EventArgs e)
        {
            lbEndre.Items.Clear();
            int oppg_id = Convert.ToInt32(lbTimer.SelectedValue);
            lbEndre.Visible = true;
            Oppgave oppg = Queries.GetOppgave(oppg_id);

            lbEndre.Items.Add(new ListItem(oppg.Tittel + " " + oppg.UserStory, oppg.Oppgave_id.ToString()));
        }

        protected void lbTimer_SelectedIndexChanged(object sender, EventArgs e)
        {

{'fraction_non_alphanumeric': 0.09752821063944116, 'fraction_numerical': 0.008597528210639442, 'mean_word_length': 1.8161875945537065, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '375486', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1110, 'n_words': 211}