protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Global gl = new Global();
                CompCode.Text = gl.GetCompetitionCode();
                string CompCodeText = Request.QueryString.Get("Code");
                if ((CompCodeText != null) && (CompCodeText.Length > 1))
                {
                    CompCode.Text = CompCodeText;
                    gl.SetCompetitionCode(CompCode.Text);
                }
                Athl_Competition        CompetitionRec = new Athl_Competition();
                AthleticCompetitionCRUD AthlCRUD       = new AthleticCompetitionCRUD();
                CompetitionRec       = AthlCRUD.GetCompetitionRec(CompCode.Text);
                CompetitionName.Text = CompetitionRec.Name;

                ClubCode.Text = " ";
                string SelClub = Request.QueryString.Get("Club");
                if ((SelClub != null) && (SelClub.Length > 0))
                {
                    ClubCode.Text     = SelClub;
                    PageInfoText.Text = "Upplýsingar um félag: " + ClubCode.Text;
                }

                SelectedBibNo.Text = "0";
                string SelBib = Request.QueryString.Get("BibNo");
                if ((SelBib != null) && (SelBib.Length > 0))
                {
                    SelectedBibNo.Text = SelBib;
                    PageInfoText.Text  = "Upplýsingar um keppanda með rásnúmer: " + SelectedBibNo.Text;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                UpdateDatabase();
            }
            else
            {
                AthleticCompetitionCRUD AthlCRUD           = new AthleticCompetitionCRUD();
                Athl_Competition        AthlCompetitionRec = new Athl_Competition();
                string CompCode = gl.GetCompetitionCode();
                AthlCompetitionRec = AthlCRUD.GetCompetitionRec(CompCode);
                if ((AthlCompetitionRec.Staða_móts == 2) || (AthlCompetitionRec.Staða_móts == 4))
                {
                    SaveValues.Visible    = true;
                    SaveAndReturn.Visible = true;
                }
                else
                {
                    SaveValues.Visible    = false;
                    SaveAndReturn.Visible = false;
                }
            }

            LoadCompetitorsPage();
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();

            if (!IsPostBack)
            {
                CompCode.Text = gl.GetCompetitionCode();


                string CompCodeText = Request.QueryString.Get("Code");

                if ((CompCodeText != "") && (CompCodeText != null))
                {
                    CompCodeText = CompCodeText.ToUpper();
                    gl.SetCompetitionCode(CompCodeText);
                    CompCode.Text = CompCodeText;
                }

                AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
                Athl_Competition        AthlComp = new Athl_Competition();
                AthlComp             = AthlCRUD.GetCompetitionRec(CompCode.Text);
                CompetitionName.Text = AthlComp.Name;
                PlaceAndDate.Text    = AthlComp.Location + ", " + AthlComp.Date.ToShortDateString();
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp     = new Athl_Competition();

            string CompCodeText = Request.QueryString.Get("Code");

            if (!string.IsNullOrEmpty(CompCodeText))
            {
                CompCode.Text = CompCodeText;
                gl.SetCompetitionCode(CompCodeText);
                AthlComp = AthlCompCRUD.GetCompetitionRec(CompCodeText);
                gl.SetCompetitionName(AthlComp.Name);
                CompetitionName.Text = gl.GetCompetitionName();
                CompetitionName.Text = AthlComp.Name;
            }
            else
            {
                CompCode.Text        = gl.GetCompetitionCode();
                CompetitionName.Text = gl.GetCompetitionName();
                AthlComp             = AthlCompCRUD.GetCompetitionRec(CompCode.Text);
            }
            if (AthlComp.tegundstigakeppni == 1)
            {
                Response.Redirect("~/PointsStandingMIYngri.aspx?Code=" + CompCode.Text);
            }
        }
Exemple #5
0
        protected void MotArsins_SelectedIndexChanged(object sender, EventArgs e)
        {
            Global Gl = new Global();

            string CompetitionCode = MotArsins.SelectedValue.ToString();

            Gl.SetCompetitionCode(CompetitionCode);

            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp     = new Athl_Competition();
            AthleticsEntities1      AthlEnt      = new AthleticsEntities1();

            AthlComp = AthlCompCRUD.GetCompetitionRec(CompetitionCode);
            Gl.SetGlobalValue("CompetitionName", AthlComp.Name);
            Gl.SetGlobalValue("EnglishCompetitionName", AthlComp.ensktheitiamoti);
            Gl.SetOutdoorsOrIndoors(AthlComp.OutdoorsOrIndoors.ToString());

            Gl.SetCompetitionCode(AthlComp.Code);
            Gl.SetCompetitionName(AthlComp.Name);
            Gl.SetCompetionYear(AthlComp.Date.Year);
            if (AthlComp.keppnisvollur != "")
            {
                Gl.SetCompetitionVenue(AthlComp.keppnisvollur + ", " + AthlComp.Location);
            }
            else
            {
                Gl.SetCompetitionVenue(AthlComp.Location);
            }

            //Response.Redirect("NyttMot.aspx?Comp=" + CompetitionCode);
            // Response.Redirect("NyttMot.aspx");
            Int32 CompetitionHasBeenFinalized = 0;

            System.Data.Objects.ObjectParameter CompetitionStatus = new System.Data.Objects.ObjectParameter("CompetitionStatus", "0");
            ///AthlEnt.ReturnNoOfHeatsInEvent(CompCode, EventLin, OutNoOfHeats);
            AthlEnt.CompetitionIsFinalized(CompetitionCode, CompetitionStatus);

            CompetitionHasBeenFinalized = Convert.ToInt32(CompetitionStatus.Value);

            if (CompetitionHasBeenFinalized == 1)
            {
                Response.Redirect("SelectedCompetitionResults.aspx?Code=" + CompetitionCode);
            }
            else
            {
                Response.Redirect("SelectedCompetitionEvents.aspx?Code=" + CompetitionCode);
            }
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();


            if (!IsPostBack)
            {
                AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
                CompCode.Text        = gl.GetCompetitionCode();
                CompetitionName.Text = gl.GetCompetitionName();
                EventName.Text       = gl.GetCompetitonEventName();
                EventLineNo.Text     = Request.QueryString.Get("EventLineNo");
                AthlEvent            = AthlCRUD.GetCompetitionEvent(CompCode.Text, Convert.ToInt32(EventLineNo.Text));
                AthlCompetitionRec   = AthlCRUD.GetCompetitionRec(CompCode.Text);
                Int32 TrackEventNoForLynx = AthlEvent.Númer_hlaupagreinar_f__Lynx + 1000;
                WindReadingRequired = AthlEvent.krefstvindmaelis;
                LifFilePrefix.Text  = TrackEventNoForLynx.ToString().Substring(1, 3);
                SelectFileInfo.Text = LifFilePrefix.Text + " : ";
            }
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
            Global gl = new Global();

            CompCode.Text = gl.GetCompetitionCode();
            string CompCodeText = Request.QueryString.Get("Code");

            if ((CompCodeText != "") && (CompCodeText != null))
            {
                CompCodeText = CompCodeText.ToUpper();
                Athl_Competition AthlComp = new Athl_Competition();
                AthlComp      = AthlCompCRUD.GetCompetitionRec(CompCodeText);
                CompCode.Text = CompCodeText;
                gl.SetCompetitionCode(CompCodeText);
                gl.SetCompetitionName(AthlComp.Name);
                TopIAAFPoints.DataBind();
            }

            CompName.Text = gl.GetCompetitionName();
        }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp = new Athl_Competition();

            CompCode.Text = Request.QueryString.Get("CompCode");
            if ((CompCode.Text == "") || (CompCode.Text == null))
            {
                CompCode.Text = gl.GetCompetitionCode();
            }
            SelectedClub.Text   = Request.QueryString.Get("Club");
            SelectedPlace.Text  = Request.QueryString.Get("Place");
            SelectedGender.Text = Request.QueryString.Get("Gender");
            if ((CompCode.Text != "") && (CompCode.Text != null))
            {
                AthlComp             = AthlCRUD.GetCompetitionRec(CompCode.Text);
                CompetitionName.Text = AthlComp.Name;
            }
            SelectionDescription.Text = "";
            if ((SelectedClub.Text != "") && (SelectedClub.Text != null))
            {
                if (SelectedGender.Text == "0")
                {
                    SelectionDescription.Text = "Karlar og konur " + SelectedClub.Text + " í " + SelectedPlace.Text + ". sæti";
                }
                else
                if (SelectedGender.Text == "1")
                {
                    SelectionDescription.Text = "Karlar " + SelectedClub.Text + " í " + SelectedPlace.Text + ". sæti";
                }
                else
                {
                    SelectionDescription.Text = "Konur " + SelectedClub.Text + " í " + SelectedPlace.Text + ". sæti";
                }
            }
        }
        protected void FillPage(string CompCode, Int32 EventNo, Athl_CompetitionEvents AthlCompEventRec, string HeatNoFilt)
        {
            Int32  LabelNo           = 0;
            string LblWidhtForSeries = "";
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCRUD           = new AthleticCompetitionCRUD();
            AthleticsEntities1      AthlEnt            = new AthleticsEntities1();
            Athl_Competition        AthlCompetitionRec = new Athl_Competition();

            AthlCompetitionRec = AthlCRUD.GetCompetitionRec(CompCode);

            PH.Controls.Add(new LiteralControl("<span style = 'font-family:Arial;font-size:12pt'>"));

            if ((HeatNoFilt == "0") || (HeatNoFilt == ""))
            {
                HeatNoFilt = "%";
            }
            else
            {
                //LabelNo = LabelNo + 1;
                //AddLabel(LabelNo, "Riðill " + HeatNoFilt, "200px", "left", false, false);
                //PH.Controls.Add(new LiteralControl("<br /><br />"));
            }
            var CompetitorsInEventDataset = AthlEnt.CompetitorsInEvResultOrder(CompCode, EventNo, HeatNoFilt);

            LabelNo = LabelNo + 1;
            if (AthlCompetitionRec.tungumal == 0)  //Icelandic
            {
                AddLabel(LabelNo, "Sæti", "50px", "right", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Árangur", "80px", "right", false, false);
                if ((AthlCompetitionRec.tegundstigakeppni > 0) && (AthlCompEventRec.stigagrein == 1))
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Stig", "50px", "right", false, false);  //"80px"
                }
                if (AthlCompetitionRec.Reikna_IAAF_stig == 1)
                {
                    AddLabel(LabelNo, "IAAF Stig", "50px", "right", false, false);  //"80px"
                }
                if (AthlCompEventRec.thrautargrein == 1)
                {
                    if (AthlCompetitionRec.Reikna_unglingastig == 1)
                    {
                        AddLabel(LabelNo, "Ungl.stig", "50px", "right", false, false);  //"60px"
                    }
                    else
                    {
                        AddLabel(LabelNo, "Stig", "50px", "right", false, false);       //"60px"
                    }
                }
                if (AthlCompEventRec.krefstvindmaelis == 1)
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "", false, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Vindur", "50px", "", false, false);
                }
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "", "10px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "", "10px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Uppl.", "40px", "left", false, false);  //"70px"
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Nafn", "250px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "F.ár", "50px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Félag", "80px", "", false, false);
                if (AthlCompEventRec.tegundgreinar == 1)  //Track
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Ri.", "20px", "right", false, false);  //Riðill "50px"
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Br", "20px", "right", false, false);   //Braut "50px"
                }
                else
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Röð", "20px", "right", false, false);  //Field Event
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "", false, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Sería", "200px", "left", false, false); //"500px"
                }
            }
            else //Language English or Both
            {
                AddLabel(LabelNo, "Place", "50px", "right", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Mark", "80px", "right", false, false);
                if ((AthlCompetitionRec.tegundstigakeppni > 0) && (AthlCompEventRec.stigagrein == 1))
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Points", "50px", "right", false, false);  //"80px"
                }
                if (AthlCompetitionRec.Reikna_IAAF_stig == 1)
                {
                    AddLabel(LabelNo, "IAAF pts", "50px", "right", false, false);  //"80px"
                }
                if (AthlCompEventRec.thrautargrein == 1)
                {
                    if (AthlCompetitionRec.Reikna_unglingastig == 1)
                    {
                        AddLabel(LabelNo, "Youth pts", "50px", "right", false, false);  //"60px"
                    }
                    else
                    {
                        AddLabel(LabelNo, "Points", "50px", "right", false, false);     //"60px"
                    }
                }
                if (AthlCompEventRec.krefstvindmaelis == 1)
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "", false, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Wind", "50px", "", false, false);
                }
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "", "10px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "", "10px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Info", "40px", "left", false, false);  //"70px"
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Name", "250px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Year", "50px", "", false, false);
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Club", "80px", "", false, false);
                if (AthlCompEventRec.tegundgreinar == 1)  //Track
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Ht.", "20px", "right", false, false);  //Heat "50px"
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Ln.", "20px", "right", false, false);  //Lane "50px"
                }
                else
                {
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Order", "20px", "right", false, false);  //Field Event
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "", false, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "Series", "200px", "left", false, false);  //"500px"
                }
            }
            PH.Controls.Add(new LiteralControl("<br />"));

            foreach (var CompInEvRec in CompetitorsInEventDataset)
            {
                if (((CompInEvRec.rasnumer != 0) || (CompInEvRec.nafn != "")))
                {
                    LineWidth = 0;
                    LabelNo   = LabelNo + 1;
                    if (CompInEvRec.urslitarod < 9999)
                    {
                        AddLabel(LabelNo, CompInEvRec.urslitarodtexti, "50px", "right", false, false);
                    }
                    else
                    {
                        AddLabel(LabelNo, "", "50px", "right", false, false);
                    }
                    LabelNo = LabelNo + 1;
                    if (CompInEvRec.arangur != "")
                    {
                        AddLabel(LabelNo, CompInEvRec.arangur, "80px", "right", true, false);
                    }
                    else
                    {
                        AddLabel(LabelNo, CompInEvRec.athugasemd, "80px", "right", true, false);
                    }
                    if ((AthlCompetitionRec.tegundstigakeppni > 0) && (AthlCompEventRec.stigagrein == 1))
                    {
                        LabelNo = LabelNo + 1;
                        if (CompInEvRec.stig > 0)
                        {
                            Int32   PointsInt = Convert.ToInt32(CompInEvRec.stig);
                            Decimal PointsDec = PointsInt;
                            if (CompInEvRec.stig == PointsDec)
                            {
                                AddLabel(LabelNo, PointsInt.ToString(), "50px", "right", false, false); //"50px"
                            }
                            else
                            {
                                //AddLabel(LabelNo, CompInEvRec.stig.ToString(), "80px", "right", false, false);
                                AddLabel(LabelNo, string.Format("{0:N2}", CompInEvRec.stig), "50px", "right", false, false);  //"80px"
                            }
                        }
                        else
                        {
                            AddLabel(LabelNo, "", "50px", "right", false, false);  //"80px"
                        }
                    }
                    if (AthlCompetitionRec.Reikna_IAAF_stig == 1)
                    {
                        if (CompInEvRec.IAAF_Stig > 0)
                        {
                            AddLabel(LabelNo, CompInEvRec.IAAF_Stig.ToString(), "50px", "right", false, false);  //"80px"
                        }
                        else
                        {
                            AddLabel(LabelNo, "", "50px", "right", false, false);    //"80px"
                        }
                    }
                    if (AthlCompEventRec.thrautargrein == 1)
                    {
                        //REDDING !!!
                        if ((CompCode == "M-00000017") &&
                            (AthlCompEventRec.kyn == 2) &&
                            (AthlCompEventRec.aldurtil == 15) &&
                            (AthlCompEventRec.grein != "FIMMTUNG"))
                        {
                            AddLabel(LabelNo, CompInEvRec.Unglingastig.ToString(), "60px", "right", false, false);
                        }
                        else
                        if (CompInEvRec.thrautarstig > 0)
                        {
                            AddLabel(LabelNo, CompInEvRec.thrautarstig.ToString(), "60px", "right", false, false);
                        }
                        else
                        {
                            if (CompInEvRec.Unglingastig > 0)
                            {
                                AddLabel(LabelNo, CompInEvRec.Unglingastig.ToString(), "60px", "right", false, false);
                            }
                            else
                            {
                                AddLabel(LabelNo, "", "60px", "right", false, false);
                            }
                        }
                    }
                    if (AthlCompEventRec.krefstvindmaelis == 1)
                    {
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, "", "10px", "", false, false);
                        LabelNo = LabelNo + 1;
                        if (CompInEvRec.arangur != "")
                        {
                            AddLabel(LabelNo, gl.FormatWind(Convert.ToDecimal(CompInEvRec.vindur)), "50px", "", false, false);
                        }
                        else
                        {
                            AddLabel(LabelNo, "", "50px", "", false, false);
                        }
                    }
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "", false, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, CompInEvRec.PerformaceRemarks, "40px", "left", false, false);  //"70px"
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "", false, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, CompInEvRec.nafn, "250px", "", true, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, CompInEvRec.faedingarar.ToString(), "50px", "", false, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, CompInEvRec.felag, "80px", "", false, false);
                    if (AthlCompEventRec.tegundgreinar == 1)  //Track
                    {
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, CompInEvRec.ridillnumer.ToString(), "20px", "right", false, false);  //"50px"
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, CompInEvRec.stokkkastrod.ToString(), "20px", "right", false, false); //"50px"
                        if (CompInEvRec.seria != "")
                        {
                            PH.Controls.Add(new LiteralControl("<br />"));
                            LabelNo = LabelNo + 1;
                            AddLabel(LabelNo, "", "90px", "Left", false, true);
                            LabelNo = LabelNo + 1;
                            AddLabel(LabelNo, CompInEvRec.seria, "600px", "Left", false, true);
                        }
                    }
                    else
                    {
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, CompInEvRec.stokkkastrod.ToString(), "20px", "right", false, false);  //Technical (Field Event)
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, "", "10px", "", false, false);
                        LabelNo = LabelNo + 1;
                        //LblWidhtForSeries = Convert.ToString(1150 - LineWidth) + "px";
                        //AddLabel(LabelNo, CompInEvRec.seria, LblWidhtForSeries, "", false, true);   //"500px"
                        AddLabel(LabelNo, CompInEvRec.seria, "200px", "", false, true);
                    }
                    PH.Controls.Add(new LiteralControl("<br />"));
                }
            }
            PH.Controls.Add(new LiteralControl("</span>"));
        }
        // AccessLevelText = "0" : Not logged in - Aðeins fyrirspurnir
        // AccessLevelText = "1" : Club Representative
        // AccessLevelText = "2" : Administrator
        // AccessLevelText = "3" : Can edit entry sheets
        // AccessLevelText = "4" : Competition Administrator

        protected void Page_Load(object sender, EventArgs e)
        {
            Athl_Competition        AthlComp     = new Athl_Competition();
            AthleticsEntities1      AthlEnt      = new AthleticsEntities1();
            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();

            Global Gl           = new Global();
            string CompCodeText = Request.QueryString.Get("Code");

            CompCode.Text           = Gl.GetCompetitionCode();
            ExportLynxFiles.Visible = false;

            if ((CompCodeText != "") && (CompCodeText != null))
            {
                //CompCodeText = HttpUtility.HtmlDecode(CompCodeText);  //Má gera þetta?
                CompCodeText = CompCodeText.ToUpper();

                AthlComp = AthlCompCRUD.GetCompetitionRec(CompCodeText);
                if (AthlComp.tungumal > 0) //Not Icelandic
                {
                    CompEventsLbl.Text = "Keppnisgreinar móts - Competition Events";
                }
                if (AthlComp.Code != "")
                {
                    Gl.SetCompetitionCode(CompCodeText);
                    CompCode.Text = CompCodeText;
                    Gl.SetGlobalValue("CompetitionName", AthlComp.Name);
                    Gl.SetGlobalValue("EnglishCompetitionName", AthlComp.ensktheitiamoti);
                    Gl.SetOutdoorsOrIndoors(AthlComp.OutdoorsOrIndoors.ToString());

                    Gl.SetCompetitionCode(AthlComp.Code);
                    Gl.SetCompetitionName(AthlComp.Name);
                    Gl.SetCompetionYear(AthlComp.Date.Year);
                    if (AthlComp.keppnisvollur != "")
                    {
                        Gl.SetCompetitionVenue(AthlComp.keppnisvollur + ", " + AthlComp.Location);
                    }
                    else
                    {
                        Gl.SetCompetitionVenue(AthlComp.Location);
                    }
                    //Session["CurrentAccessLevel"] = "";
                }
            }
            Competitors.NavigateUrl           = "~/SelectedCompetitionCompetitors.aspx?Code=" + CompCode.Text;
            CompetitionResults.NavigateUrl    = "~/SelectedCompetitionResults.aspx?Code=" + CompCode.Text;
            PointsStanding.NavigateUrl        = "~/Points.aspx?Code=" + CompCode.Text;
            PointsStandingMIYngri.NavigateUrl = "~/PointsStandingMIYngri.aspx?Code=" + CompCode.Text;

            AthlComp = AthlCompCRUD.GetCompetitionRec(CompCode.Text);
            string CompDates = AthlComp.Date.ToShortDateString();

            if (AthlComp.Date2 > Convert.ToDateTime("1900-01-01"))
            {
                if (AthlComp.Date3 > Convert.ToDateTime("1900-01-01"))
                {
                    CompDates = CompDates + ", " + AthlComp.Date2.ToShortDateString() + " og " +
                                AthlComp.Date3.ToShortDateString();
                }
                else
                {
                    CompDates = CompDates + " og " + AthlComp.Date2.ToShortDateString();
                }
            }
            CompetitionName.Text = AthlComp.Name + " - " + CompDates + " - " + AthlComp.Location;

            // if (AthlComp.tegundstigakeppni == 5) //Meistaramót Íslands m IAAF stigum
            if ((AthlComp.tegundstigakeppni == 1) || (AthlComp.tegundstigakeppni == 2) || (AthlComp.tegundstigakeppni == 5)) //Mi yngri, bikar eða Meistaramót Íslands m IAAF stigum
            {
                PointsStanding.Visible = true;
            }
            else
            {
                PointsStanding.Visible = false;
            }
            if (AthlComp.tegundstigakeppni == 3)
            {
                PointsStandingMIYngri.Visible = true;
            }
            else
            {
                PointsStandingMIYngri.Visible = false;
            }
            LinkToPage.Text = "http://thor.fri.is/SelectedCompetitionEvents.aspx?Code=" + CompCode.Text;
            // LinkToPage.Text = "http://thor.fri.is/SelectedCompetitionEvents.aspx?Code=" + HttpUtility.HtmlEncode(CompCode.Text);
            if (Session["CurrentAccessLevel"] == null)
            {
                Session["CurrentAccessLevel"] = "0";
            }
            AccessLevelText       = Session["CurrentAccessLevel"].ToString();
            UpdCompEvents.Visible = false;
            CompSetup.Visible     = false;
            if (AccessLevelText == "0")
            {
                YourCompetitors.Visible      = false;
                YourCompetitorsLabel.Visible = false;
            }
            else
            if ((AccessLevelText != "1") || (Gl.UserCanUpdateMeet(AthlComp.Code, Session["CurrentUserName"].ToString()) == 1))
            {
                if ((AthlComp.Staða_móts == 2) || (AthlComp.Staða_móts == 3) || (AthlComp.Staða_móts == 4))
                {  //2 = Opið fyrir skráningu, 3 = Lokað fyrir skráningu, 4 = Stendur yfir
                    ExportLynxFiles.Visible = true;
                    UpdCompEvents.Visible   = true;
                }
            }
            if (Session["CurrentUserName"] == null)
            {
                Session["CurrentUserName"] = "";
            }

            if (Gl.UserCanUpdateMeet(AthlComp.Code, Session["CurrentUserName"].ToString()) == 1)  //2 = Admin
            {
                UpdCompEvents.Visible = true;
                CompSetup.Visible     = true;
                CompSetup.NavigateUrl = "~/CompetitionSetup.aspx?Code=" + AthlComp.Code;
            }

            if (!IsPostBack)
            {
                EventDateFilterDropDown.Items.Clear();
                Int32    NoOfDates = 0;
                ListItem newItem   = new ListItem();
                newItem       = new ListItem();
                newItem.Text  = "Allir dagar";
                newItem.Value = "%";
                EventDateFilterDropDown.Items.Add(newItem);
                //AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                var DatesInCompetition = AthlEnt.ReturnCompetitionEventDates(Gl.GetCompetitionCode());
                foreach (var result in DatesInCompetition)
                {
                    NoOfDates     = NoOfDates + 1;
                    newItem       = new ListItem();
                    newItem.Text  = Convert.ToString(result);       // "Dagur 1"; // Convert.ToString(result.Dags);
                    newItem.Value = Convert.ToString(result) + "%"; // "D1%"; // Convert.ToString(result.Dags) + "%";
                    EventDateFilterDropDown.Items.Add(newItem);
                }

                if (NoOfDates <= 1)
                {
                    EventDateFilterLabel.Visible    = false;
                    EventDateFilterDropDown.Visible = false;
                }
                else
                {
                    EventDateFilterLabel.Visible    = true;
                    EventDateFilterDropDown.Visible = true;
                }
            }
        }
