示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Athl_CompetitionEvents  AthlCompEvent = new Athl_CompetitionEvents();
         AthleticCompetitionCRUD AthlCRUD      = new AthleticCompetitionCRUD();
         Global gl = new Global();
         CompCode.Text = gl.GetCompetitionCode();
         //Int32 EvLineNo = Convert.ToInt32(gl.GetCompetitionEventNo());
         //EventLineNo.Text = gl.GetCompetitionEventNo();
         string EventLineNoText = Request.QueryString.Get("Event");
         Int32  EvLineNo        = Convert.ToInt32(EventLineNoText);
         EventLineNo.Text = EventLineNoText;
         AthlCompEvent    = AthlCRUD.GetCompetitionEvent(CompCode.Text, EvLineNo);
         EventName.Text   = AthlCompEvent.heitigreinar;
         Gender.Text      = AthlCompEvent.kyn.ToString();
         if (AthlCompEvent.aldurtil == 0)
         {
             AgeTo.Text = "999";
         }
         else
         {
             AgeTo.Text = AthlCompEvent.aldurtil.ToString();
         }
     }
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string CompCode    = Request.QueryString.Get("Code");
            string EventLineNo = Request.QueryString.Get("LineNo");
            Int32  EventLin    = Convert.ToInt32(EventLineNo);
            Athl_CompetitionEvents AthlEvent = new Athl_CompetitionEvents();

            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

            AthlEvent = AthlCRUD.GetCompetitionEvent(CompCode, EventLin);

            if (AthlEvent.stadakeppni == 0)
            {
                Response.Redirect("CompetitorsInEv.aspx?Code=" + CompCode + "&LineNo=" + EventLineNo);
            }
            else
            if (AthlEvent.stadakeppni == 1)
            {
                Response.Redirect("EventProgressLiveUpdate.aspx?EventLineNo=" + EventLineNo + "&Code=" + CompCode);
            }
            else
            if (AthlEvent.stadakeppni == 2)
            {
                Response.Redirect("PrintEventResults.aspx?Event=" + EventLineNo + "&Code=" + CompCode);
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global Gl = new Global();

            if (!IsPostBack)
            {
                string LoginUserID = Session["CurrentUserName"].ToString();
                if ((LoginUserID != null) && (LoginUserID != ""))
                {
                    Athl_CompetitionEvents  AthlCompEv = new Athl_CompetitionEvents();
                    AthleticCompetitionCRUD AthlCRUD   = new AthleticCompetitionCRUD();
                    CompCode.Text        = Gl.GetCompetitionCode();
                    CompName.Text        = Gl.GetCompetitionName();
                    EventLineNo.Text     = Gl.GetGlobalValue("EventLineNo");
                    CompetitorBibNo.Text = Gl.GetGlobalValue("CompetitorBibNo");
                    Club.Text            = Gl.GetGlobalValue("SelectedClub");
                    AthlCompEv           = AthlCRUD.GetCompetitionEvent(CompCode.Text, Convert.ToInt32(EventLineNo.Text));
                    EventName.Text       = AthlCompEv.heitigreinar;
                    RelayTeamName.Text   = Gl.GetGlobalValue("RelayTeamName");
                }
                else
                {
                    CompCode.Text        = "";
                    CompName.Text        = "";
                    EventLineNo.Text     = "";
                    CompetitorBibNo.Text = "";
                    Club.Text            = "";
                    Vista.Visible        = false;

                    ErrorMsg.Text = "Notandi er ekki lengur skráður inn";
                    return;
                }
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SelBest8.Visible = false;

                Global gl = new Global();

                AthleticCompetitionCRUD AthlCRUD     = new AthleticCompetitionCRUD();
                Athl_CompetitionEvents  CompEventRec = new Athl_CompetitionEvents();
                AthleticsEntities1      AthlEnt1     = new AthleticsEntities1();
                string EventLineNoText = Request.QueryString.Get("Event");

                CompEventRec = AthlCRUD.GetCompetitionEvent(gl.GetCompetitionCode(), Convert.ToInt32(EventLineNoText));  //gl.GetCompetitionEventNo()));

                if (gl.GetEventType() == "TRACK")
                {
                    SelectSeedingTypeTrack.Visible = true;
                    SelectSeedingTypeField.Visible = false;

                    if (CompEventRec.fjoldiibrauta < 1)
                    {
                        throw new InvalidOperationException(string.Format(
                                                                "Þú verður að fylla út fjölda brauta í hlaupi '{0}'",
                                                                CompEventRec.heitigreinar));
                    }
                }
                else
                {
                    SelectSeedingTypeTrack.Visible = false;
                    SelectSeedingTypeField.Visible = true;
                    Int32           IsEventReadyForFinal3Rounds = 0;
                    ObjectParameter readyReturnValue            = new ObjectParameter("readyReturnValue", 0);
                    //AthlEnt1.ReadyForSelectFirst8ForFinal(gl.GetCompetitionCode(),
                    //      Convert.ToInt32(gl.GetCompetitionEventNo()), readyReturnValue);
                    AthlEnt1.ReadyForSelectFirst8ForFinal(gl.GetCompetitionCode(),
                                                          Convert.ToInt32(EventLineNoText), readyReturnValue);

                    IsEventReadyForFinal3Rounds = Convert.ToInt32(readyReturnValue.Value);
                    if (IsEventReadyForFinal3Rounds == 1)
                    {
                        SelBest8.Visible = true;
                    }
                }
                EventName.Text = gl.GetCompetitonEventName();
            }
        }
示例#5
0
        protected void ModifyDateTime_Click(object sender, EventArgs e)
        {
            //EKKI NOTAÐ LENGUR - Var notað í GridViw3
            bool RefreshPage = false;
            AthleticCompetitionCRUD AthlCRUD  = new AthleticCompetitionCRUD();
            Athl_CompetitionEvents  AthlEvent = new Athl_CompetitionEvents();
            AthleticsEntities1      AthlEnt   = new AthleticsEntities1();
            Global gl = new Global();

            string   CompCode           = gl.GetCompetitionCode();
            string   NewDateText        = "";
            string   NewTimeText        = "";
            Int32    CurrentRowNo       = 0;
            Int32    CurrentEventLineNo = 0;
            Int32    NoOfEvents         = GridView3.Rows.Count;
            DateTime NewDate;
            DateTime NewTime;
            DateTime EmptyDateTime = DateTime.ParseExact("17530101 00:00:00", "yyyyMMdd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);

            for (CurrentRowNo = 0; CurrentRowNo < NoOfEvents; CurrentRowNo++)
            {
                CurrentEventLineNo = (Int32)this.GridView3.DataKeys[CurrentRowNo]["greinnumer"];
                TextBox EventDateTextBox = (TextBox)GridView3.Rows[CurrentRowNo].FindControl("DagsGreinar");
                NewDateText = EventDateTextBox.Text;
                TextBox EventTimeTextBox = (TextBox)GridView3.Rows[CurrentRowNo].FindControl("TimiGreinar");
                NewTimeText = EventTimeTextBox.Text;
                NewDate     = gl.TryConvertStringToDate(NewDateText);
                NewTime     = gl.TryConvertStringToTime(NewTimeText);
                if ((NewDate > EmptyDateTime) && (NewTime > EmptyDateTime))
                {
                    AthlEvent = AthlCRUD.GetCompetitionEvent(CompCode, CurrentEventLineNo);
                    if ((NewDate.ToString("d") != AthlEvent.dagsetning.ToString("d")) || (NewTime.ToShortTimeString() != AthlEvent.timi.ToShortTimeString()))
                    {
                        AthlEvent.dagsetning = NewDate;
                        AthlEvent.timi       = NewTime;
                        AthlEnt.UpdateEventDateTimeAndStatus(CompCode, CurrentEventLineNo, NewDate, NewTime, AthlEvent.stadakeppni,
                                                             AthlEvent.tilkynnaverdlaunaafhendingu);
                        RefreshPage = true;
                    }
                }
            }
            if (RefreshPage == true)
            {
                Response.Redirect("NyttMot.aspx" + "?Comp=" + CompCode);
            }
        }
示例#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 + " : ";
            }
        }
