Пример #1
0
        protected void adddirectorbutton_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("Adding a director");
            if (DirectorDropdownBox.Entries.Count > 0)
            {
                int p_persoon = Convert.ToInt32(DirectorDropdownBox.Entries[0].Value);
                CumulatieDataContext cumul = new CumulatieDataContext();

                Debug.WriteLine(p_persoon);

                PA_Access pAdmin = new PA_Access();
                pAdmin.access = "01";
                pAdmin.p_persoon = p_persoon;
                pAdmin.wog = OwgDropdownList.SelectedValue;

                cumul.PA_Accesses.InsertOnSubmit(pAdmin);
                cumul.SubmitChanges();

                Debug.WriteLine("Databinding");
                wogDirectors.DataBind();
            }
        }
Пример #2
0
        protected void addpersonalbutton_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("Adding a personel manager");
            if (personeelsledendropbox.Entries.Count > 0)
            {
                Debug.WriteLine("Value found");
                int p_persoon = Convert.ToInt32(personeelsledendropbox.Entries[0].Value);
                CumulatieDataContext cumul = new CumulatieDataContext();

                PA_Access pAdmin = new PA_Access();
                pAdmin.access = "00";
                pAdmin.p_persoon = p_persoon;
                pAdmin.wog = "HSD";

                Debug.WriteLine(p_persoon);

                cumul.PA_Accesses.InsertOnSubmit(pAdmin);
                cumul.SubmitChanges();

                personelAdmins.DataBind();
            }
        }
        protected void finalConfirmButton_Click(object sender, EventArgs e)
        {
            _log.Debug("Opslaan ingevoerde activiteiten");
            CumulatieDataContext cumul = new CumulatieDataContext();

            var activities = cumul.PA_NevenActiviteitens.Where(p => p.p_persoon.Equals(this.p_persoon));
            _log.Debug("Nieuwe context opgehaald");
            foreach (var activity in activities)
            {
                activity.bevestigd = true;
                activity.nieuw_jaar = false;
                //Enkel omdat dit veld vorig jaar ontbrak. Als een OP'er gewoon dezelfde aanvraag bevestigd moet dit veld toch ingevuld worden. Tijdeleijke opvang hiervoor.
                if(activity.type == "OP" && activity.type_activiteit_op == null)
                {
                    activity.type_activiteit_op = AddActivityOp();
                }
            }
            _log.Debug("Wijzigingen opslaan");
            cumul.SubmitChanges();

            _log.Debug("Lay out updaten");
            ConfirmedActivitiesPanel.Visible = true;
            DisableSelections();

            NieuwJaarPanel.Visible = false;
            atpContainer.Visible = false;
            opContainer.Visible = false;
            //HideDeleteColumn();
            _log.Info("User confirmed added activities");
            Response.Redirect("NevenActiviteit.aspx");
        }