Exemple #11
0
        protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            string[] WordsArray;
            string   AgeGr;
            Int32    Gend;
            Int32    AgeFr;
            Int32    AgeTo;
            Int32    ColNo;

            string EventLineNoText = "";
            bool   UserIsSignedin  = false;

            if (e.Row.RowType == DataControlRowType.Header)
            {
                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if ((AccessLevelText == "0") || (AccessLevelText == "") || (AccessLevelText == null))
                {
                    UserIsSignedin = false;
                    //ModifyDateTime.Visible = false;
                    SetPrizeCermonyColumnVisible = false;
                }
                else
                {
                    UserIsSignedin = true;
                    AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
                    Athl_Competition        AthlComp     = new Athl_Competition();
                    if (CompCode4.Text != "")
                    {
                        AthlComp = AthlCompCRUD.GetCompetitionRec(CompetitionCode.Text);
                        if (AthlComp.DisplayColumnForPrizeCeremony == 1)
                        {
                            SetPrizeCermonyColumnVisible = true;
                        }
                    }
                }
                ColNoForPrizeCeremony = GetColumnIndexByName(e.Row, "tilkynnaverdlaunaafhendingu");
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int RowIx = e.Row.RowIndex;
                EventLineNoText = GridView3.DataKeys[e.Row.RowIndex].Values[1].ToString();

                ColNo = GetColumnIndexByName(e.Row, "ShowCompetitors");
                HyperLink hp = new HyperLink();

                hp.Text        = "Keppendur"; //e.Row.Cells[ColNo].Text;
                hp.NavigateUrl = "UpdateEventResults.aspx?Event=" + EventLineNoText;

                e.Row.Cells[ColNo].Controls.Add(hp);

                ColNo      = GetColumnIndexByName(e.Row, "Aldursflokkur");
                AgeGr      = e.Row.Cells[ColNo].Text;
                WordsArray = AgeGr.Split(';');
                Gend       = Convert.ToInt32(WordsArray[0]);
                AgeFr      = Convert.ToInt32(WordsArray[1]);
                AgeTo      = Convert.ToInt32(WordsArray[2]);

                switch (Gend)
                {
                case 1:
                    if ((AgeFr == 0) & ((AgeTo == 0) | (AgeTo == 999)))
                    {
                        AgeGr = "Karlar";
                    }
                    else
                    {
                        if (AgeFr == 0)
                        {
                            if (AgeTo > 22)
                            {
                                AgeGr = "Karlar";
                            }
                            else
                            {
                                AgeGr = "Piltar " + AgeTo.ToString() + " og yngri";
                            }
                        }
                        else
                        {
                            if (AgeTo == 999)
                            {
                                AgeGr = "Karlar " + AgeFr.ToString() + " og eldri";
                            }
                            else
                            {
                                if (AgeFr == AgeTo)
                                {
                                    AgeGr = "Piltar " + AgeFr.ToString();
                                }
                                else
                                {
                                    AgeGr = "Piltar " + AgeFr.ToString() + "-" + AgeTo.ToString();
                                }
                            }
                        }
                    }
                    break;

                case 2:
                    if ((AgeFr == 0) && ((AgeTo == 0) || (AgeTo == 999)))
                    {
                        AgeGr = "Konur";
                    }
                    else
                    {
                        if (AgeFr == 0)
                        {
                            if (AgeTo > 22)
                            {
                                AgeGr = "Konur";
                            }
                            else
                            {
                                AgeGr = "Stúlkur " + AgeTo.ToString() + " og yngri";
                            }
                        }
                        else
                        {
                            if (AgeTo == 999)
                            {
                                AgeGr = "Konur " + AgeFr.ToString() + " og eldri";
                            }
                            else
                            {
                                if (AgeFr == AgeTo)
                                {
                                    AgeGr = "Stúlkur " + AgeFr.ToString();
                                }
                                else
                                {
                                    AgeGr = "Stúlkur " + AgeFr.ToString() + "-" + AgeTo.ToString();
                                }
                            }
                        }
                    }
                    break;
                }
                //e.Row.Cells[ColNo].Text = AgeGr;
            }
            if (SetPrizeCermonyColumnVisible == false)
            {
                e.Row.Cells[ColNoForPrizeCeremony].Visible     = false;
                e.Row.Cells[ColNoForPrizeCeremony + 1].Visible = false;
            }
        }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global Gl = new Global();

            if (IsPostBack)
            {
                Message.Text = "";
                DateTime DateValue;
                string   ValinnV   = Convert.ToString(Vellir.SelectedValue);
                string   InnslDags = Dagsetning.Text;
                if (ValinnV != GamliVollur.Text)
                {
                    MotADO ado = new MotADO();

                    ado.GeymaVallarupplys(ValinnV);
                    Stadur.Text     = ado.ValinnStadur;
                    UtiEdaInni.Text = ado.ValidUtiInni;

                    if (UtiEdaInni.Text == "0")
                    {
                        UtiEdaInni.Text = "Utanhúss";
                    }
                    if (UtiEdaInni.Text == "1")
                    {
                        UtiEdaInni.Text = "Innanhúss";
                    }
                    if (UtiEdaInni.Text == "2")
                    {
                        UtiEdaInni.Text = "Utan- eða Innanhúss";
                    }


                    GamliVollur.Text = ValinnV.ToString();
                }


                if (InnslDags != GamlaDags.Text)
                {
                    string[] separators = { ".", "/", " " };
                    string[] words      = InnslDags.Split(separators, StringSplitOptions.RemoveEmptyEntries);
                    if (words[0].Length == 1)
                    {
                        words[0] = "0" + words[0];
                    }
                    if (words[1].Length == 1)
                    {
                        words[1] = "0" + words[1];
                    }
                    if (words[2].Length == 1)
                    {
                        words[2] = "200" + words[2];
                    }
                    else if (words[2].Length == 2)
                    {
                        words[2] = "20" + words[2];
                    }

                    InnslDags = words[0] + "." + words[1] + "." + words[2];
                    // if (words[0].Length >
                    if (InnslDags.Length == 8)
                    {
                        InnslDags = InnslDags.Substring(0, 2) + "." + InnslDags.Substring(2, 2) + "." + InnslDags.Substring(4, 4);
                        HeitiMots.Focus();
                    }
                    else
                    if (InnslDags.Length == 7)
                    {
                        InnslDags = "0" + InnslDags.Substring(0, 1) + "." + InnslDags.Substring(1, 2) + "." + InnslDags.Substring(3, 4);
                    }
                    else
                    if (InnslDags.Length == 6)
                    {
                        InnslDags = InnslDags.Substring(0, 2) + "." + InnslDags.Substring(2, 2) + ".20" + InnslDags.Substring(4, 2);
                    }
                    else
                    if (InnslDags.Length == 5)
                    {
                        InnslDags = "0" + InnslDags.Substring(0, 1) + "." + InnslDags.Substring(1, 2) + ".20" + InnslDags.Substring(3, 2);
                    }
                    else
                    if (InnslDags.Length == 4)
                    {
                        InnslDags = InnslDags.Substring(0, 2) + "." + InnslDags.Substring(2, 2) + "." + DateTime.Now.ToString("yyyy");
                    }
                    else
                    if (InnslDags.Length == 3)
                    {
                        InnslDags = "0" + InnslDags.Substring(0, 1) + "." + InnslDags.Substring(1, 2) + "." + DateTime.Now.ToString("yyyy");
                    }
                    else
                    if (InnslDags.Length == 2)
                    {
                        InnslDags = InnslDags + "." + DateTime.Now.ToString("MM.yyyy");
                    }
                    else
                    if (InnslDags.Length == 1)
                    {
                        InnslDags = "0" + InnslDags + "." + DateTime.Now.ToString("MM.yyyy");
                    }

                    if (!DateTime.TryParse(InnslDags, out DateValue))
                    {
                        Message.Text = "Dagsetning " + InnslDags + " er ekki í lagi.";
                    }
                    else
                    {
                        InnslDags = DateValue.ToShortDateString();
                    }
                    Dagsetning.Text = InnslDags;
                    GamlaDags.Text  = InnslDags;
                    HeitiMots.Focus();
                }
            }
            else  //Not Postback - Page Load
            {
                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if ((AccessLevelText == "0") || (AccessLevelText == "") || (AccessLevelText == null))
                {
                    NewCompetitorButton.Visible  = false;
                    YourCompetitors.Visible      = false;
                    AddNewCompetitorsBtn.Visible = false;
                    SetupEvents.Visible          = false;
                    Vista.Visible       = false;
                    HeitiMots.ReadOnly  = true;
                    EnsktHeiti.ReadOnly = true;
                    Dagsetning.ReadOnly = true;
                    //Vellir.ReadOnly = true;
                    Stadur.ReadOnly            = true;
                    UtiEdaInni.ReadOnly        = true;
                    Motshaldari.ReadOnly       = true;
                    Yfirdomari.ReadOnly        = true;
                    SkranGjaldPrGrein.ReadOnly = true;
                    SkranGjPrBodhl.ReadOnly    = true;
                    SkranGjPrGreinU18.ReadOnly = true;
                    SkranGjPrBodhlU18.ReadOnly = true;
                }

                if (Gl.GetCompetitionCode() != "")
                {
                    {
                        CompetitionCode.Text = Gl.GetCompetitionCode();
                        CompCode2.Text       = CompetitionCode.Text;
                        CompCode4.Text       = CompetitionCode.Text;
                        CompCode7.Text       = CompetitionCode.Text;

                        AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
                        Athl_Competition        AthlComp     = new Athl_Competition();
                        AthlComp        = AthlCompCRUD.GetCompetitionRec(Gl.GetCompetitionCode());
                        HeitiMots.Text  = AthlComp.Name;
                        EnsktHeiti.Text = AthlComp.ensktheitiamoti;
                        Dagsetning.Text = AthlComp.Date.ToShortDateString();
                        Gl.SetGlobalValue("CompetitionName", AthlComp.Name);
                        Gl.SetGlobalValue("EnglishCompetitionName", AthlComp.ensktheitiamoti);
                        Gl.SetOutdoorsOrIndoors(AthlComp.OutdoorsOrIndoors.ToString());

                        Int16 VenueIndex = 0;
                        System.Data.Objects.ObjectParameter Indx = new System.Data.Objects.ObjectParameter("Indx", typeof(Int32));

                        AthleticsEntities1 AthlEnt = new AthleticsEntities1();

                        AthlEnt.IndexCompetitionVenue(AthlComp.keppnisvollur, Indx);
                        if (Int16.TryParse(Indx.Value.ToString(), out VenueIndex) == false)
                        {
                            VenueIndex = 0;
                        }
                        //VenueIndex = ReturnIndexOfVenue(AthlComp.keppnisvollur);

                        if (VenueIndex > 0)
                        {
                            Vellir.SelectedIndex = VenueIndex;
                        }

                        Stadur.Text = AthlComp.Location;
                        if (AthlComp.CompetitonType == 0)
                        {
                            CompetitionEventsHdr.Text = HeitiMots.Text + " - Keppnisgreinar hlaups:";
                        }
                        else
                        {
                            CompetitionEventsHdr.Text = HeitiMots.Text + " - Keppnisgreinar móts:";
                        } if (AthlComp.OutdoorsOrIndoors == 0)
                        {
                            UtiEdaInni.Text = "Utanhúss";
                        }
                        else
                        {
                            UtiEdaInni.Text = "Innanhúss";
                        }
                        Motshaldari.Text       = AthlComp.Organizer;
                        Yfirdomari.Text        = AthlComp.Judge;
                        SkranGjaldPrGrein.Text = string.Format("{0:N2}", AthlComp.skraningargjaldprgrein);     //AthlComp.skraningargjaldprgrein.ToString();
                        SkranGjPrBodhl.Text    = string.Format("{0:N2}", AthlComp.Skráningargjld_f__boðhlaup); //.ToString();
                        SkranGjPrGreinU18.Text = string.Format("{0:N2}", AthlComp.Skráningargj__yngri_en_18_ára);
                        SkranGjPrBodhlU18.Text = string.Format("{0:N2}", AthlComp.Skráningargj__f_boðhl_y_18_ára);
                        if (AthlComp.Reikna_unglingastig == 1)
                        {
                            ReiknaUnglStig.Text = "Já";
                        }
                        else
                        {
                            ReiknaUnglStig.Text = "Nei";
                        }
                        if (AthlComp.Reikna_IAAF_stig == 1)
                        {
                            ReiknaIAAFStig.Text = "Já";
                        }
                        else
                        {
                            ReiknaIAAFStig.Text = "Nei";
                        }

                        Gl.SetCompetitionCode(AthlComp.Code);
                        Gl.SetCompetitionName(AthlComp.Name);
                        Gl.SetCompetionYear(AthlComp.Date.Year);
                        if (AthlComp.keppnisvollur != "")
                        {
                            Gl.SetCompetitionVenue(AthlComp.keppnisvollur + ", " + AthlComp.Location);
                        }
                        else
                        {
                            Gl.SetCompetitionVenue(AthlComp.Location);
                        }

                        Int32    NoOfDates = 0;
                        ListItem newItem   = new ListItem();
                        newItem       = new ListItem();
                        newItem.Text  = "Allir dagar";
                        newItem.Value = "%";
                        EventDateFilterDropDown.Items.Add(newItem);
                        //AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                        var DatesInCompetition = AthlEnt.ReturnCompetitionEventDates(Gl.GetCompetitionCode());
                        foreach (var result in DatesInCompetition)
                        {
                            NoOfDates     = NoOfDates + 1;
                            newItem       = new ListItem();
                            newItem.Text  = Convert.ToString(result);       // "Dagur 1"; // Convert.ToString(result.Dags);
                            newItem.Value = Convert.ToString(result) + "%"; // "D1%"; // Convert.ToString(result.Dags) + "%";
                            EventDateFilterDropDown.Items.Add(newItem);
                        }


                        if (NoOfDates <= 1)
                        {
                            EventDateFilterLabel.Visible    = false;
                            EventDateFilterDropDown.Visible = false;
                        }
                        else
                        {
                            EventDateFilterLabel.Visible    = true;
                            EventDateFilterDropDown.Visible = true;
                        }
                    }
                    HeitiMots.Focus();
                    NyrKeppandiTbl.Visible = false;
                }
                else
                {
                    string SelNafn;
                    SelNafn = Gl.GetSelNafn();
                    if (SelNafn != "")
                    {
                        KennitText.Text = Gl.GetSelKt();
                        NafnText.Text   = SelNafn;
                        FaedArText.Text = Gl.GetSelFar();
                        FelagText.Text  = Gl.GetSelFel();

                        Gl.SetSelComp("", "", "", "", "", "", "", "");
                    }
                }
            }
        }
        protected void VistaButton_Click(object sender, EventArgs e)
        {
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCompCRUD    = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp        = new Athl_Competition();
            Athl_Venues             AthlVenueRec    = new Athl_Venues();
            Athl_CompetitionEvents  AthlCompEvents  = new Athl_CompetitionEvents();
            Athl_CompetitionEvents  AthlCompEvents2 = new Athl_CompetitionEvents();
            Athl_CompetitionEvents  AthlCompEvents3 = new Athl_CompetitionEvents();
            Athl_CompetitionEvents  AthlCompEvents4 = new Athl_CompetitionEvents();
            Athl_Events             AthlEvents      = new Athl_Events();

            Message.Text = "";

            string   WrkText                 = "";
            string   HeitiAldursflokks       = "";
            string   HeitiAldursflokks2      = "";
            string   WrkCompetitionEventName = "";
            CheckBox SelectedEvent;
            Int16    i          = 0;
            Int32    Gend       = 0;
            Int32    AgeFr      = 0;
            Int32    AgeTo      = 0;
            Int32    LastLineNo = -1;
            Int32    UtiInniInt;

            UtiInniInt = Convert.ToInt32(gl.GetOutdorrsOrIndoors());


            AthlComp     = AthlCompCRUD.GetCompetitionRec(gl.GetCompetitionCode());
            AthlVenueRec = AthlCompCRUD.GetVenueRec(AthlComp.keppnisvollur);

            DropDownList UmfDropD;

            // using (TransactionScope scope = new TransactionScope())


            for (i = 0; i < NormalEventsMenGrid.Rows.Count; i++)  //Mens Events
            {
                SelectedEvent = (CheckBox)NormalEventsMenGrid.Rows[i].FindControl("ValinChk");
                if (SelectedEvent.Checked)
                {
                    ((CheckBox)NormalEventsMenGrid.Rows[i].FindControl("ValinChk")).Checked = false;

                    AthlCompEvents     = AthlCompCRUD.InitCompetitionEvent();
                    AthlCompEvents.mot = gl.GetCompetitionCode();
                    if (LastLineNo == -1)
                    {
                        LastLineNo = AthlCompCRUD.ReturnNextEventinCompLineNo(gl.GetCompetitionCode());
                    }
                    else
                    {
                        LastLineNo = LastLineNo + 10000;
                    }
                    AthlCompEvents.lina = LastLineNo;
                    WrkText             = NormalEventsMenGrid.DataKeys[i].Value.ToString();
                    string[] KeyParts = WrkText.Split(';');
                    AthlCompEvents.grein   = KeyParts[0];
                    AthlCompEvents.kyn     = Convert.ToInt32(KeyParts[1]); //Male or female
                    AthlCompEvents.flokkur = KeyParts[2];
                    WrkText = NormalEventsMenGrid.Rows[i].Cells[2].Text;   //Name of Event
                    WrkCompetitionEventName     = HttpUtility.HtmlDecode(WrkText);
                    AthlCompEvents.heitigreinar = WrkText;
                    AthlCompEvents.dagsetning   = Convert.ToDateTime(DateForEvents.Text); //gl.GetSelectedDate());
                    WrkText = gl.GetArr1Value(i);                                         //Age Group Code
                    AthlCompCRUD.ReturnAgeGroupInfo(WrkText,
                                                    out Gend,
                                                    out AgeFr,
                                                    out AgeTo,
                                                    out HeitiAldursflokks,
                                                    out HeitiAldursflokks2);

                    AthlCompEvents.kyn          = Gend;
                    AthlCompEvents.aldurfra     = AgeFr;
                    AthlCompEvents.aldurtil     = AgeTo;
                    WrkCompetitionEventName     = WrkCompetitionEventName + " " + HeitiAldursflokks2;
                    AthlCompEvents.heitigreinar = WrkCompetitionEventName;
                    AthlEvents = AthlCompCRUD.GetAthlEvent(AthlCompEvents.grein, AthlCompEvents.kyn, AthlCompEvents.flokkur, UtiInniInt);
                    AthlCompEvents.tegundgreinar          = AthlEvents.Tegund_greinar;
                    AthlCompEvents.nanaritegundargreining = AthlEvents.Nánari_tegundargreining;
                    AthlCompEvents.skraningargjald        = AthlComp.skraningargjaldprgrein;
                    AthlCompEvents.stadakeppni            = 0;
                    AthlCompEvents.takngreinar            = AthlCompEvents.grein + "," + AthlCompEvents.kyn.ToString() + "," + AthlCompEvents.aldurfra.ToString();
                    AthlCompEvents.rodiafrekaskra         = (Int32)AthlEvents.Röð_í_afrekaskrá;
                    AthlCompEvents.krefstvindmaelis       = AthlEvents.Krefst_vindmælis;
                    AthlCompEvents.tharfadradakeppendum   = 1;
                    //if (AthlEvents.Tegund_greinar == 1)
                    //{
                    //    if (AthlEvents.Teg__hlaups_v__fj__brauta == 1)  //Bein braut
                    //    {
                    //        AthlCompEvents.fjoldiibrauta = AthlVenueRec.Fjöldi_beinna_brauta;
                    //        if (AthlCompEvents.fjoldiibrauta == 0)
                    //        {
                    //            AthlCompEvents.fjoldiibrauta = 6;
                    //        }
                    //    }
                    //    if (AthlEvents.Teg__hlaups_v__fj__brauta == 2)  //200m, 300m, 400m
                    //    {
                    //        AthlCompEvents.fjoldiibrauta = AthlVenueRec.Fj__hringbrauta_spretthlaup;
                    //        if (AthlCompEvents.fjoldiibrauta == 0)
                    //        {
                    //            AthlCompEvents.fjoldiibrauta = 6;
                    //        }
                    //    }
                    //    if (AthlEvents.Teg__hlaups_v__fj__brauta == 3)  //Millivegalengdir
                    //    {
                    //        AthlCompEvents.fjoldiibrauta = AthlVenueRec.Fj__hringbrauta_spretthlaup * 2;
                    //        if (AthlCompEvents.fjoldiibrauta == 0)
                    //        {
                    //            AthlCompEvents.fjoldiibrauta = 12;
                    //        }
                    //    }
                    //    if (AthlEvents.Teg__hlaups_v__fj__brauta == 4)  //Langhlaup
                    //    {
                    //        AthlCompEvents.fjoldiibrauta = 20;
                    //    }
                    //}
                    AthlCompEvents.fjoldiumferda = 6;

                    if (AthlCompEvents.tegundgreinar == 1)  //Track Event
                    {
                        AthlCompEvents.rafmagnstimataka = 1;
                        //AthlEvents.Greinahópur:
                        //0 = Spretthlaup bein braut
                        //1 = Spretthlaup hringbraut
                        //2 = Millivegalengir
                        //3 = Langhlaup
                        //4 = Grindahlaup bein braut
                        //5 = Grindahlaup hringbraut
                        //6 = Hindrun
                        //7 = Boðhlaup
                        //8 = Götuhlaup
                        //9 = Víðavangshlaup
                        //10 = Stökk
                        //11 = Köst
                        //12 = Fjölþrautir
                        //13 = Annað

                        if ((AthlEvents.Greinahópur == 0) || (AthlEvents.Greinahópur == 4))  //Short sprints and hurdles
                        {
                            AthlCompEvents.fjoldiibrauta = AthlVenueRec.Fjöldi_beinna_brauta;
                            if (AthlCompEvents.fjoldiibrauta == 0)
                            {
                                AthlCompEvents.fjoldiibrauta = 6;
                            }
                        }
                        else
                        {
                            if ((AthlEvents.Greinahópur == 1) || (AthlEvents.Greinahópur == 5) || (AthlEvents.Greinahópur == 7)) //Long sprints, long hurdles, relays
                            {
                                AthlCompEvents.fjoldiibrauta = AthlVenueRec.Fj__hringbrauta_spretthlaup;
                                if (AthlCompEvents.fjoldiibrauta == 0)
                                {
                                    AthlCompEvents.fjoldiibrauta = 6;
                                }
                            }
                            else
                            {
                                if (AthlEvents.Greinahópur == 2)  //Middle distances
                                {
                                    AthlCompEvents.fjoldiibrauta = AthlVenueRec.Fj__hingbrauta_millivegalengd;
                                    if (AthlCompEvents.fjoldiibrauta == 0)
                                    {
                                        AthlCompEvents.fjoldiibrauta = 12;
                                    }
                                }
                                else
                                {
                                    AthlCompEvents.fjoldiibrauta = AthlVenueRec.Fj__hringbrauta_langhlaup; //Long distance, steeple chase
                                    if (AthlCompEvents.fjoldiibrauta == 0)
                                    {
                                        AthlCompEvents.fjoldiibrauta = 20;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        AthlCompEvents.fjoldiibrauta = 0;
                        AthlCompEvents.fjoldiumferda = 6;
                    }

                    UmfDropD = (DropDownList)NormalEventsMenGrid.Rows[i].FindControl("UmferdDropDownList");
                    WrkText  = UmfDropD.SelectedValue.ToString();
                    switch (WrkText)
                    {
                    case "Úrslit":
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        break;

                    case "Undanúrslit og úrslit":
                        AthlCompEvents.heitigreinar = WrkCompetitionEventName + " - Undanúrslit";
                        AthlCompEvents.ridill       = 4; //Semi-Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents2              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents2.lina         = LastLineNo;
                        AthlCompEvents2.heitigreinar = WrkCompetitionEventName + " - Úrslit";
                        AthlCompEvents2.ridill       = 5; //Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents2);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents2, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        break;

                    case "Riðlakeppni, undanúrslit og úrslit":
                        AthlCompEvents.heitigreinar = WrkCompetitionEventName + " - Riðlakeppni";
                        AthlCompEvents.ridill       = 2; //Heats
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents3              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents3.lina         = LastLineNo;
                        AthlCompEvents3.heitigreinar = WrkCompetitionEventName + " - Undanúrslit";
                        AthlCompEvents3.ridill       = 4; //Semi-Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents3);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents3, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents2              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents2.lina         = LastLineNo;
                        AthlCompEvents2.heitigreinar = WrkCompetitionEventName + " - Úrslit";
                        AthlCompEvents2.ridill       = 5; //Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents2);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents2, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);
                        break;

                    case "Forkeppni, riðlakeppni, undanúrslit og úrslit":
                        AthlCompEvents.heitigreinar = WrkCompetitionEventName + " - Forkeppni";
                        AthlCompEvents.ridill       = 1; //Preliminaries
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents4              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents4.lina         = LastLineNo;
                        AthlCompEvents4.heitigreinar = WrkCompetitionEventName + " - Riðlakeppni";
                        AthlCompEvents4.ridill       = 2; //Heats
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents4);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents4, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents3              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents3.lina         = LastLineNo;
                        AthlCompEvents3.heitigreinar = WrkCompetitionEventName + " - Undanúrslit";
                        AthlCompEvents3.ridill       = 4; //Semi-Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents3);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents3, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);


                        AthlCompEvents2              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents2.lina         = LastLineNo;
                        AthlCompEvents2.heitigreinar = WrkCompetitionEventName + " - Úrslit";
                        AthlCompEvents2.ridill       = 5; //Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents2);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents2, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);
                        break;
                    }
                }
            }

            for (i = 0; i < NormalEventsWomenGrid.Rows.Count; i++)  //Mens Events
            {
                SelectedEvent = (CheckBox)NormalEventsWomenGrid.Rows[i].FindControl("ValinChk");
                if (SelectedEvent.Checked)
                {
                    ((CheckBox)NormalEventsWomenGrid.Rows[i].FindControl("ValinChk")).Checked = false;

                    AthlCompEvents     = AthlCompCRUD.InitCompetitionEvent();
                    AthlCompEvents.mot = gl.GetCompetitionCode();
                    if (LastLineNo == -1)
                    {
                        LastLineNo = AthlCompCRUD.ReturnNextEventinCompLineNo(gl.GetCompetitionCode());
                    }
                    else
                    {
                        LastLineNo = LastLineNo + 10000;
                    }
                    AthlCompEvents.lina = LastLineNo;
                    WrkText             = NormalEventsWomenGrid.DataKeys[i].Value.ToString();
                    string[] KeyParts = WrkText.Split(';');
                    AthlCompEvents.grein   = KeyParts[0];
                    AthlCompEvents.kyn     = Convert.ToInt32(KeyParts[1]); //Male
                    AthlCompEvents.flokkur = KeyParts[2];
                    WrkText = NormalEventsWomenGrid.Rows[i].Cells[2].Text; //Name of Event
                    WrkCompetitionEventName     = HttpUtility.HtmlDecode(WrkText);
                    AthlCompEvents.heitigreinar = WrkText;
                    AthlCompEvents.dagsetning   = Convert.ToDateTime(DateForEvents.Text); //gl.GetSelectedDate());
                    WrkText = gl.GetArr2Value(i);                                         //Age Group Code
                    AthlCompCRUD.ReturnAgeGroupInfo(WrkText,
                                                    out Gend,
                                                    out AgeFr,
                                                    out AgeTo,
                                                    out HeitiAldursflokks,
                                                    out HeitiAldursflokks2);

                    AthlCompEvents.kyn          = Gend;
                    AthlCompEvents.aldurfra     = AgeFr;
                    AthlCompEvents.aldurtil     = AgeTo;
                    WrkCompetitionEventName     = WrkCompetitionEventName + " " + HeitiAldursflokks2;
                    AthlCompEvents.heitigreinar = WrkCompetitionEventName;
                    AthlCompEvents.heitigreinar = WrkCompetitionEventName;
                    AthlComp   = AthlCompCRUD.GetCompetitionRec(AthlCompEvents.mot);
                    AthlEvents = AthlCompCRUD.GetAthlEvent(AthlCompEvents.grein, AthlCompEvents.kyn, AthlCompEvents.flokkur, UtiInniInt);
                    AthlCompEvents.tegundgreinar          = AthlEvents.Tegund_greinar;
                    AthlCompEvents.nanaritegundargreining = AthlEvents.Nánari_tegundargreining;
                    AthlCompEvents.skraningargjald        = AthlComp.skraningargjaldprgrein;
                    AthlCompEvents.stadakeppni            = 0;
                    AthlCompEvents.takngreinar            = AthlCompEvents.grein + "," + AthlCompEvents.kyn.ToString() + "," + AthlCompEvents.aldurfra.ToString();
                    AthlCompEvents.rodiafrekaskra         = (Int32)AthlEvents.Röð_í_afrekaskrá;
                    AthlCompEvents.tharfadradakeppendum   = 1;
                    AthlCompEvents.krefstvindmaelis       = AthlEvents.Krefst_vindmælis;
                    AthlCompEvents.fjoldiibrauta          = 6;
                    AthlCompEvents.fjoldiumferda          = 6;

                    UmfDropD = (DropDownList)NormalEventsWomenGrid.Rows[i].FindControl("UmferdDropDownList");
                    WrkText  = UmfDropD.SelectedValue.ToString();
                    switch (WrkText)
                    {
                    case "Úrslit":
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);
                        break;

                    case "Undanúrslit og úrslit":
                        AthlCompEvents.heitigreinar = WrkCompetitionEventName + " - Undanúrslit";
                        AthlCompEvents.ridill       = 4; //Semi-Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents2              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents2.lina         = LastLineNo;
                        AthlCompEvents2.heitigreinar = WrkCompetitionEventName + " - Úrslit";
                        AthlCompEvents2.ridill       = 5; //Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents2);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents2, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);
                        break;

                    case "Riðlakeppni, undanúrslit og úrslit":
                        AthlCompEvents.heitigreinar = WrkCompetitionEventName + " - Riðlakeppni";
                        AthlCompEvents.ridill       = 2; //Heats
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);


                        AthlCompEvents3              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents3.lina         = LastLineNo;
                        AthlCompEvents3.heitigreinar = WrkCompetitionEventName + " - Undanúrslit";
                        AthlCompEvents3.ridill       = 4; //Semi-Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents3);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents3, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents2              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents2.lina         = LastLineNo;
                        AthlCompEvents2.heitigreinar = WrkCompetitionEventName + " - Úrslit";
                        AthlCompEvents2.ridill       = 5; //Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents2);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents2, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);
                        break;

                    case "Forkeppni, riðlakeppni, undanúrslit og úrslit":
                        AthlCompEvents.heitigreinar = WrkCompetitionEventName + " - Forkeppni";
                        AthlCompEvents.ridill       = 1; //Preliminaries
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents4              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents4.lina         = LastLineNo;
                        AthlCompEvents4.heitigreinar = WrkCompetitionEventName + " - Riðlakeppni";
                        AthlCompEvents4.ridill       = 2; //Heats
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents4);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents4, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        AthlCompEvents3              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents3.lina         = LastLineNo;
                        AthlCompEvents3.heitigreinar = WrkCompetitionEventName + " - Undanúrslit";
                        AthlCompEvents3.ridill       = 4; //Semi-Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents3);
                        // EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents3, UtiInniInt);
                        // AthlCompCRUD.InsertEventInComp(EventsInComp);


                        AthlCompEvents2              = AthlCompCRUD.CopyKeyValuesBtwEvents(AthlCompEvents);
                        LastLineNo                   = LastLineNo + 10000;
                        AthlCompEvents2.lina         = LastLineNo;
                        AthlCompEvents2.heitigreinar = WrkCompetitionEventName + " - Úrslit";
                        AthlCompEvents2.ridill       = 5; //Final
                        AthlCompCRUD.InsertCompEventInCompetition(AthlCompEvents2);
                        //EventsInComp = AthlCompCRUD.CopyFromCompetitionEvent(AthlCompEvents2, UtiInniInt);
                        //AthlCompCRUD.InsertEventInComp(EventsInComp);

                        break;
                    }
                }
            }

            Response.Redirect("CompetitionSetup.aspx?Code=" + gl.GetCompetitionCode());
            //string navigateurl = "javascript:history.go(-1);";
            //Response.Redirect(navigateurl);
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CopyEventsFromPrevComp.Visible = false;  //DEBUG

            if (Session["CurrentUserName"] == null)
            {
                CurrentUserID = "";
            }
            else
            {
                CurrentUserID = Session["CurrentUserName"].ToString();
            }
            CurrCompCode = gl.GetCompetitionCode();
            string CompCodeText = Request.QueryString.Get("Code");

            NewCompetition = false;
            if ((CompCodeText != "") && (CompCodeText != null))
            {
                gl.SetCompetitionCode(CompCodeText);
                CurrCompCode = CompCodeText;
                if (CurrCompCode == "NYTT")
                {
                    NewCompetition = true;
                }
            }

            System.Data.Objects.ObjectParameter CurrAccessLevel    = new System.Data.Objects.ObjectParameter("CurrentAccessLevel", "0");
            System.Data.Objects.ObjectParameter CurrCanEnterScores = new System.Data.Objects.ObjectParameter("CanEnterScores", "0");

            AthlEnt.GetAccessLevel(CurrentUserID, CurrCompCode, CurrAccessLevel, CurrCanEnterScores);
            AccessLevelint = Convert.ToInt32(CurrAccessLevel.Value);
            CanEnterScores = Convert.ToInt32(CurrCanEnterScores.Value);

            //--AccessLevel
            //--
            //--0 = Queries Only
            //--1 = Club Representative
            //--2 = Administrator
            //--3 = Selected Competition Only
            //
            //--    CanEnterScores 0 = No, 1 = Yes

            if (IsPostBack)
            {
                Message.Text = "";
                DateTime DateValue;
                string   ValinnV   = Convert.ToString(Vellir.SelectedValue);
                string   InnslDags = Dagsetning.Text;
                if (ValinnV != GamliVollur.Text)
                {
                    MotADO ado = new MotADO();

                    ado.GeymaVallarupplys(ValinnV);
                    Stadur.Text     = ado.ValinnStadur;
                    UtiEdaInni.Text = ado.ValidUtiInni;

                    if (UtiEdaInni.Text == "0")
                    {
                        UtiEdaInni.Text = "Utanhúss";
                    }
                    if (UtiEdaInni.Text == "1")
                    {
                        UtiEdaInni.Text = "Innanhúss";
                    }
                    if (UtiEdaInni.Text == "2")
                    {
                        UtiEdaInni.Text = "Utan- eða Innanhúss";
                    }


                    GamliVollur.Text = ValinnV.ToString();
                }


                if (InnslDags != GamlaDags.Text)
                {
                    string[] separators = { ".", "/", " " };
                    string[] words      = InnslDags.Split(separators, StringSplitOptions.RemoveEmptyEntries);
                    if (words[0].Length == 1)
                    {
                        words[0] = "0" + words[0];
                    }
                    if (words[1].Length == 1)
                    {
                        words[1] = "0" + words[1];
                    }
                    if (words[2].Length == 1)
                    {
                        words[2] = "200" + words[2];
                    }
                    else if (words[2].Length == 2)
                    {
                        words[2] = "20" + words[2];
                    }

                    InnslDags = words[0] + "." + words[1] + "." + words[2];
                    // if (words[0].Length >
                    if (InnslDags.Length == 8)
                    {
                        InnslDags = InnslDags.Substring(0, 2) + "." + InnslDags.Substring(2, 2) + "." + InnslDags.Substring(4, 4);
                        HeitiMots.Focus();
                    }
                    else
                    if (InnslDags.Length == 7)
                    {
                        InnslDags = "0" + InnslDags.Substring(0, 1) + "." + InnslDags.Substring(1, 2) + "." + InnslDags.Substring(3, 4);
                    }
                    else
                    if (InnslDags.Length == 6)
                    {
                        InnslDags = InnslDags.Substring(0, 2) + "." + InnslDags.Substring(2, 2) + ".20" + InnslDags.Substring(4, 2);
                    }
                    else
                    if (InnslDags.Length == 5)
                    {
                        InnslDags = "0" + InnslDags.Substring(0, 1) + "." + InnslDags.Substring(1, 2) + ".20" + InnslDags.Substring(3, 2);
                    }
                    else
                    if (InnslDags.Length == 4)
                    {
                        InnslDags = InnslDags.Substring(0, 2) + "." + InnslDags.Substring(2, 2) + "." + DateTime.Now.ToString("yyyy");
                    }
                    else
                    if (InnslDags.Length == 3)
                    {
                        InnslDags = "0" + InnslDags.Substring(0, 1) + "." + InnslDags.Substring(1, 2) + "." + DateTime.Now.ToString("yyyy");
                    }
                    else
                    if (InnslDags.Length == 2)
                    {
                        InnslDags = InnslDags + "." + DateTime.Now.ToString("MM.yyyy");
                    }
                    else
                    if (InnslDags.Length == 1)
                    {
                        InnslDags = "0" + InnslDags + "." + DateTime.Now.ToString("MM.yyyy");
                    }

                    if (!DateTime.TryParse(InnslDags, out DateValue))
                    {
                        Message.Text = "Dagsetning " + InnslDags + " er ekki í lagi.";
                    }
                    else
                    {
                        InnslDags = DateValue.ToShortDateString();
                        NoOfDays  = 1;
                    }
                    Dagsetning.Text = InnslDags;
                    GamlaDags.Text  = InnslDags;
                    HeitiMots.Focus();
                }
                if (CompetitionDate2.Text != "")
                {
                    if (!DateTime.TryParse(CompetitionDate2.Text, out DateValue))
                    {
                        Message.Text = "Dagsetning 2 " + CompetitionDate2.Text + " er ekki í lagi.";
                    }
                    else
                    {
                        AthlComp.Date2 = DateValue;
                        NoOfDays       = 2;
                    }
                }
                else
                {
                    AthlComp.Date2        = Convert.ToDateTime("1753-01-01 00:00:00.000");
                    CompetitionDate3.Text = "";
                    CompetitionDate4.Text = "";
                }
                if (CompetitionDate3.Text != "")
                {
                    if (!DateTime.TryParse(CompetitionDate3.Text, out DateValue))
                    {
                        Message.Text = "Dagsetning 3 " + CompetitionDate3.Text + " er ekki í lagi.";
                    }
                    else
                    {
                        AthlComp.Date3 = DateValue;
                        NoOfDays       = 3;
                    }
                }
                else
                {
                    AthlComp.Date3        = Convert.ToDateTime("1753-01-01 00:00:00.000");
                    CompetitionDate4.Text = "";
                }
                if (CompetitionDate4.Text != "")
                {
                    if (!DateTime.TryParse(CompetitionDate4.Text, out DateValue))
                    {
                        Message.Text = "Dagsetning 4 " + CompetitionDate4.Text + " er ekki í lagi.";
                    }
                    else
                    {
                        AthlComp.dagsetning4 = DateValue;
                        NoOfDays             = 4;
                    }
                }
                else
                {
                    AthlComp.dagsetning4 = Convert.ToDateTime("1753-01-01 00:00:00.000");
                }
                AthlComp.tegundstigakeppni = gl.TryConvertStringToInt32(TegundStigakeppni.SelectedValue.ToString());
            }
            else  //Not Postback - Page Load
            {
                //AccessLevelText = Session["CurrentAccessLevel"].ToString();
                //if ((AccessLevelText == "0") || (AccessLevelText == "") || (AccessLevelText == null))
                if ((AccessLevelint != 1) && (AccessLevelint != 2)) //Access is NOT Club Repesentative and NOT Administrator, Competition Creator or CompetitionUpdateAccess = Administrator
                {
                    //NewCompetitorButton.Visible = false;
                    //YourCompetitors.Visible = false;
                    //AddNewCompetitorsBtn.Visible = false;
                    SetupEvents.Visible = false;
                    //  Vista.Visible = false;
                    HeitiMots.ReadOnly         = true;
                    EnsktHeiti.ReadOnly        = true;
                    Dagsetning.ReadOnly        = true;
                    Vellir.Enabled             = false;
                    Stadur.ReadOnly            = true;
                    UtiEdaInni.ReadOnly        = true;
                    Motshaldari.ReadOnly       = true;
                    Yfirdomari.ReadOnly        = true;
                    SkranGjaldPrGrein.ReadOnly = true;
                    SkranGjPrBodhl.ReadOnly    = true;
                    SkranGjPrGreinU18.ReadOnly = true;
                    SkranGjPrBodhlU18.ReadOnly = true;
                    CompStatus.Enabled         = false;
                    TegundStigakeppni.Enabled  = false;
                    ReiknaIAAFStig.Enabled     = false;
                    ReiknaUnglStig.Enabled     = false;
                    Message.Text  = "Þú hefur ekki leyfi til að breyta uppsetningu mótsins";
                    Vista.Visible = false;
                }
                else
                {
                    Message.Text = "";
                }

                if ((gl.GetCompetitionCode() != "") && (gl.GetCompetitionCode() != "NYTT") && (NewCompetition == false))
                {
                    {
                        //SetupEvents.Visible = true;

                        CompetitionCode.Text = gl.GetCompetitionCode();
                        //CompCode2.Text = CompetitionCode.Text;
                        //CompCode4.Text = CompetitionCode.Text;
                        //CompCode7.Text = CompetitionCode.Text;

                        AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
                        AthlComp        = AthlCompCRUD.GetCompetitionRec(gl.GetCompetitionCode());
                        HeitiMots.Text  = AthlComp.Name;
                        EnsktHeiti.Text = AthlComp.ensktheitiamoti;
                        Dagsetning.Text = AthlComp.Date.ToShortDateString();
                        gl.SetGlobalValue("CompetitionName", AthlComp.Name);
                        gl.SetGlobalValue("EnglishCompetitionName", AthlComp.ensktheitiamoti);
                        UtiEdaInni.Text = AthlComp.OutdoorsOrIndoors.ToString();
                        gl.SetOutdoorsOrIndoors(UtiEdaInni.Text);

                        Int16 VenueIndex = 0;
                        System.Data.Objects.ObjectParameter Indx = new System.Data.Objects.ObjectParameter("Indx", typeof(Int32));

                        AthlEnt.IndexCompetitionVenue(AthlComp.keppnisvollur, Indx);
                        if (Int16.TryParse(Indx.Value.ToString(), out VenueIndex) == false)
                        {
                            VenueIndex = 0;
                        }
                        //VenueIndex = ReturnIndexOfVenue(AthlComp.keppnisvollur);

                        if (VenueIndex > 0)
                        {
                            Vellir.SelectedIndex = VenueIndex;
                        }

                        Stadur.Text = AthlComp.Location;
                        if (UtiEdaInni.Text == "0")
                        {
                            UtiEdaInni.Text = "Utanhúss";
                        }
                        if (UtiEdaInni.Text == "1")
                        {
                            UtiEdaInni.Text = "Innanhúss";
                        }

                        CompStatus.SelectedIndex        = AthlComp.Staða_móts;
                        TegundStigakeppni.SelectedValue = AthlComp.tegundstigakeppni.ToString();
                        Motshaldari.Text       = AthlComp.Organizer;
                        Yfirdomari.Text        = AthlComp.Judge;
                        Motsstjori.Text        = AthlComp.Director;
                        SkranGjaldPrGrein.Text = string.Format("{0:N2}", AthlComp.skraningargjaldprgrein);     //AthlComp.skraningargjaldprgrein.ToString();
                        SkranGjPrBodhl.Text    = string.Format("{0:N2}", AthlComp.Skráningargjld_f__boðhlaup); //.ToString();
                        SkranGjPrGreinU18.Text = string.Format("{0:N2}", AthlComp.Skráningargj__yngri_en_18_ára);
                        SkranGjPrBodhlU18.Text = string.Format("{0:N2}", AthlComp.Skráningargj__f_boðhl_y_18_ára);
                        //if (AthlComp.Reikna_unglingastig == 1)
                        //{
                        //    ReiknaUnglStig.Text = "Já";
                        //}
                        //else
                        //{
                        //    ReiknaUnglStig.Text = "Nei";
                        //}
                        ReiknaUnglStig.SelectedValue = AthlComp.Reikna_unglingastig.ToString();
                        //if (AthlComp.Reikna_IAAF_stig == 1)
                        //{
                        //    ReiknaIAAFStig.Text = "Já";
                        //}
                        //else
                        //{
                        //    ReiknaIAAFStig.Text = "Nei";
                        //}
                        ReiknaIAAFStig.SelectedValue = AthlComp.Reikna_IAAF_stig.ToString();

                        gl.SetCompetitionCode(AthlComp.Code);
                        gl.SetCompetitionName(AthlComp.Name);
                        gl.SetCompetionYear(AthlComp.Date.Year);
                        if (AthlComp.keppnisvollur != "")
                        {
                            gl.SetCompetitionVenue(AthlComp.keppnisvollur + ", " + AthlComp.Location);
                        }
                        else
                        {
                            gl.SetCompetitionVenue(AthlComp.Location);
                        }

                        Int32    NoOfDates = 0;
                        ListItem newItem   = new ListItem();
                        newItem       = new ListItem();
                        newItem.Text  = "Allir dagar";
                        newItem.Value = "%";
                        //AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                        var DatesInCompetition = AthlEnt.ReturnCompetitionEventDates(gl.GetCompetitionCode());
                        foreach (var result in DatesInCompetition)
                        {
                            NoOfDates     = NoOfDates + 1;
                            newItem       = new ListItem();
                            newItem.Text  = Convert.ToString(result);       // "Dagur 1"; // Convert.ToString(result.Dags);
                            newItem.Value = Convert.ToString(result) + "%"; // "D1%"; // Convert.ToString(result.Dags) + "%";
                        }
                        if (AthlComp.Date2 > Convert.ToDateTime("1900.01.01"))
                        {
                            CompetitionDate2.Visible = true;
                            CompetitionDate2.Text    = AthlComp.Date2.ToString("dd.MM.yyyy", CultureInfo.InvariantCulture);
                        }
                        if (AthlComp.Date3 > Convert.ToDateTime("1900.01.01"))
                        {
                            CompetitionDate3.Visible = true;
                            CompetitionDate3.Text    = AthlComp.Date3.ToString("dd.MM.yyyy", CultureInfo.InvariantCulture);
                        }
                        if (AthlComp.dagsetning4 > Convert.ToDateTime("1900.01.01"))
                        {
                            CompetitionDate4.Visible = true;
                            CompetitionDate4.Text    = AthlComp.dagsetning4.ToString("dd.MM.yyyy", CultureInfo.InvariantCulture);
                        }
                    }
                    HeitiMots.Focus();
                }
                else
                {
                    string SelNafn;
                    SelNafn                        = gl.GetSelNafn();
                    SetupEvents.Visible            = false;
                    CopyEventsFromPrevComp.Visible = false;
                    UpdateEventSetup.Visible       = false;
                    CompStatus.SelectedIndex       = 1;
                    Vista.Text                     = "Stofna";
                }
            }
        }