示例#7
0
        protected void SelectButton_Click(object sender, EventArgs e)
        {
            Global gl = new Global();
            AthleticCompetitionCRUD       AthlCRUD              = new AthleticCompetitionCRUD();
            Athl_CompetitionEvents        AthlCompEvent         = new Athl_CompetitionEvents();
            Athl_CompetitorsInCompetition AthlCompInCompetition = new Athl_CompetitorsInCompetition();
            //Int32 EvLineNo = Convert.ToInt32(gl.GetCompetitionEventNo());
            string      EventLineNoText = Request.QueryString.Get("Event");
            Int32       EvLineNo        = Convert.ToInt32(EventLineNoText);
            GridViewRow CurrRow;
            Int32       Index = 0;
            bool        Res   = false;
            Int32       BibNo = 0;

            AthlCompEvent = AthlCRUD.GetCompetitionEvent(CompCode.Text, EvLineNo);
            CheckBox SelectedCandidate;

            for (int i = 0; i < Candidates.Rows.Count; i++)
            {
                SelectedCandidate = (CheckBox)Candidates.Rows[i].FindControl("ValinChk");
                if (SelectedCandidate.Checked)
                {
                    CurrRow = Candidates.Rows[i];
                    Index   = gl.GetColumnIndexByName(CurrRow, "rasnumer");
                    Res     = int.TryParse(CurrRow.Cells[Index].Text, out BibNo);
                    if (Res == false)
                    {
                        BibNo = -1;
                    }
                    if (BibNo > 0)
                    {
                        AthlCompInCompetition = AthlCRUD.GetCompetitorInComp(CompCode.Text, BibNo);
                        AthlCRUD.RegisterCompetitorInEvent(CompCode.Text, AthlCompEvent, BibNo, AthlCompInCompetition, 1, 999);
                    }
                }
            }
            Response.Redirect("UpdateEventResults.aspx?Event=" + EventLineNoText);
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();
            if (Session["CurrentAccessLevel"] == "0")
            {
                SaveRaceResultOrder.Visible = false;
            }
          
            string CompCode = gl.GetCompetitionCode();
            //string EventLineNo = gl.GetCompetitionEventNo();
            string EventLineNo = Request.QueryString.Get("Event");
            Int32 EventLin = Convert.ToInt32(EventLineNo);
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD(); ;
            Athl_CompetitionEvents AthlEvent = new Athl_CompetitionEvents();

            AthlEvent = AthlCRUD.GetCompetitionEvent(CompCode, EventLin);

            EventName.Text = AthlEvent.heitigreinar;

            FillPage(CompCode, EventLin, AthlEvent);


        }
示例#9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Global gl = new Global();
         //EventName.Text = gl.GetCompetitonEventName();
         string CompCode = gl.GetCompetitionCode();
         //Int32 EventLineNo = Convert.ToInt32(gl.GetCompetitionEventNo());
         string EventLineNoText             = Request.QueryString.Get("Event");
         Int32  EventLineNo                 = Convert.ToInt32(EventLineNoText);
         AthleticCompetitionCRUD AthlCRUD   = new AthleticCompetitionCRUD();
         Athl_HeightsInHJandPV   AthlHeighs = new Athl_HeightsInHJandPV();
         Athl_CompetitionEvents  AthlCompEv = new Athl_CompetitionEvents();
         AthlCompEv            = AthlCRUD.GetCompetitionEvent(CompCode, EventLineNo);
         EventName.Text        = AthlCompEv.heitigreinar;
         AthlHeighs            = AthlCRUD.GetHeightsInHJandPVRec(CompCode, EventLineNo, -1);
         OpeningHeight.Text    = AthlHeighs.OpeningHeight;
         FirstIncreaseBy.Text  = AthlHeighs.FirstIncreaseBy;
         FirstLimit.Text       = AthlHeighs.FirstLimit;
         SecondIncreaseBy.Text = AthlHeighs.SecondIncreaseBy;
         SecondLimit.Text      = AthlHeighs.SecondLimit;
         ThirdIncreaseBy.Text  = AthlHeighs.ThirdIncreaseBy;
     }
 }