Exemple #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AthleticsEntities1      AthlEnt   = new AthleticsEntities1();
            Global                  gl        = new Global();
            AthleticCompetitionCRUD AthlCRUD  = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp  = new Athl_Competition();
            Athl_CompetitionEvents  AthlEvent = new Athl_CompetitionEvents();

            if (!IsPostBack)
            {
                var CurrAccLevlVar = Session["CurrentAccessLevel"];
                if (CurrAccLevlVar == null)
                {
                    string CurrUsrN    = gl.GetCurrUsrName();
                    string CurrAccLevl = gl.GetCurrAccLev();
                    Session["CurrentAccessLevel"] = CurrAccLevl;
                    Session["CurrentUserName"]    = CurrUsrN;
                }
                // AccessLevelText = "0" : Not logged in - Aðeins fyrirspurnir
                // AccessLevelText = "1" : Club Representative
                // AccessLevelText = "2" : Administrator
                // AccessLevelText = "3" : Can edit entry sheets
                // AccessLevelText = "4" : Competition Administrator

                NoOfEventLines = 0;
                CompCode.Text  = gl.GetCompetitionCode();

                string WrkCompCode = Request.QueryString.Get("Code");
                if ((WrkCompCode != "") && (WrkCompCode != null))
                {
                    CompCode.Text = WrkCompCode;
                    gl.SetCompetitionCode(CompCode.Text);
                }
                AthlComp = AthlCRUD.GetCompetitionRec(CompCode.Text);

                //                ÓsamþykktAfFRÍ,
                //                SamþykktAfFRÍ,
                //                OpiðFyrirSkráningu,
                //                LokaðFyrirSkráningu,
                //                StendurYfir,
                //                KeppniLokið
                bool ShowSaveValuesButton = false;
                if ((Session["CurrentAccessLevel"].ToString() == "2") || (Session["CurrentAccessLevel"].ToString() == "3") ||
                    (Session["CurrentAccessLevel"].ToString() == "4") ||
                    (gl.UserCanUpdateMeet(CompCode.Text, Session["CurrentUserName"].ToString()) == 1))  //2 = Admin)
                {
                    ShowSaveValuesButton = true;
                }
                if (AthlComp.Staða_móts == 5)
                {
                    ShowSaveValuesButton = false;
                }
                SaveValues.Visible = ShowSaveValuesButton;

                CompName.Text = AthlComp.Name;
                CompDate1     = string.Format("{0:dd.MM.yyyy}", AthlComp.Date);
                for (int ix = 0; ix < 4; ix++)
                {
                    CompetitionDateArr[ix]         = null;
                    CompetitionDateArrWithYear[ix] = Convert.ToDateTime("1900-01-01");
                }
                CompetitionDateArr[0]         = ReturnIslWeekDayAndDDMM(AthlComp.Date);
                CompetitionDateArrWithYear[0] = AthlComp.Date; //ToString("yyyy-MM-dd");  //string.Format("{0:YYYY.MM.dd}", AthlComp.Date);
                NoOfDatesinCompetition        = 1;
                if (AthlComp.Date2 > Convert.ToDateTime("1900-01-01"))
                {
                    CompetitionDateArr[1]         = ReturnIslWeekDayAndDDMM(AthlComp.Date2);
                    CompetitionDateArrWithYear[1] = AthlComp.Date2; //ToString("yyyy-MM-dd"); // string.Format("{0:YYYY.MM.dd}", AthlComp.Date2);
                    NoOfDatesinCompetition        = 2;
                    if (AthlComp.Date3 > Convert.ToDateTime("1900-01-01"))
                    {
                        CompetitionDateArr[2]         = ReturnIslWeekDayAndDDMM(AthlComp.Date3);
                        CompetitionDateArrWithYear[2] = AthlComp.Date3;   //ToString("yyyy-MM-dd");  // string.Format("{0:YYYY.MM.dd}", AthlComp.Date3);
                        NoOfDatesinCompetition        = 3;
                        if (AthlComp.dagsetning4 > Convert.ToDateTime("1900-01-01"))
                        {
                            CompetitionDateArr[3]         = ReturnIslWeekDayAndDDMM(AthlComp.dagsetning4);
                            CompetitionDateArrWithYear[3] = AthlComp.dagsetning4; //ToString("yyyy-MM-dd");  //string.Format("{0:YYYY.MM.dd}", AthlComp.dagsetning4);
                            NoOfDatesinCompetition        = 4;
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AthleticsEntities1      AthlEnt  = new AthleticsEntities1();
            Athl_Competition        AthlComp = new Athl_Competition();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

            if (IsPostBack)
            {
                if (SelAgeFrom.SelectedIndex != LastSelectedAgeGrFrom)
                {
                    //Athuga þetta
                    // LastSelectedAgeGrFrom = SelAgeFrom.SelectedIndex;
                    // SelAgeTo.SelectedIndex = LastSelectedAgeGrFrom;
                }
            }
            else
            {
                Global Gl = new Global();
                CompCode.Text = Gl.GetCompetitionCode();

                string CompCodeText = Request.QueryString.Get("Code");

                if ((CompCodeText != "") && (CompCodeText != null))
                {
                    //CompCodeText = HttpUtility.HtmlDecode(CompCodeText);
                    CompCodeText = CompCodeText.ToUpper();
                    AthlComp     = AthlCRUD.GetCompetitionRec(CompCodeText);

                    Int32 NoOfDates = 0;
                    SelectDay.Items.Clear();
                    ListItem newItem = new ListItem();

                    newItem       = new ListItem();
                    newItem.Text  = "Allir dagar";
                    newItem.Value = "%";
                    SelectDay.Items.Add(newItem);
                    //AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                    var DatesInCompetition = AthlEnt.ReturnCompetitionEventDates(Gl.GetCompetitionCode());
                    foreach (var result in DatesInCompetition)
                    {
                        NoOfDates    = NoOfDates + 1;
                        newItem      = new ListItem();
                        newItem.Text = Convert.ToString(result); // "Dagur 1"; // Convert.ToString(result.Dags);
                        DateTime CompD = Convert.ToDateTime(result.ToString());
                        newItem.Value = CompD.ToString("yyyy.MM.dd");
                        //Convert.ToString(result) + "%"; // "D1%"; // Convert.ToString(result.Dags) + "%";
                        SelectDay.Items.Add(newItem);
                    }
                    if (NoOfDates <= 1)
                    {
                        SelectDay.Visible      = false;
                        SelectDayLabel.Visible = false;
                    }

                    Int32 NoOfAgeGroups = 0;
                    NoOfAgeGroupsInArr = 0;
                    SelAgeFrom.Items.Clear();
                    SelAgeTo.Items.Clear();
                    var CompetitonAgeFromAndAgeTo = AthlEnt.ReturnCompAgeFromAndAgeTo(CompCodeText);

                    foreach (var AgeFrAndAgeTo in CompetitonAgeFromAndAgeTo)
                    {
                        NoOfAgeGroups      = NoOfAgeGroups + 1;
                        NoOfAgeGroupsInArr = NoOfAgeGroupsInArr + 1;
                        newItem            = new ListItem();
                        newItem.Text       = Convert.ToString(AgeFrAndAgeTo.AgeFromText);
                        newItem.Value      = Convert.ToString(AgeFrAndAgeTo.AgeFromValue);
                        AgeGroupFrom[NoOfAgeGroupsInArr] = newItem.Value.ToString();
                        SelAgeFrom.Items.Add(newItem);
                        newItem       = new ListItem();
                        newItem.Text  = Convert.ToString(AgeFrAndAgeTo.AgeToText);
                        newItem.Value = Convert.ToString(AgeFrAndAgeTo.AgeToValue);
                        AgeGroupTo[NoOfAgeGroupsInArr] = newItem.Value.ToString();
                        SelAgeTo.Items.Add(newItem);
                    }
                    if (NoOfAgeGroups <= 1)
                    {
                        SelAgeFrom.Visible   = false;
                        AgeFromLabel.Visible = false;
                        SelAgeTo.Visible     = false;
                        AgeToLabel.Visible   = false;
                    }
                    LastSelectedAgeGrFrom = 1;
                    if (AthlComp.Code != "")
                    {
                        Gl.SetCompetitionCode(CompCodeText);
                        CompCode.Text = CompCodeText;
                        Gl.SetGlobalValue("CompetitionName", AthlComp.Name);
                        Gl.SetGlobalValue("EnglishCompetitionName", AthlComp.ensktheitiamoti);
                        Gl.SetOutdoorsOrIndoors(AthlComp.OutdoorsOrIndoors.ToString());

                        Gl.SetCompetitionCode(AthlComp.Code);
                        Gl.SetCompetitionName(AthlComp.Name);
                        Gl.SetCompetionYear(AthlComp.Date.Year);
                        if (AthlComp.keppnisvollur != "")
                        {
                            Gl.SetCompetitionVenue(AthlComp.keppnisvollur + ", " + AthlComp.Location);
                        }
                        else
                        {
                            Gl.SetCompetitionVenue(AthlComp.Location);
                        }
                        if (AthlComp.CompetitonType == 0) //Road Race
                        {
                            SelMaxLinesLabel.Visible = false;
                            MaxNoOfLines.Visible     = false;
                            MaxNoOfLines.Text        = "99999";
                            SelectDayLabel.Visible   = false;
                            SelectDay.Visible        = false;
                            SelectDay.Text           = "%";
                        }
                        // Session["CurrentAccessLevel"] = "";
                    }
                }

                LinkToPage.Text = "http://thor.fri.is/SelectedCompetitionResults.aspx?Code=" + CompCode.Text;

                Events.NavigateUrl                = "~/SelectedCompetitionEvents.aspx?Code=" + CompCode.Text;
                Competitors.NavigateUrl           = "~/SelectedCompetitionCompetitors.aspx?Code=" + CompCode.Text;
                MedalTable.NavigateUrl            = "~/MedalTable.aspx?Code=" + CompCode.Text;
                PointsStanding.NavigateUrl        = "~/Points.aspx?Code=" + CompCode.Text;
                PointsStandingMIYngri.NavigateUrl = "~/PointsStandingMIYngri.aspx?Code=" + CompCode.Text;
                TopPerfByIAAFPts.NavigateUrl      = "~/TopPerfByIAAFPts.aspx?Code=" + CompCode.Text;
                RecordsPbsAndSbs.NavigateUrl      = "~/RecordsPersonalBestSeasonBests.aspx?Code=" + CompCode.Text;

                if ((CompCode.Text == "") || (CompCode.Text == null))
                {
                    Response.Redirect("Default.aspx");
                }

                AthlComp             = AthlCRUD.GetCompetitionRec(CompCode.Text);
                CompetitionName.Text = AthlComp.Name + " - " + AthlComp.Date.ToShortDateString() + " - " + AthlComp.Location;

                //   if (AthlComp.tegundstigakeppni == 5) //Meistaramót Íslands m IAAF stigum
                if ((AthlComp.tegundstigakeppni == 1) || (AthlComp.tegundstigakeppni == 2) || (AthlComp.tegundstigakeppni == 5)) //Aldurfl, Bikar eða Meistaramót Íslands m IAAF stigum

                {
                    PointsStanding.Visible = true;
                }
                else
                {
                    PointsStanding.Visible = false;
                }
                if (AthlComp.tegundstigakeppni == 3)
                {
                    PointsStandingMIYngri.Visible = true;
                }
                else
                {
                    PointsStandingMIYngri.Visible = false;
                }
                string AccessLevelText = "";
                if (Session["CurrentAccessLevel"] == null)
                {
                    AccessLevelText = "0";
                }
                else
                {
                    AccessLevelText = Session["CurrentAccessLevel"].ToString();
                }
                if (AccessLevelText == "0")
                {
                    YourCompetitors.Visible      = false;
                    YourCompetitorsLabel.Visible = false;
                }

                if (AthlComp.Reikna_IAAF_stig == 1)
                {
                    TopPerfByIAAFPts.Visible = true;
                }
                else
                {
                    TopPerfByIAAFPts.Visible = false;
                }
                if ((AthlComp.CompetitonType == 0) || (AthlComp.Date.Year < 2015))
                {
                    RecordsPbsAndSbs.Visible = false;
                }
            }
        }
        protected void LoadCompetitorsPage()
        {
            AthleticsEntities1 Athl = new AthleticsEntities1();

            Global gl       = new Global();
            string CompCode = "";

            CompCode = gl.GetCompetitionCode();
            Athl_Competition        AthlComp = new Athl_Competition();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

            AthlComp = AthlCRUD.GetCompetitionRec(CompCode);
            Int32  CurrentAccessLevel = 0;
            string ClubList           = "";
            Int32  CurrLblNo          = 0;
            Int32  CurrChkBoxNo       = 0;
            Int32  CurrLineNo         = 0;
            Int32  CurrTabIndex       = 0;
            Int32  NoEventsInAgeGr    = 0;
            string CurrAgeGroupCode   = "";

            Int32[] EventLineArr = new Int32[50];
            AmountPrIndividualEvent   = AthlComp.skraningargjaldprgrein;
            AmountPrRelayTeam         = AthlComp.Skráningargjld_f__boðhlaup;
            AmountPrIndividualUnder18 = AthlComp.Skráningargj__yngri_en_18_ára;
            AmountPrRelayTeamUnder18  = AthlComp.Skráningargj__f_boðhl_y_18_ára;
            string RegistrationInfo;

            if (AmountPrIndividualUnder18 == 0)
            {
                AmountPrIndividualUnder18 = AmountPrIndividualEvent;
            }
            if (AmountPrRelayTeamUnder18 == 0)
            {
                AmountPrRelayTeamUnder18 = AmountPrRelayTeam;
            }

            CompetitonName.Text = gl.GetGlobalValue("CompetitionName");

            string CurrentAccessLevelStr = "0";
            string CurrentUserName       = Session["CurrentUserName"].ToString();

            if (Session["CurrentAccessLevel"] != null)
            {
                CurrentAccessLevelStr = Session["CurrentAccessLevel"].ToString();
            }
            if (CurrentAccessLevelStr != "")
            {
                CurrentAccessLevel = Convert.ToInt32(CurrentAccessLevelStr);
            }
            if ((CurrentUserName == "") || (CurrentAccessLevel == 0))
            {
                Message.Text = "Þú verður að skrá þig inn - ekki er hægt að birta keppendur þína fyrr.";
                return;
            }
            else
            {
                if (CurrentAccessLevel == 2)
                {
                    ClubCode.Text = "Administrator: Keppendur frá öllum félögum";
                }
                else
                {
                    if (CurrentAccessLevel == 1)
                    {
                        var ClubsForUsr = Athl.ClubsForUser(CurrentUserName);
                        foreach (var ClubInUserClubs in ClubsForUsr)
                        {
                            if (ClubList == "")
                            {
                                ClubList = ClubInUserClubs.Club.ToString();
                            }
                            else
                            {
                                ClubList = ClubList + ", " + ClubInUserClubs.Club.ToString();
                            }
                        }

                        ClubCode.Text = ClubList;
                    }
                }
                var AgeGroupsAndEvents          = Athl.CompetitionAgeGroupsAndEvents(CompCode, 0).ToList(); //Athuga með að birta boðhlaupssveitirnar!!!
                var CompetitorsPrClubPrAgeGroup = Athl.CompetitorsAndRegistrationInCompetition2(CompCode, CurrentUserName).ToList();
                //  CurrLblNo = CurrLblNo + 10000;
                TotalAmtPrClub               = 0;
                TotalAmtPrClubUnder18        = 0;
                NoOfCompetitorsPrClub        = 0;
                NoOfCompetitorsPrClubUnder18 = 0;
                foreach (var AgeGAndEv in AgeGroupsAndEvents)
                {
                    CurrLblNo        = CurrLblNo + 1;
                    CurrAgeGroupCode = AgeGAndEv.AgeGr;
                    AddLabelWithFontSize(CurrLblNo, AgeGAndEv.AgeGroupName, "500px", "left", "x-large");
                    NoEventsInAgeGr = Convert.ToInt32(AgeGAndEv.NoOfEvents.ToString());

                    for (int Ixxx = 1; Ixxx <= 30; Ixxx++)
                    {
                        EventLineArr[Ixxx] = 0;
                    }

                    for (int IEvNo = 1; IEvNo <= NoEventsInAgeGr; IEvNo++)
                    {
                        CurrLblNo = CurrLblNo + 1;
                        switch (IEvNo)
                        {
                        case 1:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine01.ToString(), AgeGAndEv.Event01.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine01);
                            break;

                        case 2:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine02.ToString(), AgeGAndEv.Event02.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine02);
                            break;

                        case 3:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine03.ToString(), AgeGAndEv.Event03.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine03);
                            break;

                        case 4:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine04.ToString(), AgeGAndEv.Event04.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine04);
                            break;

                        case 5:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine05.ToString(), AgeGAndEv.Event05.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine05);
                            break;

                        case 6:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine06.ToString(), AgeGAndEv.Event06.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine06);
                            break;

                        case 7:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine07.ToString(), AgeGAndEv.Event07.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine07);
                            break;

                        case 8:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine08.ToString(), AgeGAndEv.Event08.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine08);
                            break;

                        case 9:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine09.ToString(), AgeGAndEv.Event09.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine09);
                            break;

                        case 10:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine10.ToString(), AgeGAndEv.Event10.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine10);
                            break;

                        case 11:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine11.ToString(), AgeGAndEv.Event11.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine11);
                            break;

                        case 12:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine12.ToString(), AgeGAndEv.Event12.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine12);
                            break;

                        case 13:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine13.ToString(), AgeGAndEv.Event13.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine13);
                            break;

                        case 14:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine14.ToString(), AgeGAndEv.Event14.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine14);
                            break;

                        case 15:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine15.ToString(), AgeGAndEv.Event15.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine15);
                            break;

                        case 16:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine16.ToString(), AgeGAndEv.Event16.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine16);
                            break;

                        case 17:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine17.ToString(), AgeGAndEv.Event17.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine17);
                            break;

                        case 18:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine18.ToString(), AgeGAndEv.Event18.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine18);
                            break;

                        case 19:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine19.ToString(), AgeGAndEv.Event19.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine19);
                            break;

                        case 20:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine20.ToString(), AgeGAndEv.Event20.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine20);
                            break;

                        case 21:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine21.ToString(), AgeGAndEv.Event21.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine21);
                            break;

                        case 22:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine22.ToString(), AgeGAndEv.Event22.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine22);
                            break;

                        case 23:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine23.ToString(), AgeGAndEv.Event23.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine23);
                            break;

                        case 24:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine24.ToString(), AgeGAndEv.Event24.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine24);
                            break;

                        case 25:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine25.ToString(), AgeGAndEv.Event25.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine25);
                            break;

                        case 26:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine26.ToString(), AgeGAndEv.Event26.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine26);
                            break;

                        case 27:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine27.ToString(), AgeGAndEv.Event27.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine27);
                            break;

                        case 28:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine28.ToString(), AgeGAndEv.Event28.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine28);
                            break;

                        case 29:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine29.ToString(), AgeGAndEv.Event29.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine29);
                            break;

                        case 30:
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, IEvNo, AgeGAndEv.EventLine30.ToString(), AgeGAndEv.Event30.ToString(), "49px", "center", 0, true, false);
                            EventLineArr[IEvNo] = Convert.ToInt32(AgeGAndEv.EventLine30);
                            break;
                        }
                    }
                    PH1.Controls.Add(new LiteralControl("<br />"));

                    TotalAmtPrAgeGroup                  = 0;
                    NoOfCompetitorsPrAgeGroup           = 0;
                    NoOfRegistrationsIndividuals        = 0;
                    NoOfRegistrationsIndividualsUnder18 = 0;

                    foreach (var CompPrClub in CompetitorsPrClubPrAgeGroup)
                    {
                        if (CompPrClub.AgeGroup == AgeGAndEv.AgeGr)
                        {
                            NoOfCompetitorsPrAgeGroup = NoOfCompetitorsPrAgeGroup + 1;
                            NoOfCompetitorsPrClub     = NoOfCompetitorsPrClub + 1;
                            CurrChkBoxNo = 0;
                            Int32  CompBibNo = Convert.ToInt32(CompPrClub.BibNo);
                            string CompName  = CompPrClub.Name.ToString();
                            string CompClub  = CompPrClub.Club.ToString();
                            string CompAgeGr = CompPrClub.AgeGroup.ToString();
                            string CompAge   = CompPrClub.Age.ToString();
                            if (Convert.ToInt32(CompAge) < 18)
                            {
                                NoOfCompetitorsPrClubUnder18 = NoOfCompetitorsPrClubUnder18 + 1;
                            }
                            string CompBirthYear   = CompPrClub.BirthYear.ToString();
                            string DateOfBirthText = CompPrClub.BirthDateText;
                            if (DateOfBirthText == "")
                            {
                                DateOfBirthText = CompBirthYear;
                            }
                            CurrLineNo = CurrLineNo + 1;
                            CurrLblNo  = CurrLblNo + 1;
                            AddTextBoxWithBorderStyle(CurrLineNo, CurrLblNo, 0, "BibNo", CompBibNo.ToString(), "40px", "right", 0, true, true);
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, "", "10px", "right", "");
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, CompName, "200px", "left", "");
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, "", "10px", "right", "");
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, DateOfBirthText, "100px", "right", "");
                            //CurrLblNo = CurrLblNo + 1;
                            //AddLabelWithFontSize(CurrLblNo, CompBirthYear, "40px", "right", "");
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, CompAge, "40px", "right", "");
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, "", "10px", "right", "");
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, CompClub, "80px", "left", "");
                            CurrLblNo = CurrLblNo + 1;
                            AddLabelWithFontSize(CurrLblNo, "", "8px", "right", "");
                            //     CurrLblNo = CurrLblNo + 1;
                            //     AddLabelWithFontSize(CurrLblNo, CompAgeGr, "65px", "right", "");

                            for (int Ickb = 1; Ickb <= NoEventsInAgeGr; Ickb++)
                            {
                                CurrChkBoxNo = CurrChkBoxNo + 1;
                                CurrTabIndex = CurrTabIndex + 1;
                                switch (Ickb)
                                {
                                case 1:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[1], CompPrClub.Eve01.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve01.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType01));
                                    break;

                                case 2:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[2], CompPrClub.Eve02.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve02.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType02));
                                    break;

                                case 3:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[3], CompPrClub.Eve03.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve03.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType03));
                                    break;

                                case 4:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[4], CompPrClub.Eve04.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve04.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType04));
                                    break;

                                case 5:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[5], CompPrClub.Eve05.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve05.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType05));
                                    break;

                                case 6:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[6], CompPrClub.Eve06.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve06.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType06));
                                    break;

                                case 7:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[7], CompPrClub.Eve07.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve07.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType07));
                                    break;

                                case 8:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[8], CompPrClub.Eve08.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve08.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType08));
                                    break;

                                case 9:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[9], CompPrClub.Eve09.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve09.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType09));
                                    break;

                                case 10:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[10], CompPrClub.Eve10.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve10.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType10));
                                    break;

                                case 11:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[11], CompPrClub.Eve11.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve11.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType11));
                                    break;

                                case 12:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[12], CompPrClub.Eve12.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve12.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType12));
                                    break;

                                case 13:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[13], CompPrClub.Eve13.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve13.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType13));
                                    break;

                                case 14:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[14], CompPrClub.Eve14.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve14.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType14));
                                    break;

                                case 15:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[15], CompPrClub.Eve15.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve15.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType15));
                                    break;

                                case 16:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[16], CompPrClub.Eve16.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve16.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType16));
                                    break;

                                case 17:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[17], CompPrClub.Eve17.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve17.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType17));
                                    break;

                                case 18:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[18], CompPrClub.Eve18.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve18.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType18));
                                    break;

                                case 19:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[19], CompPrClub.Eve19.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve19.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType19));
                                    break;

                                case 20:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[20], CompPrClub.Eve20.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve20.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType20));
                                    break;

                                case 21:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[21], CompPrClub.Eve21.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve21.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType21));
                                    break;

                                case 22:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[22], CompPrClub.Eve22.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve22.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType22));
                                    break;

                                case 23:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[23], CompPrClub.Eve23.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve23.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType23));
                                    break;

                                case 24:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[24], CompPrClub.Eve24.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve24.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType24));
                                    break;

                                case 25:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[25], CompPrClub.Eve25.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve25.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType25));
                                    break;

                                case 26:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[26], CompPrClub.Eve26.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve26.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType26));
                                    break;

                                case 27:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[27], CompPrClub.Eve27.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve27.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType27));
                                    break;

                                case 28:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[28], CompPrClub.Eve28.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve28.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType28));
                                    break;

                                case 29:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[29], CompPrClub.Eve29.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve29.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType29));
                                    break;

                                case 30:
                                    AddCheckBox(CompPrClub.BibNo.ToString(), EventLineArr[30], CompPrClub.Eve30.ToString(), "51px", CurrTabIndex, false);
                                    UpdateTotals(CompPrClub.Eve30.ToString(), Convert.ToInt32(AgeGAndEv.AgeGroupAgeTo), Convert.ToInt32(AgeGAndEv.DetailedEventType30));
                                    break;
                                }
                            }
                            PH1.Controls.Add(new LiteralControl("<br />"));
                            //Message.Text = "No of Controls: " + PH1.Controls.Count.ToString();
                        }
                    }
                    CurrLineNo       = CurrLineNo + 1;
                    RegistrationInfo = "";
                    if (NoOfRegistrationsIndividuals > 0)
                    {
                        RegistrationInfo = " Samtals skráningar: " + string.Format("{0:N0}", NoOfRegistrationsIndividuals);
                    }
                    if (NoOfRegistrationsIndividualsUnder18 > 0)
                    {
                        RegistrationInfo = RegistrationInfo + " " +
                                           " Samtals skráningar 17 og yngri: " + string.Format("{0:N0}", NoOfRegistrationsIndividualsUnder18);
                    }
                    AddTextBoxWithBorderStyle(CurrLineNo, CurrLineNo, CurrLineNo, "TotPrAgeGr", "Samtals keppendur: " +
                                              string.Format("{0:N0}", NoOfCompetitorsPrAgeGroup) + RegistrationInfo + " Samtals skráningargjöld: " +
                                              string.Format("{0:N2}", TotalAmtPrAgeGroup), "1000px", "left", CurrLineNo, true, true);
                    PH1.Controls.Add(new LiteralControl("<br />"));
                    PH1.Controls.Add(new LiteralControl("<br />"));
                }
                PH1.Controls.Add(new LiteralControl("<br />"));

                CurrLineNo       = CurrLineNo + 1;
                RegistrationInfo = "";
                if (TotalNoOfRegistrationsIndividualsUnder18 == 0)
                {
                    AddTextBoxWithBorderStyle(CurrLineNo, CurrLineNo, CurrLineNo, "TotClub1", "Samtals keppendur: " +
                                              string.Format("{0:N0}", NoOfCompetitorsPrClub) +
                                              " Fjöldi skráninga: " + string.Format("{0:N0}", TotalNoOfRegistrationsIndividuals) +
                                              " Samtals skráningargjöld: " + string.Format("{0:N2}", TotalAmtPrClub), "1000px", "left", CurrLineNo, true, true);
                    PH1.Controls.Add(new LiteralControl("<br />"));
                }
                else
                {
                    AddTextBoxWithBorderStyle(CurrLineNo, CurrLineNo, CurrLineNo, "TotClubU18", "Samtals keppendur 17 og yngri: " +
                                              string.Format("{0:N0}", NoOfCompetitorsPrClubUnder18) +
                                              " Fjöldi skráninga: " + string.Format("{0:N0}", TotalNoOfRegistrationsIndividualsUnder18) +
                                              " Samtals skráningargjöld: " + string.Format("{0:N2}", TotalAmtPrClubUnder18), "1000px", "left", CurrLineNo, true, true);
                    PH1.Controls.Add(new LiteralControl("<br />"));
                    RegistrationInfo = RegistrationInfo + " 18 ára og eldri";

                    if (TotalNoOfRegistrationsIndividuals > 0)
                    {
                        //RegistrationInfo = " Samtals skráningar: " + string.Format("{0:N0}", TotalNoOfRegistrationsIndividuals);
                        AddTextBoxWithBorderStyle(CurrLineNo, CurrLineNo, CurrLineNo, "TotClub", "Samtals keppendur" + RegistrationInfo + ": " +
                                                  string.Format("{0:N0}", NoOfCompetitorsPrClub - NoOfCompetitorsPrClubUnder18) +
                                                  " Fjöldi skráninga: " + string.Format("{0:N0}", TotalNoOfRegistrationsIndividuals) +
                                                  " Samtals skráningargjöld: " + string.Format("{0:N2}", TotalAmtPrClub - TotalAmtPrClubUnder18), "1000px", "left", CurrLineNo, true, true);
                        PH1.Controls.Add(new LiteralControl("<br />"));

                        AddTextBoxWithBorderStyle(CurrLineNo, CurrLineNo, CurrLineNo, "TotClub2", "Heildarfjöldi keppenda:" +
                                                  string.Format("{0:N0}", NoOfCompetitorsPrClub) +
                                                  " Fjöldi skráninga: " + string.Format("{0:N0}", TotalNoOfRegistrationsIndividuals + TotalNoOfRegistrationsIndividualsUnder18) +
                                                  " Samtals skráningargjöld: " + string.Format("{0:N2}", TotalAmtPrClub), "1000px", "left", CurrLineNo, true, true);
                        PH1.Controls.Add(new LiteralControl("<br />"));
                    }
                }
                //if (TotalNoOfRegistrationsIndividualsUnder18 > 0)
                //{
                //    RegistrationInfo = RegistrationInfo + " " +
                //        " Samtals skráningar 17 og yngri: " + string.Format("{0:N0}", TotalNoOfRegistrationsIndividualsUnder18);
                //}

                //AddTextBoxWithBorderStyle(CurrLineNo, CurrLineNo, CurrLineNo, "TotPrAgeGr", "Samtals keppendur: " +
                //    string.Format("{0:N0}", NoOfCompetitorsPrClub) + " Samtals skráningargjöld: " + RegistrationInfo +
                //    string.Format("{0:N2}", TotalAmtPrClub - Tot), "1000px", "left", CurrLineNo, true, true);
                //PH1.Controls.Add(new LiteralControl("<br />"));
            }
        }
Exemple #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global Gl = new Global();

            CompCode.Text = Gl.GetCompetitionCode();
            string SelectedClubText          = Gl.GetGlobalValue("ShowForClub");
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

            AthlComp             = AthlCRUD.GetCompetitionRec(CompCode.Text);
            CompetitionName.Text = AthlComp.Name + " - " + AthlComp.Date.ToShortDateString() + " - " + AthlComp.Location;
            AccessLevelText      = Session["CurrentAccessLevel"].ToString();
            CurrentUserName.Text = Session["CurrentUserName"].ToString();
            ObjectParameter CurrAccLevelParam;

            CurrAccLevelParam = new ObjectParameter("CurrentAccessLevel", typeof(global::System.String));
            ObjectParameter CanEnterScoresParam;

            CanEnterScoresParam = new ObjectParameter("CanEnterScores", typeof(global::System.String));
            // ObjectParameter CurrAccLevelParam = new ObjectParameter("CurrentAccessLevel", "");
            // ObjectParameter CanEnterScoresParam = new ObjectParameter("CanEnterScores", "");
            AthlEnt.GetAccessLevel(CurrentUserName.Text, CompCode.Text, CurrAccLevelParam, CanEnterScoresParam);
            string CompetitionAccessLevel = CurrAccLevelParam.Value.ToString();
            var    CurrAccLevlVar         = Session["CurrentAccessLevel"];

            if (CurrAccLevlVar == null)
            {
                string CurrUsrN    = Gl.GetCurrUsrName();
                string CurrAccLevl = Gl.GetCurrAccLev();
                if ((CurrUsrN == null) || (CurrAccLevl == null))
                {
                    string msg = "Sessionin þín er útrunnin. Þú verður að ská þig inn aaftur";
                    Response.Write("<script>alert('" + msg + "')</script>");
                }
                Session["CurrentAccessLevel"] = CurrAccLevl;
                Session["CurrentUserName"]    = CurrUsrN;
            }
            //StaðaM 3=Lokað f skrán, 5=Lokið
            //CurrAccL 2=Admin,3=Can Edit Sheets, 4=Comp Admin
            string CurrAccLev = Session["CurrentAccessLevel"].ToString();

            Session["CurrentAccessLevel"] = CurrAccLev;

            //string UserAcclevelToCompetition = "";
            //ObjectParameter NewUserAccessTxt;
            //NewUserAccessTxt = new ObjectParameter("NewUserAccessTxt", typeof(global::System.String));

            //AthlEnt.GetUserAccessToCompetition(AthlComp.Code, CurrentUserName.Text, NewUserAccessTxt);
            //UserAcclevelToCompetition = NewUserAccessTxt.ToString();

            if ((AthlComp.Staða_móts == 2) || ((CurrAccLev == "2") && (AthlComp.Staða_móts != 5)) ||
                ((CurrAccLev == "3") && (AthlComp.Staða_móts != 5)) ||
                ((CurrAccLev == "4") && (AthlComp.Staða_móts != 5)) ||
                ((CompetitionAccessLevel == "2") && (AthlComp.Staða_móts != 5)))
            {
                NewRegistration.Visible  = true;
                NewRegLabel.Visible      = true;
                NewCompetitors.Visible   = true;
                CompWithRegLabel.Visible = true;
            }
            else
            {
                NewRegistration.Visible  = false;
                NewRegLabel.Visible      = false;
                NewCompetitors.Visible   = false;
                CompWithRegLabel.Visible = false;
            }
            if (!IsPostBack)
            {
                ListItem newItem = new ListItem();
                newItem       = new ListItem();
                newItem.Text  = "*Öll þín félög";
                newItem.Value = "%" + CurrentUserName.Text;
                SelectClubDropDown.Items.Add(newItem);
            }
            else
            {
                RegisterRelayTeams.NavigateUrl = "~/RegisterRelay.aspx?Club=" + SelectClubDropDown.SelectedValue.ToString();
            }
            if ((SelectedClubText != null) && (SelectedClubText != ""))
            {
                SelectClubDropDown.SelectedValue = SelectedClubText;
                Gl.SetGlobalValue("ShowForClub", "");
            }
        }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Athl_Competition        AthlComp     = new Athl_Competition();
            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();

            Global Gl = new Global();

            string CompCodeText = Request.QueryString.Get("Code");

            if ((CompCodeText != "") && (CompCodeText != null))
            {
                CompCodeText = CompCodeText.ToUpper();

                AthlComp = AthlCompCRUD.GetCompetitionRec(CompCodeText);
                if (AthlComp.Code != "")
                {
                    Gl.SetCompetitionCode(AthlComp.Code);
                    CompCode.Text = AthlComp.Code;
                    Gl.SetGlobalValue("CompetitionName", AthlComp.Name);
                    Gl.SetGlobalValue("EnglishCompetitionName", AthlComp.ensktheitiamoti);
                    Gl.SetOutdoorsOrIndoors(AthlComp.OutdoorsOrIndoors.ToString());

                    Gl.SetCompetitionName(AthlComp.Name);
                    Gl.SetCompetionYear(AthlComp.Date.Year);
                    if (AthlComp.keppnisvollur != "")
                    {
                        Gl.SetCompetitionVenue(AthlComp.keppnisvollur + ", " + AthlComp.Location);
                    }
                    else
                    {
                        Gl.SetCompetitionVenue(AthlComp.Location);
                    }
                    //Session["CurrentAccessLevel"] = "";
                }
            }

            CompCode.Text = Gl.GetCompetitionCode();

            Events.NavigateUrl                = "~/SelectedCompetitionEvents.aspx?Code=" + CompCode.Text;
            CompetitionResults.NavigateUrl    = "~/SelectedCompetitionResults.aspx?Code=" + CompCode.Text;
            PointsStanding.NavigateUrl        = "~/Points.aspx?Code=" + CompCode.Text;
            PointsStandingMIYngri.NavigateUrl = "~/PointsStandingMIYngri.aspx?Code=" + CompCode.Text;



            if ((CompCode.Text == "") || (CompCode.Text == null))
            {
                Response.Redirect("Default.aspx");
            }

            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

            AthlComp = AthlCRUD.GetCompetitionRec(CompCode.Text);
            Gl.SetCompetitionName(AthlComp.Name);
            CompetitionName.Text = AthlComp.Name + " - " + AthlComp.Date.ToShortDateString() + " - " + AthlComp.Location;
            if ((AthlComp.tegundstigakeppni == 1) || (AthlComp.tegundstigakeppni == 2) || (AthlComp.tegundstigakeppni == 5)) //Yngri, bikar eða Meistaramót Íslands m IAAF stigum
            {
                PointsStanding.Visible = true;
            }
            else
            {
                PointsStanding.Visible = false;
            }
            if (AthlComp.tegundstigakeppni == 3)
            {
                PointsStandingMIYngri.Visible = true;
            }
            else
            {
                PointsStandingMIYngri.Visible = false;
            }
            if (Session["CurrentAccessLevel"] == null)
            {
                Session["CurrentAccessLevel"] = "0";
            }
            AccessLevelText = Session["CurrentAccessLevel"].ToString();

            if (!IsPostBack)
            {
                LinkToPage.Text = "http://thor.fri.is/SelectedCompetitionCompetitors.aspx?Code=" + CompCode.Text;

                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if (AccessLevelText == "0")
                {
                    //AddCompeitors.Visible = false;
                    YourCompetitors.Visible      = false;
                    YourCompetitorsLabel.Visible = false;
                    CoachPage.Visible            = false;
                    CoachPageLabel.Visible       = false;
                }
            }
        }