示例#10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();

            CompName.Text = gl.GetCompetitionName();
            CompCode.Text = gl.GetCompetitionCode();

            EventLineNo.Text = Request.QueryString.Get("Event");

            if (!IsPostBack)
            {
                Athl_CompetitionEvents  AthlEv   = new Athl_CompetitionEvents();
                AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
                AthlEv = AthlCRUD.GetCompetitionEvent(CompCode.Text, Convert.ToInt32(EventLineNo.Text));

                CompName.Text = AthlEv.heitigreinar;

                string             CurrentUserName = Session["CurrentUserName"].ToString();
                AthleticsEntities1 AthlEnt         = new AthleticsEntities1();
                ListItem           newItem         = new ListItem();

                var ClubsForCurrUsr = AthlEnt.ClubsForUser(CurrentUserName);
                foreach (var ClubRec in ClubsForCurrUsr)
                {
                    newItem       = new ListItem();
                    newItem.Text  = Convert.ToString(ClubRec.Club) + " - " + Convert.ToString(ClubRec.NameOfClub);
                    newItem.Value = Convert.ToString(ClubRec.Club);
                    SelectClubDropDownL.Items.Add(newItem);
                }

                newItem       = new ListItem();
                newItem.Text  = "*Öll félög - Fyrir blandaðar sveitir";
                newItem.Value = "%";
                SelectClubDropDownL.Items.Add(newItem);

                string TeamBibNo = Request.QueryString.Get("TeamBibNo");

                Leg1.Text  = "";
                Bib1.Text  = "";
                Name1.Text = "";
                Yob1.Text  = "";
                Age1.Text  = "";
                Leg2.Text  = "";
                Bib2.Text  = "";
                Name2.Text = "";
                Yob2.Text  = "";
                Age2.Text  = "";
                Leg3.Text  = "";
                Bib3.Text  = "";
                Name3.Text = "";
                Yob3.Text  = "";
                Age3.Text  = "";
                Leg4.Text  = "";
                Bib4.Text  = "";
                Name4.Text = "";
                Yob4.Text  = "";
                Age4.Text  = "";


                if ((TeamBibNo != "") && (TeamBibNo != null))
                {
                    Int32 TeamBibNoInt = 0;
                    if (Int32.TryParse(TeamBibNo, out TeamBibNoInt))
                    {
                        Int32 LegNo    = 0;
                        var   TeamComp = AthlEnt.GetRelayTeamMembers(CompCode.Text, Convert.ToInt32(EventLineNo.Text), TeamBibNoInt);
                        foreach (var TeamCompetitor in TeamComp)
                        {
                            LegNo = LegNo + 1;
                            switch (LegNo)
                            {
                            case 1:
                                TeamName.Text = TeamCompetitor.NameOfTeam;
                                Leg1.Text     = TeamCompetitor.Sprettur.ToString();
                                Bib1.Text     = TeamCompetitor.Rásnúmer_keppanda.ToString();
                                Name1.Text    = TeamCompetitor.Nafn_keppanda;
                                Yob1.Text     = TeamCompetitor.YearOfBirth.ToString();
                                Age1.Text     = TeamCompetitor.AgeOfComp.ToString();
                                break;

                            case 2:
                                Leg2.Text  = TeamCompetitor.Sprettur.ToString();
                                Bib2.Text  = TeamCompetitor.Rásnúmer_keppanda.ToString();
                                Name2.Text = TeamCompetitor.Nafn_keppanda;
                                Yob2.Text  = TeamCompetitor.YearOfBirth.ToString();
                                Age2.Text  = TeamCompetitor.AgeOfComp.ToString();
                                break;

                            case 3:
                                Leg3.Text  = TeamCompetitor.Sprettur.ToString();
                                Bib3.Text  = TeamCompetitor.Rásnúmer_keppanda.ToString();
                                Name3.Text = TeamCompetitor.Nafn_keppanda;
                                Yob3.Text  = TeamCompetitor.YearOfBirth.ToString();
                                Age3.Text  = TeamCompetitor.AgeOfComp.ToString();
                                break;

                            case 4:
                                Leg4.Text  = TeamCompetitor.Sprettur.ToString();
                                Bib4.Text  = TeamCompetitor.Rásnúmer_keppanda.ToString();
                                Name4.Text = TeamCompetitor.Nafn_keppanda;
                                Yob4.Text  = TeamCompetitor.YearOfBirth.ToString();
                                Age4.Text  = TeamCompetitor.AgeOfComp.ToString();
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
            }
        }
示例#11
0
        protected void RegEventsForComp_Click(object sender, EventArgs e)
        {
            Athl_CompetitorsInEvent       AthlCompetitorInEvRec = new Athl_CompetitorsInEvent();
            Athl_CompetitionEvents        AthlCompEvent         = new Athl_CompetitionEvents();
            Athl_CompetitorsInCompetition AthlCompetitorInComp  = new Athl_CompetitorsInCompetition();
            AthleticCompetitionCRUD       AthlCompCRUD          = new AthleticCompetitionCRUD();
            AthleticsEntities1            AthlEnt = new AthleticsEntities1();

            Int32       i;
            CheckBox    SelectedEvent;
            GridViewRow CurrRow;
            Int32       SelCellIndex = -1;
            Global      gl           = new Global();
            Int32       EventLine;
            bool        Res;
            string      CurrentUserID = Session["CurrentUserName"].ToString();

            AthlCompetitorInComp = AthlCompCRUD.InitCompetitorInComp();
            for (i = 0; i < AvailableEvents.Rows.Count; i++)
            {
                SelectedEvent = (CheckBox)AvailableEvents.Rows[i].FindControl("ValinChk");
                if (SelectedEvent.Checked)
                {
                    CurrRow = AvailableEvents.Rows[i];
                    if (SelCellIndex < 0)
                    {
                        SelCellIndex = gl.GetColumnIndexByName(CurrRow, "EventLine");
                    }
                    Res = int.TryParse(CurrRow.Cells[SelCellIndex].Text, out EventLine);
                    if (Res == false)
                    {
                        EventLine = -1;
                    }
                    else
                    {
                        if (AthlCompetitorInComp.rasnumer == 0)
                        {
                            AthlCompetitorInComp = AthlCompCRUD.GetCompetitorInComp(gl.GetCompetitionCode(), gl.GetBibNumber());
                        }

                        AthlCompetitorInEvRec = AthlCompCRUD.GetCompetitorInEvent(gl.GetCompetitionCode(), gl.GetBibNumber(), EventLine);
                        if (AthlCompetitorInEvRec == null)
                        {
                            AthlCompetitorInEvRec = AthlCompCRUD.InitCompetitorInEvent();
                        }
                        if (AthlCompetitorInEvRec.rasnumer == null)
                        {
                            AthlCompetitorInEvRec.rasnumer = 0;
                        }
                        if (AthlCompetitorInEvRec.rasnumer == 0)
                        {
                            AthlCompEvent = AthlCompCRUD.GetCompetitionEvent(gl.GetCompetitionCode(), EventLine);

                            AthlCompCRUD.RegisterCompetitorInEvent(gl.GetCompetitionCode(), AthlCompEvent, gl.GetBibNumber(), AthlCompetitorInComp,
                                                                   1, 999);
                            AthlEnt.InsertToLogFile(CurrentUserID, "Skráning í grein (b)", gl.GetCompetitionCode(), AthlCompetitorInComp.keppendanumer, AthlCompEvent.grein + ";" +
                                                    AthlCompEvent.kyn.ToString() + AthlCompEvent.flokkur);
                        }
                        else
                        if (AthlCompetitorInEvRec.rasnumer > 0)
                        {
                            AthlEnt.DeleteCompetitorInEvent(AthlCompetitorInEvRec.mot, AthlCompetitorInEvRec.greinarnumer, AthlCompetitorInEvRec.rasnumer);
                        }
                    }
                }
                //else
                //{
                //   if
                //}
            }

            //  Response.Redirect("~/NyttMot.aspx?Comp=" + gl.GetCompetitionCode());

            Response.Redirect("CompetitorsForUser.aspx");
        }
        protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string HeitiG = "";
            Global gl     = new Global();

            if (e.CommandName == "DeleteCompEvent")  //DELETE THE COMPETITION EVENT  - NOT USED ANY MORE
            {
                int         index       = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow  = GridView3.Rows[index];
                string      CompCode    = (string)this.GridView3.DataKeys[index]["mot"];
                Int32       EventLineNo = (Int32)this.GridView3.DataKeys[index]["greinnumer"];

                if ((CompCode != "") & (EventLineNo > 0))
                {
                    AthleticCompetitionCRUD AthlCompCRUD         = new AthleticCompetitionCRUD();
                    Athl_CompetitionEvents  AthlCompetitionEvent = new Athl_CompetitionEvents();
                    AthlCompetitionEvent = AthlCompCRUD.GetCompetitionEvent(CompCode, EventLineNo);
                    AthlCompCRUD.DeleteCompetitonEvent(AthlCompetitionEvent);
                    GridView3.DataBind();
                }
            }

            if (e.CommandName == "ShowCompetitors")
            {
                int         index       = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow  = GridView3.Rows[index];
                string      CompCode    = (string)this.GridView3.DataKeys[index]["mot"];
                Int32       EventLineNo = (Int32)this.GridView3.DataKeys[index]["greinnumer"];

                //gl.SetCompetitionEventNo(GridView3.DataKeys[index].Values[1].ToString());
                string EventLineNoText = GridView3.DataKeys[index].Values[1].ToString();

                index  = GetColumnIndexByName(CurrentRow, "heitigreinar");
                HeitiG = CurrentRow.Cells[index].Text;
                HeitiG = HttpUtility.HtmlDecode(HeitiG);
                gl.SetCompetitionEventName(HeitiG);

                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if (AccessLevelText == "0")
                {
                    Response.Redirect("ComppetitorsInEv.aspx?Code=" + gl.GetCompetitionCode() + "&LineNo=" + EventLineNoText);
                }
                else
                {
                    Response.Redirect("CompetitorsInEvent.aspx?Event=" + EventLineNoText);
                }
            }

            if (e.CommandName == "EnterEventResults")
            {
                int         index      = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow = GridView3.Rows[index];

                string CompCode    = (string)this.GridView3.DataKeys[index]["mot"];
                Int32  EventLineNo = (Int32)this.GridView3.DataKeys[index]["greinnumer"];

                //gl.SetCompetitionEventNo(GridView3.DataKeys[index].Values[1].ToString());
                string EventLineNoText = GridView3.DataKeys[index].Values[1].ToString();

                index  = GetColumnIndexByName(CurrentRow, "heitigreinar");
                HeitiG = CurrentRow.Cells[index].Text;
                HeitiG = HttpUtility.HtmlDecode(HeitiG);
                gl.SetCompetitionEventName(HeitiG);

                Response.Redirect("UpdateEventResults.aspx?Event=" + EventLineNoText);
            }

            if (e.CommandName == "ShowResults")
            {
                string EventCode = "";
                string Gend;
                string EventStatus     = "";
                string EventLineNoText = "";
                Int32  index;

                index = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow = GridView3.Rows[index];
                EventLineNoText = GridView3.DataKeys[index].Values[1].ToString();
                //gl.SetCompetitionEventNo(EventLineNoText);

                index  = GetColumnIndexByName(CurrentRow, "heitigreinar");
                HeitiG = CurrentRow.Cells[index].Text;
                HeitiG = HttpUtility.HtmlDecode(HeitiG);
                gl.SetCompetitionEventName(HeitiG);
                index     = GetColumnIndexByName(CurrentRow, "greinnumer");
                EventCode = CurrentRow.Cells[index].Text;
                //gl.SetSelectedEventCode(EventCode);
                gl.SetSelectedEventCode(EventLineNoText);

                index = GetColumnIndexByName(CurrentRow, "kyn");
                if (CurrentRow.Cells[index].Text.Substring(0, 1) == "B")
                {
                    gl.SetSelectedGender("0");
                }
                else
                {
                    Gend = CurrentRow.Cells[index].Text;
                    if (Gend == "Karl")
                    {
                        gl.SetSelectedGender("1");
                    }
                    else
                    {
                        gl.SetSelectedGender("2");
                    }
                }
                index       = GetColumnIndexByName(CurrentRow, "StaðaKeppni");
                EventStatus = CurrentRow.Cells[index].Text;
                Global Gl = new Global();
                Athl_CompetitionEvents  AthlCompEv = new Athl_CompetitionEvents();
                AthleticCompetitionCRUD AthlCRU    = new AthleticCompetitionCRUD();
                Int32 EvNumInt = Gl.TryConvertStringToInt32(EventLineNoText);
                AthlCompEv = AthlCRU.GetCompetitionEvent(Gl.GetCompetitionCode(), EvNumInt);
                if ((EventStatus == "Stendur yfir") && (AthlCompEv.tegundgreinar == 2) && (AthlCompEv.nanaritegundargreining != 7)) //Field Event and not MultiEv
                {
                    Response.Redirect("EventProgressLiveUpdate.aspx?EventLineNo=" +
                                      EventLineNoText + "&EventName=" + HeitiG);
                }
                else
                {
                    Response.Redirect("PrintEventResults.aspx?Event=" + EventLineNoText);
                }
            }

            if (e.CommandName == "PrizeCeremonyFinished")
            {
                int         index      = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow = GridView3.Rows[index];

                string CompCode        = (string)this.GridView3.DataKeys[index]["mot"];
                Int32  EventLineNo     = (Int32)this.GridView3.DataKeys[index]["greinnumer"];
                string EventLineNoText = GridView3.DataKeys[index].Values[1].ToString();
                EventLineNo = Convert.ToInt32(EventLineNoText);

                AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
                Athl_CompetitionEvents  CompEvent    = new Athl_CompetitionEvents();
                if ((CompCode != "") && (EventLineNo > 0))
                {
                    CompEvent = AthlCompCRUD.GetCompetitionEvent(CompCode, EventLineNo);
                    AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                    AthlEnt.UpdateEventDateTimeAndStatus(CompCode, EventLineNo, CompEvent.dagsetning, CompEvent.timi,
                                                         CompEvent.stadakeppni, 2); //Set Prize Ceremony has finished for this Event
                    Int32 ColNoForPrizeCeremonyStatus = 0;
                    ColNoForPrizeCeremonyStatus = GetColumnIndexByName(CurrentRow, "tilkynnaverdlaunaafhendingu");
                    CurrentRow.Cells[ColNoForPrizeCeremonyStatus].Text = "Lokið";
                }
            }
        }
示例#13
0
        protected void FillPage(string CompCode, Int32 EventNo, Athl_CompetitionEvents AthlEvent)
        {
            Int32 LabelNo = 0;
            Int32 TextBoxNo = 0;
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            AthleticsEntities1 AthlEnt = new AthleticsEntities1();
            // var CompetitorsInEventDataset = AthlEnt.CompetitorsInEventInResultOrder1(CompCode, EventNo, "%");
            var CompetitorsInEventDataset = AthlEnt.CompetitorsInEvResultOrder(CompCode, EventNo, "%");
            Int32 NoOfLines = 0;
            string FirstInCloserOrder = "";
            Int32 IndexOfDash;

            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "Lína", "50px", "right");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "Rásn.", "50px", "right");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "", "10px", "");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "Nafn", "220px", "");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "F.ár", "50px", "");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "Félag", "80px", "");
            LabelNo = LabelNo + 1;
            if (AthlEvent.tegundgreinar == 1)  //Track
            {
                AddLabel(LabelNo, "Riðill", "50px", "right");
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Braut", "50px", "right");
                LabelNo = LabelNo + 1;
            }
            else
            {
                AddLabel(LabelNo, "Röð", "20px", "right");
                LabelNo = LabelNo + 1;
            }
            AddLabel(LabelNo, "Úrsl.röð", "70px", "right");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "Nánari röð", "70px", "right");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "Árangur", "80px", "right");
            LabelNo = LabelNo + 1;
            AddLabel(LabelNo, "", "10px", "");
            if (AthlEvent.krefstvindmaelis == 1)
            {
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Vindur", "80px", "right");
            }
            if (AthlEvent.tegundgreinar == 2)  //Technical (Field Event)
            {
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "", "10px", "");
                LabelNo = LabelNo + 1;
                AddLabel(LabelNo, "Sería", "500px", "left");
            }
            PH1.Controls.Add(new LiteralControl("<br />"));

            foreach (var CompInEvRec in CompetitorsInEventDataset)
            {
                if ((CompInEvRec.rasnumer != 0) || (CompInEvRec.nafn != ""))
                {
                    NoOfLines = NoOfLines + 1;
                    if (CompInEvRec.urslitarod < 9999)
                    {
                        IndexOfDash = CompInEvRec.urslitarodtexti.IndexOf("-");
                        if (IndexOfDash != -1)
                        {
                            FirstInCloserOrder = CompInEvRec.urslitarodtexti.Substring(0, IndexOfDash);
                        }
                        else
                        {
                            FirstInCloserOrder = CompInEvRec.urslitarodtexti;
                        }
                    }
                    else
                    {
                        FirstInCloserOrder = "";
                    }
                    //gl.SetArr1Value(NoOfLines, Convert.ToString(CompInEvRec.nanarirod));
                    gl.SetBibNoArrayElement(NoOfLines, CompInEvRec.rasnumer);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, Convert.ToString(NoOfLines), "50px", "right");
                    LabelNo = LabelNo + 1;
                    TextBoxNo = 0;
                    AddLabel(LabelNo, Convert.ToString(CompInEvRec.rasnumer), "50px", "right");
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "");
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, CompInEvRec.nafn, "220px", "");
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, Convert.ToString(CompInEvRec.faedingarar), "50px", "");
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, CompInEvRec.felag, "80px", "");
                    if (AthlEvent.tegundgreinar == 1)
                    {
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, Convert.ToString(CompInEvRec.ridillnumer), "50px", "right");
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, Convert.ToString(CompInEvRec.stokkkastrod), "50px", "right");
                    }
                    else 
                    {
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, Convert.ToString(CompInEvRec.stokkkastrod), "20px", "right");
                    }
                    LabelNo = LabelNo + 1;
                    if (CompInEvRec.urslitarod < 10000)
                    {
                        AddLabel(LabelNo, CompInEvRec.urslitarodtexti, "60px", "right"); //urslitarodtexti
                    }
                    else
                    {
                        AddLabel(LabelNo, "", "60px", "right");
                    }
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, " ", "10px", "right");
                    TextBoxNo = TextBoxNo + 1;
                    //AddTextBox(NoOfLines, TextBoxNo, CompInEvRec.nanarirod.ToString(), "60px", "right", (NoOfLines * 10) + 1, false);                    
                    AddTextBox(NoOfLines, TextBoxNo, FirstInCloserOrder, "60px", "right", (NoOfLines * 10) + 1, false);
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "right");
                    LabelNo = LabelNo + 1;
                    if (CompInEvRec.arangur == "")
                    {
                        AddLabel(LabelNo, CompInEvRec.athugasemd, "80px", "right");
                    }
                    else
                    {
                        AddLabel(LabelNo, CompInEvRec.arangur, "80px", "right");
                    }
                    LabelNo = LabelNo + 1;
                    AddLabel(LabelNo, "", "10px", "");
                    if (AthlEvent.krefstvindmaelis == 1)
                    {
                        LabelNo = LabelNo + 1;
                        if (CompInEvRec.arangur != "")
                        {
                            AddLabel(LabelNo, gl.FormatWind(Convert.ToDecimal(CompInEvRec.vindur)), "80px", "right");
                        }
                        else
                        {
                            AddLabel(LabelNo, "", "80px", "right");
                        }
                    }
                    if (AthlEvent.tegundgreinar == 2)  //Technical (Field Event)
                    {
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, "", "10px", "");
                        LabelNo = LabelNo + 1;
                        AddLabel(LabelNo, CompInEvRec.seria, "500px", "left");
                    }

                }
                PH1.Controls.Add(new LiteralControl("<br />"));
            }
            PH1.Controls.Add(new LiteralControl("<br />"));
            gl.SetNoOfArrayElements(NoOfLines);

        }
        protected void UpdateDatabase()
        {
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            Global gl = new Global();
            Athl_CompetitorsInEvent       AthlCompInEvent          = new Athl_CompetitorsInEvent();
            Athl_CompetitorsInEvent       AthlCompInEventForDelete = new Athl_CompetitorsInEvent();
            Athl_CompetitionEvents        CompEvent         = new Athl_CompetitionEvents();
            Athl_CompetitorsInCompetition CompetitorsInComp = new Athl_CompetitorsInCompetition();

            CompetitorsInComp.rasnumer = -1;
            AthleticsEntities1 AthlEnt  = new AthleticsEntities1();
            string             CompCode = gl.GetCompetitionCode();
            Int32  EventLin             = 0;
            Int32  FjLin     = gl.GetNoOfArrayElements();
            Int32  BibNumber = 0;
            string EventType = gl.GetEventType();

            string[] CheckBoxParts     = new string[10];
            string[] CheckBoxValues    = new string[50];
            string[] TextBoxIDs        = new string[50];
            bool     NeedToRefreshPage = false;
            string   CurrentUserID     = Session["CurrentUserName"].ToString();

            foreach (Control item in PH1.Controls)
            {
                if (item is CheckBox)
                {
                    CheckBox Cb         = (CheckBox)PH1.FindControl(item.ID);
                    string   CheckBoxID = Cb.ID;
                    CheckBoxParts = CheckBoxID.Split('_');  //Chkb_BibNo_EventLineNo_TickedOrNot
                    bool CheckboxIsTicked  = Convert.ToBoolean(Cb.Checked);
                    bool CheckBoxWasTicked = CheckBoxParts[3] == "1";
                    if ((CheckboxIsTicked == true) && (CheckBoxWasTicked == false))
                    {
                        BibNumber       = Convert.ToInt32(CheckBoxParts[1]);
                        EventLin        = Convert.ToInt32(CheckBoxParts[2]);
                        AthlCompInEvent = AthlCRUD.InitCompetitorInEvent();
                        CompEvent       = AthlCRUD.GetCompetitionEvent(CompCode, EventLin);
                        if (CompetitorsInComp.rasnumer != BibNumber)
                        {
                            CompetitorsInComp = AthlCRUD.GetCompetitorInComp(CompCode, BibNumber);
                        }
                        AthlCRUD.RegisterCompetitorInEvent(CompCode, CompEvent, BibNumber, CompetitorsInComp, 0, 9999);
                        AthlEnt.InsertToLogFile(CurrentUserID, "Skráning í grein", CompCode, CompetitorsInComp.keppendanumer, CompEvent.grein + ";" + CompEvent.kyn.ToString() + ";" +
                                                CompEvent.flokkur);
                        NeedToRefreshPage = true;
                    }
                    if ((CheckboxIsTicked == false) && (CheckBoxWasTicked == true))
                    {
                        BibNumber = Convert.ToInt32(CheckBoxParts[1]);
                        EventLin  = Convert.ToInt32(CheckBoxParts[2]);
                        if (CompetitorsInComp.rasnumer != BibNumber)
                        {
                            CompetitorsInComp = AthlCRUD.GetCompetitorInComp(CompCode, BibNumber);
                        }
                        CompEvent = AthlCRUD.GetCompetitionEvent(CompCode, EventLin);
                        AthlCompInEventForDelete = AthlCRUD.GetCompetitorInEvent(CompCode, BibNumber, EventLin);
                        AthlCRUD.DeleteCompetitorInEvRec(AthlCompInEventForDelete);
                        AthlEnt.InsertToLogFile(CurrentUserID, "Afskráning í grein", CompCode, CompetitorsInComp.keppendanumer, CompEvent.grein + ";" + CompEvent.kyn.ToString() + ";" +
                                                CompEvent.flokkur);

                        NeedToRefreshPage = true;
                    }
                }
            }
            if (NeedToRefreshPage == true)
            {
                Response.Redirect("ClubCompetitorsWithReg.aspx");
            }
        }