Exemple #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();

            if (IsPostBack == false)
            {
                string CompCodeText    = Request.QueryString.Get("Code");
                string EventLineNoText = Request.QueryString.Get("LineNo");
                if ((CompCodeText != "") && (EventLineNoText != ""))
                {
                    AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

                    CompCode.Text    = CompCodeText;
                    EventLineNo.Text = EventLineNoText;
                    Athl_CompetitionEvents AthlEvent = new Athl_CompetitionEvents();
                    Athl_Competition       AthlComp  = new Athl_Competition();
                    AthlComp             = AthlCRUD.GetCompetitionRec(CompCode.Text);
                    CompetitionLanguage  = AthlComp.tungumal;
                    CompetitionName.Text = AthlComp.Name;

                    Int32 EventLin = Convert.ToInt32(EventLineNo.Text);
                    AthlEvent = AthlCRUD.GetCompetitionEvent(CompCode.Text, EventLin);
                    if (AthlComp.tungumal == 0)
                    {
                        EventName.Text = AthlEvent.heitigreinar;
                    }
                    else
                    {
                        EventName.Text = AthlEvent.heitigreinar + " - " + AthlEvent.ensktheitigreinar;
                    }
                    if (AthlComp.tungumal == 0)
                    {
                        if (AthlEvent.sigurvegariifyrra != "")
                        {
                            AdditionalInfo1.Text = "Sigurv. í fyrra: " + AthlEvent.sigurvegariifyrra + " " + AthlEvent.arangurifyrra;
                        }
                        if (AthlEvent.motsmetshafi != "")
                        {
                            MeetRec1.Text = "Mótsmet: " + AthlEvent.motsmet + " " + AthlEvent.motsmetshafi + ", " + AthlEvent.felagmotsmetshafa; // +" " + AthlEvent.dagsetningmotsmets.ToString("yyyy");
                        }
                        if (AthlEvent.motsmetshafi2 != "")
                        {
                            MeetRec2.Text = "Mótsmet: " + AthlEvent.motsmet2 + " " + AthlEvent.motsmetshafi2 + ", " + AthlEvent.felagmotsmetshafa2;// +" " + AthlEvent.dagsetningmotsmets2.ToString("yyyy");
                        }
                        if (AthlEvent.motsmetshafi3 != "")
                        {
                            MeetRec3.Text = "Mótsmet: " + AthlEvent.motsmet3 + " " + AthlEvent.motsmetshafi3 + ", " + AthlEvent.felagmotsmetshafa3; // +" " + AthlEvent.dagsetningmotsmets3.ToString("yyyy");
                        }
                    }
                    if (AthlComp.tungumal == 1)
                    {
                        if (AthlEvent.sigurvegariifyrra != "")
                        {
                            AdditionalInfo1.Text = "Winner last year " + AthlEvent.sigurvegariifyrra + " " + AthlEvent.arangurifyrra;
                        }
                        if (AthlEvent.motsmetshafi != "")
                        {
                            MeetRec1.Text = "Games Record: " + AthlEvent.motsmet + " " + AthlEvent.motsmetshafi + ", " + AthlEvent.felagmotsmetshafa; // +" " + AthlEvent.dagsetningmotsmets.ToString("yyyy");
                        }
                        if (AthlEvent.motsmetshafi2 != "")
                        {
                            MeetRec2.Text = "Games Record: " + AthlEvent.motsmet2 + " " + AthlEvent.motsmetshafi2 + ", " + AthlEvent.felagmotsmetshafa2; // +" " + AthlEvent.dagsetningmotsmets2.ToString("yyyy");
                        }
                        if (AthlEvent.motsmetshafi3 != "")
                        {
                            MeetRec3.Text = "Games Record: " + AthlEvent.motsmet3 + " " + AthlEvent.motsmetshafi3 + ", " + AthlEvent.felagmotsmetshafa3; // +" " + AthlEvent.dagsetningmotsmets3.ToString("yyyy");
                        }
                    }
                    if (AthlComp.tungumal == 2)
                    {
                        if (AthlEvent.sigurvegariifyrra != "")
                        {
                            AdditionalInfo1.Text = "Sigurv í fyrra/Winner last year: " + AthlEvent.sigurvegariifyrra + " " + AthlEvent.arangurifyrra;
                        }
                        if (AthlEvent.motsmetshafi != "")
                        {
                            MeetRec1.Text = "Mótsmet/Games Record: " + AthlEvent.motsmet + " " + AthlEvent.motsmetshafi + ", " + AthlEvent.felagmotsmetshafa; // +" " + AthlEvent.dagsetningmotsmets.ToString("yyyy");
                        }
                        if (AthlEvent.motsmetshafi2 != "")
                        {
                            MeetRec2.Text = "Mótsme/Games Record: " + AthlEvent.motsmet2 + " " + AthlEvent.motsmetshafi2 + ", " + AthlEvent.felagmotsmetshafa2; // +" " + AthlEvent.dagsetningmotsmets2.ToString("yyyy");
                        }
                        if (AthlEvent.motsmetshafi3 != "")
                        {
                            MeetRec3.Text = "Mótsmet/Games Record: " + AthlEvent.motsmet3 + " " + AthlEvent.motsmetshafi3 + ", " + AthlEvent.felagmotsmetshafa3; // +" " + AthlEvent.dagsetningmotsmets3.ToString("yyyy");
                        }
                    }
                    if (AthlEvent.tegundgreinar == 1)  //Track Event
                    {
                        TrackEventGridView.Visible = true;
                        FieldEventGridView.Visible = false;
                    }
                    else
                    {
                        TrackEventGridView.Visible = false;
                        FieldEventGridView.Visible = true;
                    }
                }
            }
        }