示例#15
0
        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>"));
        }
示例#16
0
        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);
        }
示例#17
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            AthleticsEntities1     AthlEnt       = new AthleticsEntities1();
            Athl_CompetitionEvents AthlCompEvRec = new Athl_CompetitionEvents();
            Global gl = new Global();

            for (int Ixx = 1; Ixx <= NoOfEventLines; Ixx++)
            {
                CheckBox DeleteEv = (CheckBox)EventsGW.Rows[Ixx - 1].FindControl("DeleteChk");
                if (DeleteEv.Checked)
                {
                    if (NoOfCompetitorsArr[Ixx] == 0)
                    {
                        AthlEnt.DeleteCompetitionEvent(CompCode.Text, EventLineArr[Ixx]);
                    }
                    else
                    {
                        string msg = string.Format("Það er ekki hægt að eyða grein -{0}- vegna þess að það eru keppendur skráðir í hana.",
                                                   EventDescriptionArr[Ixx]);
                        Response.Write("<script>alert('" + msg + "')</script>");

                        return;
                    }
                }
                else
                {
                    DropDownList DropDownListDate = (DropDownList)EventsGW.Rows[Ixx - 1].FindControl("DropDDate");
                    string       DDDataValueField = DropDownListDate.DataValueField.ToString();
                    string       DDValue          = DropDownListDate.SelectedValue.ToString();
                    TextBox      TimeTxt          = (TextBox)EventsGW.Rows[Ixx - 1].FindControl("TimiEd");
                    TextBox      NoOfRoundsTxt    = (TextBox)EventsGW.Rows[Ixx - 1].FindControl("NoOfRounds");
                    TextBox      NoOfLanesTxt     = (TextBox)EventsGW.Rows[Ixx - 1].FindControl("NoOfLanes");
                    TextBox      AgeFromTxt       = (TextBox)EventsGW.Rows[Ixx - 1].FindControl("AgeFrom");
                    TextBox      AgeToTxt         = (TextBox)EventsGW.Rows[Ixx - 1].FindControl("AgeTo");
                    TextBox      EventDescrTxt    = (TextBox)EventsGW.Rows[Ixx - 1].FindControl("EventDescription");


                    Int32 NoOfRounds = gl.TryConvertStringToInt32(NoOfRoundsTxt.Text);
                    Int32 NoOfLanes  = gl.TryConvertStringToInt32(NoOfLanesTxt.Text);
                    Int32 AgeFrom    = gl.TryConvertStringToInt32(AgeFromTxt.Text);
                    Int32 AgeTo      = gl.TryConvertStringToInt32(AgeToTxt.Text);

                    bool   Bool1       = DropDownListDate.SelectedValue.ToString() != DateArr[Ixx];
                    string NewTimeText = gl.ValidateTimeFromText(TimeTxt.Text);

                    bool Bool2 = NewTimeText != TimeArr[Ixx]; //TimeTxt.Text
                    bool Bool3 = NoOfRounds != NoOfRoundsArr[Ixx];
                    bool Bool4 = NoOfLanes != NoOfLanesArr[Ixx];
                    bool Bool5 = AgeFrom != AgeFromsArr[Ixx];
                    bool Bool6 = AgeTo != AgeToArr[Ixx];
                    bool Bool7 = EventDescrTxt.Text != EventDescriptionArr[Ixx];

                    if ((DropDownListDate.SelectedValue.ToString() != DateArr[Ixx]) || (NewTimeText != TimeArr[Ixx]) || // (TimeTxt.Text != TimeArr[Ixx]) ||
                        (NoOfRounds != NoOfRoundsArr[Ixx]) || (NoOfLanes != NoOfLanesArr[Ixx]) ||
                        (AgeFrom != AgeFromsArr[Ixx]) || (AgeTo != AgeToArr[Ixx]) ||
                        (EventDescrTxt.Text != EventDescriptionArr[Ixx]))
                    {
                        Int32 IndexOfNewDate = Array.IndexOf(CompetitionDateArr, DropDownListDate.SelectedItem.ToString());

                        DateTime NewTimeForEv = System.DateTime.Parse("1754-01-01 " + NewTimeText); // TimeTxt.Text);

                        AthlEnt.UpdateEventDateTimeEtc(CompCode.Text, EventLineArr[Ixx], CompetitionDateArrWithYear[IndexOfNewDate], NewTimeForEv,
                                                       NoOfLanes, NoOfRounds, AgeFrom, AgeTo, EventDescrTxt.Text);
                    }
                }
            }
            Response.Redirect("UpdCompEvents.aspx");
        }
示例#18
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());
        }
示例#19
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;
                        }
                    }
                }
            }
        }
示例#20
0
        protected void SaveRaceResultOrder_Click(object sender, EventArgs e)
        {
            Global gl = new Global();
            string CompCode = gl.GetCompetitionCode();
            //Int32 EventLineNo = Convert.ToInt32(gl.GetCompetitionEventNo());
            string EventLineNoText = Request.QueryString.Get("Event");
            Int32 EventLineNo = Convert.ToInt32(EventLineNoText);
            AthleticsEntities1 AthlEnt = new AthleticsEntities1();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            Athl_CompetitorsInEvent AthlCompetitorsInEventRec = new Athl_CompetitorsInEvent();
            Athl_CompetitionEvents AthlCompEvent = new Athl_CompetitionEvents();
            string TextBoxID;
            string CurrValue;
            Int32 CurrValueInt;
            bool NeedToUpdateOrderByResults = false;
            string[] ControlNameParts;
            Int32 LineNoForTextBox;
            Int32 BibNo = 0;

            CurrValue = "";
            LineNoForTextBox = -1;
            AthlCompEvent = AthlCRUD.GetCompetitionEvent(CompCode, EventLineNo);

            foreach (Control item in PH1.Controls)
            {
                if (item is TextBox)
                {
                    TextBox t1 = (TextBox)PH1.FindControl(item.ID);
                    TextBoxID = t1.ID;
                    CurrValue = t1.Text;
                    ControlNameParts = TextBoxID.Split('_');
                    LineNoForTextBox = Convert.ToInt32(ControlNameParts[1]);
                    BibNo = gl.GetBibNoArrayElement(LineNoForTextBox);
                    bool res = Int32.TryParse(CurrValue, out CurrValueInt);
                    if (res == false)
                    {
                        CurrValueInt = 0;
                    }
                    if (CurrValueInt.ToString() != gl.GetArr1Value(LineNoForTextBox))
                    {
                        AthlCompetitorsInEventRec = AthlCRUD.GetCompetitorInEvent(CompCode, BibNo, EventLineNo);
                        
                        AthlCRUD.UpdCompetitorInEvent(AthlCompetitorsInEventRec.mot, AthlCompetitorsInEventRec.greinarnumer,
                            AthlCompetitorsInEventRec.rasnumer, AthlCompetitorsInEventRec.timi, AthlCompetitorsInEventRec.metrar,
                            AthlCompetitorsInEventRec.vindur, AthlCompetitorsInEventRec.arangur,
                            AthlCompetitorsInEventRec.tilraun1, AthlCompetitorsInEventRec.vindur1,
                            AthlCompetitorsInEventRec.tilraun2, AthlCompetitorsInEventRec.vindur2,
                            AthlCompetitorsInEventRec.tilraun3, AthlCompetitorsInEventRec.vindur3,
                            AthlCompetitorsInEventRec.tilraun4, AthlCompetitorsInEventRec.vindur4,
                            AthlCompetitorsInEventRec.tilraun5, AthlCompetitorsInEventRec.vindur5,
                            AthlCompetitorsInEventRec.tilraun6, AthlCompetitorsInEventRec.vindur6,
                            AthlCompetitorsInEventRec.seria,
                            AthlCompetitorsInEventRec.rafmagnstimataka, AthlCompetitorsInEventRec.merking1, AthlCompetitorsInEventRec.merking2,
                            AthlCompetitorsInEventRec.merking3, AthlCompetitorsInEventRec.merking4, AthlCompetitorsInEventRec.merking5,
                            AthlCompetitorsInEventRec.merking6, AthlCompetitorsInEventRec.sortorder1, AthlCompetitorsInEventRec.sortorder2,
                            CurrValueInt, "", AthlCompetitorsInEventRec.samasaetiognaestiaundan,
                            AthlCompetitorsInEventRec.athugasemd, AthlCompetitorsInEventRec.ridillnumer, 
                            AthlCompetitorsInEventRec.stokkkastrod, AthlCompetitorsInEventRec.IAAF_Stig,
                            AthlCompetitorsInEventRec.thrautarstig, AthlCompetitorsInEventRec.Unglingastig, 
                            AthlCompetitorsInEventRec.PerformaceRemarks);
                        NeedToUpdateOrderByResults = true;
                    }

                }
                //if (item is CheckBox)
                //{
                //    CheckBox c1 = (CheckBox)PH1.FindControl(item.ID);
                //    CheckBoxID = c1.ID;
                //    CurrChecked = (Boolean)(c1.Checked);
                //    ControlNameParts = CheckBoxID.Split('_');
                //    LineNoForCheckBox = Convert.ToInt32(ControlNameParts[1]);
                //}
                //if ((LineNoForTextBox > 0) && (LineNoForCheckBox > 0) && (LineNoForTextBox == LineNoForCheckBox))
                //{
                //    if (CurrChecked == true)
                //    {
                //        CurrCheckedInteger = 1;
                //    }
                //    else
                //    {
                //        CurrCheckedInteger = 0;
                //    }
                //    string Test = gl.GetArr1Value(LineNoForTextBox);
                //    Test = gl.GetArr2Value(LineNoForCheckBox);
                //    Test = CurrChecked.ToString();
                //    bool res = Int32.TryParse(CurrValue, out CurrValueInt);
                //    if (res == false)
                //    {
                //        CurrValueInt = 0;
                //    }
                //    if ((CurrValueInt.ToString() != gl.GetArr1Value(LineNoForTextBox)) || (CurrCheckedInteger.ToString() != gl.GetArr2Value(LineNoForCheckBox)))
                //    {
                //        AthlCompetitorsInEventRec = AthlCRUD.GetCompetitorInEvent(CompCode, BibNo, EventLineNo);
                //        AthlCRUD.UpdCompetitorInEvent(AthlCompetitorsInEventRec.mot, AthlCompetitorsInEventRec.greinarnumer,
                //            AthlCompetitorsInEventRec.rasnumer, AthlCompetitorsInEventRec.timi, AthlCompetitorsInEventRec.metrar,
                //            AthlCompetitorsInEventRec.vindur, AthlCompetitorsInEventRec.arangur,
                //            AthlCompetitorsInEventRec.tilraun1, AthlCompetitorsInEventRec.vindur1,
                //            AthlCompetitorsInEventRec.tilraun2, AthlCompetitorsInEventRec.vindur2,
                //            AthlCompetitorsInEventRec.tilraun3, AthlCompetitorsInEventRec.vindur3,
                //            AthlCompetitorsInEventRec.tilraun4, AthlCompetitorsInEventRec.vindur4,
                //            AthlCompetitorsInEventRec.tilraun5, AthlCompetitorsInEventRec.vindur5,
                //            AthlCompetitorsInEventRec.tilraun6, AthlCompetitorsInEventRec.vindur6,
                //            AthlCompetitorsInEventRec.seria,
                //            AthlCompetitorsInEventRec.rafmagnstimataka, AthlCompetitorsInEventRec.merking1, AthlCompetitorsInEventRec.merking2,
                //            AthlCompetitorsInEventRec.merking3, AthlCompetitorsInEventRec.merking4, AthlCompetitorsInEventRec.merking5,
                //            AthlCompetitorsInEventRec.merking6, AthlCompetitorsInEventRec.sortorder1, AthlCompetitorsInEventRec.sortorder2,
                //            CurrValueInt, "", CurrCheckedInteger,
                //            AthlCompetitorsInEventRec.athugasemd);
                //        NeedToUpdateOrderByResults = true;
                //    }
                //    LineNoForCheckBox = -1;
                //    LineNoForTextBox = -1;
                //}
            }
   //         if (NeedToUpdateOrderByResults == true)
           // {
            //    gl.UpdateResultOrderForEvent(CompCode, EventLineNo, AthlCompEvent.tegundgreinar, "%");
//                AthlCRUD.UpdateResultOrder(CompCode, EventLineNo, AthlCompEvent.tegundgreinar);
     //       }
            Response.Redirect("UpdateEventResults.aspx?Event=" + EventLineNoText);
        }