Exemple #21
0
        protected void VistaNyttMot_Click(object sender, EventArgs e)
        {
            Global   Gl         = new Global();
            bool     reiknaungl = false;
            bool     reiknaIAAF = false;
            DateTime Dags;
            bool     dagsOk    = false;
            Int16    tegstigak = -1;
            string   valinnv   = "";

            if (HeitiMots.Text == String.Empty)
            {
                Message.Text = "Þú verður að fylla út heiti mótsins";
                return;
            }
            if (EnsktHeiti.Text == String.Empty)
            {
                Message.Text = "Þú ættir að fylla út enska heiti mótsins";
                //return;
            }
            dagsOk = DateTime.TryParse(Dagsetning.Text, out Dags);
            if (!dagsOk)
            {
                Message.Text = "Dagsetning er ekki í lagi.";
                return;
            }
            valinnv = Convert.ToString(Vellir.SelectedValue);
            if (valinnv == String.Empty)
            {
                Message.Text = "Þú verður að velja keppnisvöllinn";
                return;
            }
            if (Motshaldari.Text == String.Empty)
            {
                Message.Text = "Þú verður að fylla út upplýsingar um mótshaldarann";
                return;
            }
            if (Yfirdomari.Text == String.Empty)
            {
                Message.Text = "Þú ættir að fylla út heiti yfirdómarans";
                //return;
            }
            if (SkranGjaldPrGrein.Text == String.Empty)
            {
                SkranGjaldPrGrein.Text = "0";
            }
            if (SkranGjPrBodhl.Text == String.Empty)
            {
                SkranGjPrBodhl.Text = "0";
            }
            if (ReiknaUnglStig.SelectedValue == "1")
            {
                reiknaungl = true;
            }
            else
            {
                reiknaungl = false;
            }
            if (ReiknaIAAFStig.SelectedValue == "1")
            {
                reiknaIAAF = true;
            }
            else
            {
                reiknaIAAF = false;
            }
            tegstigak = Convert.ToInt16(TegundStigakeppni.SelectedValue.ToString());

            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp     = new Athl_Competition();

            if (CompetitionCode.Text == "")
            {
                AthlComp = AthlCompCRUD.InitAthlComp();
            }
            else
            {
                AthlComp = AthlCompCRUD.GetCompetitionRec(CompetitionCode.Text);
            }

            AthlComp.Name            = HeitiMots.Text;
            AthlComp.ensktheitiamoti = EnsktHeiti.Text;
            AthlComp.Date            = Dags;
            AthlComp.keppnisvollur   = valinnv;
            AthlComp.Location        = Stadur.Text;
            if (UtiEdaInni.Text == "Utanhúss")
            {
                AthlComp.OutdoorsOrIndoors = 0;
            }
            else
            {
                AthlComp.OutdoorsOrIndoors = 1;
            }
            AthlComp.Organizer = Motshaldari.Text.ToUpper();
            AthlComp.Judge     = Yfirdomari.Text;
            AthlComp.skraningargjaldprgrein         = Convert.ToDecimal(SkranGjaldPrGrein.Text);
            AthlComp.Skráningargjld_f__boðhlaup     = Convert.ToDecimal(SkranGjPrBodhl.Text);
            AthlComp.Skráningargj__yngri_en_18_ára  = Convert.ToDecimal(SkranGjPrGreinU18.Text);
            AthlComp.Skráningargj__f_boðhl_y_18_ára = Convert.ToDecimal(SkranGjPrBodhlU18.Text);
            AthlComp.Reikna_unglingastig            = Convert.ToByte(reiknaungl);
            AthlComp.Reikna_IAAF_stig  = Convert.ToByte(reiknaIAAF);
            AthlComp.tegundstigakeppni = tegstigak;
            AthlComp.CompetitonType    = 1; //Hlaup = 0, Mót = 1

            if (CompetitionCode.Text == "")
            {
                CompetitionCode.Text = AthlCompCRUD.InsertNewRec(AthlComp);
            }
            else
            {
                AthlCompCRUD.UpdateRec(AthlComp);
            }

            Gl.SetCompetitionCode(AthlComp.Code);
            Gl.SetCompetitionName(AthlComp.Name);
        }
Exemple #22
0
        protected void RelaysGrid_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Global Gl = new Global();

            AthleticsEntities1 AthlEnt = new AthleticsEntities1();

            string CommandN   = e.CommandName;
            string CommandArg = e.CommandArgument.ToString();

            string[] EventNoAndBib = CommandArg.Split(';');

            if (CommandN == "DeleteTeam")
            {
                //                <script type="text/javascript">
                //    function myTestFunction()
                //    {
                //        if (confirm('Do you want to proceed ?'))
                //        {
                //            return true;
                //        }
                //        else
                //        {
                //            return false;
                //        }
                //    }
                //</script>

                //            ScriptManager.RegisterStartupScript(this, typeof(string), "confirm",
                //            "myTestFunction();", true);
                //Hér vantar confirm  Yes No !!!

                AthlEnt.DeleteCompetitorInEvent(CompCode.Text, Convert.ToInt32(EventNoAndBib[0]), Convert.ToInt32(EventNoAndBib[1]));
                //Eyða þarf Skipan boðhlaupssveitar hér
                AthlEnt.DeleteCompetitorInComp(CompCode.Text, CommandArg[1]);
                Response.Redirect("RegisterRelay.aspx");
            }

            if (CommandN == "Runners")
            {
                Gl.SetCompetitionCode(CompCode.Text);
                Gl.SetGlobalValue("EventLineNo", EventNoAndBib[0]);
                Gl.SetGlobalValue("SelectedClub", ClubDropDown.SelectedValue.ToString());
                Gl.SetGlobalValue("RelayTeamName", EventNoAndBib[2]);
                Gl.SetGlobalValue("CompetitorBibNo", EventNoAndBib[1]);
                Response.Redirect("RelayTeamNames.aspx");
            }

            Int32 EventLineNo = Convert.ToInt32(EventNoAndBib[0]);       //e.CommandArgument);
            AthleticCompetitionCRUD       AthlCRUD        = new AthleticCompetitionCRUD();
            Athl_CompetitionEvents        AthlEvent       = new Athl_CompetitionEvents();
            Athl_Competition              AthlCompetition = new Athl_Competition();
            Athl_CompetitorsInCompetition AthlCompInComp  = new Athl_CompetitorsInCompetition();
            Athl_CompetitorsInEvent       AthlCompInEv    = new Athl_CompetitorsInEvent();


            var RelayInfoDs = AthlEnt.PrepareToRegisterNewRelayTeam(
                CompCode.Text, EventLineNo, ClubDropDown.SelectedValue.ToString());

            ///     NewBibNoOut, GenderOut, TeamNameOut, YearOfBirthOut);
            Int32  NewBibNo          = 0;
            Int32  Gender            = 0;
            string TeamName          = "";
            Int32  YearOfBirth       = 0;
            Int32  LastLineNoInEvent = 0;

            foreach (var RelayInfoRec in RelayInfoDs)
            {
                NewBibNo          = Convert.ToInt32(RelayInfoRec.NewBibNoOut.ToString());
                Gender            = Convert.ToInt32(RelayInfoRec.GenderOut.ToString());
                TeamName          = RelayInfoRec.TeamNameOut.ToString();
                YearOfBirth       = Convert.ToInt32(RelayInfoRec.YearOfBirthOut.ToString());
                LastLineNoInEvent = Convert.ToInt32(RelayInfoRec.LastLineNoInEvent.ToString());
            }


            AthlEvent       = AthlCRUD.GetCompetitionEvent(CompCode.Text, EventLineNo);
            AthlCompetition = AthlCRUD.GetCompetitionRec(CompCode.Text);

            AthlCompInComp                = AthlCRUD.InitCompetitorInComp();
            AthlCompInComp.mot            = CompCode.Text;
            AthlCompInComp.rasnumer       = NewBibNo;
            AthlCompInComp.kyn            = Gender;
            AthlCompInComp.nafn           = TeamName;
            AthlCompInComp.faedingarar    = YearOfBirth;
            AthlCompInComp.felag          = ClubDropDown.SelectedValue.ToString();
            AthlCompInComp.aldurkeppanda  = AthlCompetition.Date.Year - YearOfBirth;
            AthlCompInComp.bodhlaupssveit = 1;
            AthlCRUD.InsertCompetitorInCompetition(AthlCompInComp);

            AthlCompInEv = AthlCRUD.InitCompetitorInEvent();

            AthlCompInEv.mot          = CompCode.Text;
            AthlCompInEv.greinarnumer = EventLineNo;
            AthlCompInEv.rasnumer     = NewBibNo;
            AthlCompInEv.nafn         = TeamName;
            AthlCompInEv.faedingarar  = YearOfBirth;
            AthlCompInEv.felag        = ClubDropDown.SelectedValue.ToString();
            AthlCRUD.RegisterCompetitorInEvent(CompCode.Text, AthlEvent, NewBibNo, AthlCompInComp, 0, 0);

            Response.Redirect("RegisterRelay.aspx?Club=" + ClubDropDown.SelectedValue.ToString());
        }