示例#21
0
        protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string HeitiG = "";
            Global gl     = new Global();

            if (e.CommandName == "DeleteCompEvent")  //DELETE THE COMPETITION EVENT  - NOT USED ANY MORE
            {
                int         index       = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow  = GridView3.Rows[index];
                string      CompCode    = (string)this.GridView3.DataKeys[index]["mot"];
                Int32       EventLineNo = (Int32)this.GridView3.DataKeys[index]["greinnumer"];

                if ((CompCode != "") & (EventLineNo > 0))
                {
                    AthleticCompetitionCRUD AthlCompCRUD         = new AthleticCompetitionCRUD();
                    Athl_CompetitionEvents  AthlCompetitionEvent = new Athl_CompetitionEvents();
                    AthlCompetitionEvent = AthlCompCRUD.GetCompetitionEvent(CompCode, EventLineNo);
                    AthlCompCRUD.DeleteCompetitonEvent(AthlCompetitionEvent);
                    GridView3.DataBind();
                }
            }

            if (e.CommandName == "ShowCompetitors")
            {
                int         index       = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow  = GridView3.Rows[index];
                string      CompCode    = (string)this.GridView3.DataKeys[index]["mot"];
                Int32       EventLineNo = (Int32)this.GridView3.DataKeys[index]["greinnumer"];

                //gl.SetCompetitionEventNo(GridView3.DataKeys[index].Values[1].ToString());
                string EventLineNoText = GridView3.DataKeys[index].Values[1].ToString();

                index  = GetColumnIndexByName(CurrentRow, "heitigreinar");
                HeitiG = CurrentRow.Cells[index].Text;
                HeitiG = HttpUtility.HtmlDecode(HeitiG);
                gl.SetCompetitionEventName(HeitiG);

                Response.Redirect("CompetitorsInEvent.aspx?Event=" + EventLineNoText);
            }

            if (e.CommandName == "EnterEventResults")
            {
                int         index      = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow = GridView3.Rows[index];

                string CompCode    = (string)this.GridView3.DataKeys[index]["mot"];
                Int32  EventLineNo = (Int32)this.GridView3.DataKeys[index]["greinnumer"];

                //gl.SetCompetitionEventNo(GridView3.DataKeys[index].Values[1].ToString());
                string EventLineNoText = GridView3.DataKeys[index].Values[1].ToString();

                index  = GetColumnIndexByName(CurrentRow, "heitigreinar");
                HeitiG = CurrentRow.Cells[index].Text;
                HeitiG = HttpUtility.HtmlDecode(HeitiG);
                gl.SetCompetitionEventName(HeitiG);

                Response.Redirect("UpdateEventResults.aspx?Event=" + EventLineNoText);
            }

            if (e.CommandName == "ShowResults")
            {
                string EventCode = "";
                string Gend;
                Int32  index;

                index = Convert.ToInt32(e.CommandArgument);
                GridViewRow CurrentRow = GridView3.Rows[index];
                //gl.SetCompetitionEventNo(GridView3.DataKeys[index].Values[1].ToString());
                string EventLineNoText = GridView3.DataKeys[index].Values[1].ToString();

                index  = GetColumnIndexByName(CurrentRow, "heitigreinar");
                HeitiG = CurrentRow.Cells[index].Text;
                HeitiG = HttpUtility.HtmlDecode(HeitiG);
                gl.SetCompetitionEventName(HeitiG);
                index     = GetColumnIndexByName(CurrentRow, "greinnumer");
                EventCode = CurrentRow.Cells[index].Text;
                gl.SetSelectedEventCode(EventCode);

                index = GetColumnIndexByName(CurrentRow, "kyn");
                if (CurrentRow.Cells[index].Text.Substring(0, 1) == "B")
                {
                    gl.SetSelectedGender("0");
                }
                else
                {
                    Gend = CurrentRow.Cells[index].Text;
                    if (Gend == "Karl")
                    {
                        gl.SetSelectedGender("1");
                    }
                    else
                    {
                        gl.SetSelectedGender("2");
                    }
                }
                Response.Redirect("PrintEventResults.aspx?Event=" + EventLineNoText);
            }
        }
示例#22
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;
                    }
                }
            }
        }
示例#23
0
        protected void Button1_Click1(object sender, EventArgs e)
        {
            AthleticsEntities1      AthlEnt = new AthleticsEntities1();
            string                  line;
            AthleticCompetitionCRUD AthlCRUD2 = new AthleticCompetitionCRUD();

            HttpFileCollection File_Collection = Request.Files;
            string             BibNos          = "";
            string             RunnerLanes     = "";
            Global             gl    = new Global();
            string             Times = "";
            Int32  LineNo            = 0;
            Int32  CurrentHeatNo     = 1;
            string ImportedHeatNo    = "";
            string ImportedWind      = "";

            WindReading      = 0;
            EventLineNo.Text = Request.QueryString.Get("EventLineNo");
            AthlEvent        = AthlCRUD2.GetCompetitionEvent(CompCode.Text, Convert.ToInt32(EventLineNo.Text));
            Int32 TrackEventNoForLynx = AthlEvent.Númer_hlaupagreinar_f__Lynx + 1000;

            WindReadingRequired = AthlEvent.krefstvindmaelis;

            foreach (string File_Uploader in File_Collection)
            {
                HttpPostedFile Posted_File         = File_Collection[File_Uploader];
                string         FileNameWithoutPath = "";
                Int32          LastSlashPos        = 0;
                for (int ix = 0; ix < Posted_File.FileName.Length; ix++)
                {
                    if (Posted_File.FileName.Substring(ix, 1) == @"\")
                    {
                        LastSlashPos = ix;
                    }
                }
                if (LastSlashPos > 0)
                {
                    FileNameWithoutPath = Posted_File.FileName.Substring(LastSlashPos + 1);
                }
                else
                {
                    FileNameWithoutPath = Posted_File.FileName;
                }
                if (FileNameWithoutPath.Substring(0, 3) == LifFilePrefix.Text)
                {
                    if (Posted_File.ContentLength > 0)
                    {
                        System.IO.StreamReader file = new System.IO.StreamReader(Posted_File.InputStream);
                        while ((line = file.ReadLine()) != null)
                        {  //Example: 5,0,1,"100M Karla R1 w:-0,1",-1.0,M/S S,,,,100,18:34:25.1698  - Með vindi
                           //Example: 2,2,1,60M S15 R1,,,,,,60,10:01:00.4149                        - Án vinds

                            string[] Fields = line.Split(',');
                            if (LineNo == 0)
                            {
                                string EventNameText = Fields[3]; //Example: "60m p12 R2" or "100M S13 R1/2" or "4X100M S13"
                                string HeatText      = EventNameText.Split(' ').Last();
                                if (HeatText.StartsWith("R"))
                                {
                                    string[] HeatTextArr = HeatText.Split('/');
                                    HeatText      = HeatTextArr[0].Substring(1);
                                    CurrentHeatNo = gl.TryConvertStringToInt32(HeatText);
                                }
                                else
                                {
                                    CurrentHeatNo = 1;
                                }
                                if (WindReadingRequired == 1)
                                {
                                    if (Fields.Length == 12)
                                    {
                                        WindReading = gl.TryConvertStringToDecimal(Fields[5]);
                                    }
                                    else
                                    {
                                        WindReading = gl.TryConvertStringToDecimal(Fields[4]);
                                    }
                                    //WindReading = gl.TryConvertStringToDecimal(Fields[4]);
                                    WindReading = WindReading / 10;
                                }
                                else
                                {
                                    WindReading = 0;
                                }
                            }
                            else
                            {
                                Int32 Rank       = 0;
                                bool  SuccessFul = Int32.TryParse(Fields[0], out Rank);
                                if (SuccessFul)
                                {
                                    BibNos      = BibNos + "," + Fields[1];
                                    Times       = Times + "," + Fields[6];
                                    RunnerLanes = RunnerLanes + "," + Fields[2];
                                }
                                else
                                {
                                    BibNos      = BibNos + "," + Fields[1];
                                    Times       = Times + "," + Fields[0];
                                    RunnerLanes = RunnerLanes + "," + Fields[2];
                                }
                                //6,2,2,60m p12 R2,-1.0,M/S W,,,,60,11:39:33.7908
                                //1,179,4,Finnsson,Birnir Vagn,UFA,8.942,UFA,8.942,,,11:39:33.791,,,,8.942,8.942
                                //2,4,5,Eysteinsson,Dagur,AFTURE,9.266,AFTURE,0.324,,,11:39:33.791,,,,0.324,0.324
                                //3,156,3,Olafsson,Karl Hakon,IR,9.702,IR,0.436,,,11:39:33.791,,,,0.436,0.436
                                //4,142,2,Ingolfsson,Ari,HST,10.242,HST,0.540,,,11:39:33.791,,,,0.540,0.540
                                //DNS,188,6,Sigurdarson,Starkadur,UFA,,UFA,,,,11:39:33.791,,,,,
                                //DNS,125,7,Khorchai,Jens Johnny,HSK-SELFOS,,HSK-SELFOS,,,,11:39:33.791,,,,,
                            }
                            LineNo = LineNo + 1;
                        }
                        file.Close();

                        if (BibNos.Substring(0, 1) == ",")
                        {
                            BibNos      = BibNos.Substring(1);
                            Times       = Times.Substring(1);
                            RunnerLanes = RunnerLanes.Substring(1);
                        }
                        //TextBox1.Text = BibNos;
                        //TextBox2.Text = Times;

                        System.Data.Objects.ObjectParameter MsgOut = new System.Data.Objects.ObjectParameter("MessageOut", typeof(string));
                        AthlEnt.UpdateTimesInTrackEvent(CompCode.Text, Convert.ToInt32(EventLineNo.Text), BibNos, Times, RunnerLanes, CurrentHeatNo, WindReading, MsgOut);
                        if (MsgOut.Value.ToString() == "")
                        {
                            Int32 EventTypeInteger = 1;
                            AthlEnt.UpdateOrderAndPointsByResults(CompCode.Text, Convert.ToInt32(EventLineNo.Text), EventTypeInteger);

                            if ((AthlEvent.thrautargrein == 1) && (AthlEvent.nanaritegundargreining != 7))
                            {
                                AthlEnt.ProcessMultiEventCompetitors(CompCode.Text, Convert.ToInt32(EventLineNo.Text));
                                Int32 LineNoOfMultiEv = 0;
                                System.Data.Objects.ObjectParameter LineNoOfMultiEvParameter = new System.Data.Objects.ObjectParameter("LineNoOfMultiEvent", "0");
                                //AthlEntities.ReturnNoOfHeatsInEvent(CompCode, EventLin, OutNoOfHeats);
                                AthlEnt.ReturnLineNumberOfMultiEvent(CompCode.Text, Convert.ToInt32(EventLineNo.Text), LineNoOfMultiEvParameter);
                                LineNoOfMultiEv = Convert.ToInt32(LineNoOfMultiEvParameter.Value);
                                AthlEnt.UpdateOrderAndPointsByResults(CompCode.Text, LineNoOfMultiEv, 2);
                            }
                            if ((AthlEvent.stigagrein == 1) && (AthlCompetitionRec.tegundstigakeppni == 5))
                            {
                                AthlEnt.CalculatePointsInEvent(CompCode.Text, Convert.ToInt32(EventLineNo.Text));
                            }
                            Response.Redirect("UpdateEventResults.aspx?Event=" + EventLineNo.Text);
                        }
                        else
                        {
                            string msg = MsgOut.Value.ToString();
                            Response.Write("<script>alert('" + msg + "')</script>");
                        }
                    }
                }
                else
                {
                    string msg = string.Format("Þú verður að velja .lif skrá sem byrjar á {0}", LifFilePrefix.Text);
                    Response.Write("<script>alert('" + msg + "')</script>");
                }
            }
        }
示例#24
0
        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);
        }