Exemple #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global Gl = new Global();

            if (IsPostBack)
            {
                Gl.SetGlobalValue("TVEventStat", EventStat.SelectedValue.ToString());
                Gl.SetGlobalValue("TVGenderFilter", GenderFilter.SelectedValue.ToString());
                Gl.SetGlobalValue("TVSelectedDate", SelectDay.SelectedValue.ToString());
            }
            if (IsPostBack == false)
            {
                AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

                var CompCodeForScoreboard  = new ObjectParameter("compCodeForScorb", typeof(global::System.String));
                AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                int RetValue = 0;

                RetValue      = AthlEnt.ReturnCompetitionForScoreb(CompCodeForScoreboard);
                CompCode.Text = CompCodeForScoreboard.Value.ToString();
                Athl_Competition AthlCompetitionRecord = new Athl_Competition();
                AthlCompetitionRecord = AthlCRUD.GetCompetitionRec(CompCode.Text);
                CompName.Text         = AthlCompetitionRecord.Name;


                Int32    NoOfDates = 0;
                ListItem newItem   = new ListItem();
                newItem = new ListItem();
                var DatesInCompetition = AthlEnt.ReturnCompetitionEventDates(CompCode.Text);
                foreach (var result in DatesInCompetition)
                {
                    NoOfDates     = NoOfDates + 1;
                    newItem       = new ListItem();
                    newItem.Text  = Convert.ToString(result); // "Dagur 1"; // Convert.ToString(result.Dags);
                    newItem.Value = Convert.ToString(result); // +"%"; // "D1%"; // Convert.ToString(result.Dags) + "%";
                    SelectDay.Items.Add(newItem);
                }


                if (NoOfDates <= 1)
                {
                    SelectDay.Visible   = false;
                    SelDayLabel.Visible = false;
                }
                else
                {
                    SelectDay.Visible   = true;
                    SelDayLabel.Visible = true;
                }

                string SelectedEventStatus  = Gl.GetGlobalValue("TVEventStat");
                string SelectedGenderFilter = Gl.GetGlobalValue("TVGenderFilter");
                string SelectedEventDate    = Gl.GetGlobalValue("TVSelectedDate");
                if ((SelectedEventStatus == "") && (SelectedGenderFilter == "") && (SelectedEventDate == ""))
                {
                    Gl.SetGlobalValue("TVEventStat", EventStat.SelectedValue.ToString());
                    Gl.SetGlobalValue("TVGenderFilter", GenderFilter.SelectedValue.ToString());
                    Gl.SetGlobalValue("TVSelectedDate", SelectDay.SelectedValue.ToString());
                }
                else
                {
                    EventStat.SelectedValue    = SelectedEventStatus;
                    GenderFilter.SelectedValue = SelectedGenderFilter;
                    SelectDay.SelectedValue    = SelectedEventDate;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AthleticsEntities1      AthlEnt  = new AthleticsEntities1();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            Global   gl = new Global();
            DateTime FirstD;
            DateTime LastD;
            DateTime CurrentDateAndTime = DateTime.Now;
            string   EventDateTim;
            string   CompCode = gl.GetCompetitionCode();

            //string EventLineNo = gl.GetCompetitionEventNo();
            if (CompCode == "")
            {
                CompCode = Request.QueryString.Get("Code");
            }
            string EventLineNo      = Request.QueryString.Get("Event");
            string HeatNumberFilter = "";

            CompetitionVenue.Text = gl.GetCompetitionVenue();
            Int32 EvNo = Convert.ToInt32(EventLineNo);

            AthlCompEventRec = AthlCRUD.GetCompetitionEvent(CompCode, EvNo);
            //if (!IsPostBack)
            //{
            //    HeatNoFilter.Text = gl.GetGlobalValue("HeatNumberFilter");
            //}
            //CompetitionName.Text = gl.GetCompetitionName();
            AthlCompetition      = AthlCRUD.GetCompetitionRec(CompCode);
            CompetitionName.Text = AthlCompetition.Name;

            EventDateTim = gl.ReturnEventDateAndTime(CompCode, EvNo);

            if (AthlCompetition.tungumal == 0)  //Icelandic
            {
                CompetitionEventName.Text = AthlCompEventRec.heitigreinar + " - " + EventDateTim;
            }
            else
            {
                CompetitionEventName.Text = AthlCompEventRec.heitigreinar + " - " + AthlCompEventRec.ensktheitigreinar + " - " + EventDateTim;
            }

            //string QryStr = Request.QueryString.Get("HeatNoFilter");
            //if (QryStr != null)
            //{
            //    HeatNumberFilter = QryStr;
            //    HeatNoFilter.Text = QryStr;
            //    if (HeatNumberFilter != "%")
            //    {
            //        CompetitionEventName.Text = CompetitionEventName.Text + " - Riðill " + HeatNumberFilter; ;
            //    }
            //}

            DateAndTime.Text = "Pr.: " + CurrentDateAndTime.ToString();

            var CompetitionDatesRec = AthlEnt.ReturnCompetitionDates(CompCode);

            foreach (var CompDatesRec in CompetitionDatesRec)  //There is only one record here
            {
                FirstD = Convert.ToDateTime(CompDatesRec.FirstDate);
                LastD  = Convert.ToDateTime(CompDatesRec.LastDate);
                if (FirstD == LastD)
                {
                    CompetitionDates.Text = FirstD.ToString("d");
                }
                else
                {
                    CompetitionDates.Text = FirstD.ToString("d") + " - " + LastD.ToString("d");
                }
            }


            FillPage(CompCode, EvNo, AthlCompEventRec, HeatNumberFilter);
        }
        protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            string[] WordsArray;
            string   AgeGr;
            Int32    Gend;
            Int32    AgeFr;
            Int32    AgeTo;
            Int32    ColNo;
            Int32    TegundStigak = 0;

            string EventLineNoText = "";
            bool   UserIsSignedin  = false;

            if (e.Row.RowType == DataControlRowType.Header)
            {
                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if ((AccessLevelText == "0") || (AccessLevelText == "") || (AccessLevelText == null))
                {
                    UserIsSignedin = false;
                    //ModifyDateTime.Visible = false;
                    SetPrizeCermonyColumnVisible = false;
                }
                else
                {
                    UserIsSignedin = true;
                    AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
                    Athl_Competition        AthlComp     = new Athl_Competition();
                    if (CompCode.Text != "")
                    {
                        AthlComp = AthlCompCRUD.GetCompetitionRec(CompCode.Text);
                        if (AthlComp.DisplayColumnForPrizeCeremony == 1)
                        {
                            SetPrizeCermonyColumnVisible = true;
                        }
                        TegundStigak = AthlComp.tegundstigakeppni;
                    }
                }
                ColNoForHeitiHTMLSkrar = GetColumnIndexByName(e.Row, "heitihtmlskrar");
                ColNoForPrizeCeremony  = GetColumnIndexByName(e.Row, "tilkynnaverdlaunaafhendingu");
                ColNoForPDFResults     = ColNoForPrizeCeremony + 3;
                ColNoForStigagrein     = GetColumnIndexByName(e.Row, "stigagrein");
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int RowIx = e.Row.RowIndex;
                EventLineNoText = GridView3.DataKeys[e.Row.RowIndex].Values[1].ToString();

                ColNo = GetColumnIndexByName(e.Row, "ShowCompetitors");
                HyperLink hp = new HyperLink();

                hp.Text = "Keppendur"; //e.Row.Cells[ColNo].Text;

                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if ((AccessLevelText == "0") || (AccessLevelText == "") || (AccessLevelText == null))
                {
                    hp.NavigateUrl = "CompetitorsInEv.aspx?Code=" + CompCode.Text + "&LineNo=" + EventLineNoText;
                }
                else
                {
                    hp.NavigateUrl = "UpdateEventResults.aspx?Event=" + EventLineNoText;
                }

                e.Row.Cells[ColNo].Controls.Add(hp);
            }

            if (TegundStigak == 0)
            {
                e.Row.Cells[ColNoForStigagrein].Visible = false;
            }
            if (SetPrizeCermonyColumnVisible == false)
            {
                e.Row.Cells[ColNoForPrizeCeremony].Visible     = false;
                e.Row.Cells[ColNoForPrizeCeremony + 1].Visible = false;
            }
            //WrkFileName =  @"C:/Pdfs/" + CompCode.Text + @"/" + e.Row.Cells[ColNoForHeitiHTMLSkrar].Text;

            //WrkFileName = @"~/" + e.Row.Cells[ColNoForHeitiHTMLSkrar].Text;

            String path = Server.MapPath(@"~/" + e.Row.Cells[ColNoForHeitiHTMLSkrar].Text); //MyResources/PassedFileName.pdf");

            //if (File.Exists(path))
            e.Row.Cells[ColNoForHeitiHTMLSkrar].Visible = false;


            //if (File.Exists(WrkFileName))


            ////if (File.Exists(path))
            ////{
            ////    e.Row.Cells[ColNoForPDFResults].Visible = true;

            ////    HyperLink hp = new HyperLink();
            ////    hp.Text = ".";
            ////    hp.NavigateUrl = path; // WrkFileName;
            ////    e.Row.Cells[ColNoForPDFResults].Controls.Add(hp);
            ////}
            ////else
            ////{
            e.Row.Cells[ColNoForPDFResults].Visible = false;
            ////}
        }
Exemple #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Global             gl      = new Global();
                AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                CompCode.Text        = gl.GetCompetitionCode();
                CompetitionName.Text = gl.GetCompetitionName();
                AthlCompRec          = AthlCRUD.GetCompetitionRec(CompCode.Text);

                CompDatesArr[1] = "";
                CompDatesArr[2] = "";
                CompDatesArr[3] = "";

                SelectDay.Items.Clear();
                Int32    NoOfDates = 0;
                ListItem newItem   = new ListItem();
                newItem       = new ListItem();
                newItem.Text  = "Allir dagar";
                newItem.Value = "%";
                SelectDay.Items.Add(newItem);
                var DatesInCompetition = AthlEnt.ReturnCompetitionEventDates(CompCode.Text);
                foreach (var result in DatesInCompetition)
                {
                    NoOfDates     = NoOfDates + 1;
                    newItem       = new ListItem();
                    newItem.Text  = Convert.ToString(result);       // "Dagur 1"; // Convert.ToString(result.Dags);
                    newItem.Value = Convert.ToString(result) + "%"; // "D1%"; // Convert.ToString(result.Dags) + "%";
                    SelectDay.Items.Add(newItem);
                    if (NoOfDates < 4)
                    {
                        CompDatesArr[NoOfDates] = Convert.ToString(result);
                    }
                }

                if (NoOfDates <= 1)
                {
                    SelectDayLabel.Visible = false;
                    SelectDay.Visible      = false;
                }
                else
                {
                    SelectDayLabel.Visible = true;
                    SelectDay.Visible      = true;
                }
                Int32 NoOfAgeGroups = 0;
                NoOfAgeGroupsInArr = 0;

                SelAgeFrom.Items.Clear();
                SelAgeTo.Items.Clear();
                var CompetitonAgeFromAndAgeTo = AthlEnt.ReturnCompAgeFromAndAgeTo(CompCode.Text);

                foreach (var AgeFrAndAgeTo in CompetitonAgeFromAndAgeTo)
                {
                    NoOfAgeGroups      = NoOfAgeGroups + 1;
                    NoOfAgeGroupsInArr = NoOfAgeGroupsInArr + 1;
                    newItem            = new ListItem();
                    newItem.Text       = Convert.ToString(AgeFrAndAgeTo.AgeFromText);
                    newItem.Value      = Convert.ToString(AgeFrAndAgeTo.AgeFromValue);
                    //AgeGroupFrom[NoOfAgeGroupsInArr] = newItem.Value.ToString();
                    SelAgeFrom.Items.Add(newItem);
                    newItem       = new ListItem();
                    newItem.Text  = Convert.ToString(AgeFrAndAgeTo.AgeToText);
                    newItem.Value = Convert.ToString(AgeFrAndAgeTo.AgeToValue);
                    //AgeGroupTo[NoOfAgeGroupsInArr] = newItem.Value.ToString();
                    SelAgeTo.Items.Add(newItem);
                }
                if (NoOfAgeGroups <= 1)
                {
                    SelAgeFrom.Visible   = false;
                    AgeFromLabel.Visible = false;
                    SelAgeTo.Visible     = false;
                    AgeToLabel.Visible   = false;
                }
                //LastSelectedAgeGrFrom = 1;
            }
        }