示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();

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


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

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

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

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

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

            LoadCompetitorsPage();
        }
示例#4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            Global gl = new Global();
            Int32  CurrentAccessLevel = 0;

            if ((UserID.Text == "") && (OldPassword.Text == ""))
            {
                MessageBox.Text = "Þú verður að fylla út Notandann og gamla lykilorðið.";
            }
            else
            {
                CurrentAccessLevel = AthlCRUD.CheckUserNameAndPw(UserID.Text, OldPassword.Text);
                if (CurrentAccessLevel == -1)
                {
                    MessageBox.Text = "Notandi finnst ekki eða gamla lykilorðið er rangt.";
                }
                else
                {
                    if ((NewPassword1.Text == NewPassword2.Text) && (NewPassword1.Text != ""))
                    {
                        AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                        AthlEnt.ChangePassword(UserID.Text, OldPassword.Text, NewPassword1.Text, UserID.Text);
                        //Response.Write("<script language=javascript>alert('Lykilorðinu þínu hefur verið breytt. Þú verður að skrá þig aftur og nú með nýja lykilorðinu.')</script>");
                        Session["CurrentUserName"]    = "";
                        Session["CurrentAccessLevel"] = 0;
                        Session["ComingFromPage"]     = "";
                        gl.SetGlobalValue("LoginMsg", "Lykilorðinu þínu hefur verið breytt. Þú verður að skrá þig aftur og nú með nýja lykilorðinu.");
                        Response.Redirect("AthleticsLogon.aspx");
                    }
                }
            }
        }
示例#5
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);
            }
        }
示例#6
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();
         }
     }
 }
示例#7
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;
                }
            }
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp     = new Athl_Competition();

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

            if (!string.IsNullOrEmpty(CompCodeText))
            {
                CompCode.Text = CompCodeText;
                gl.SetCompetitionCode(CompCodeText);
                AthlComp = AthlCompCRUD.GetCompetitionRec(CompCodeText);
                gl.SetCompetitionName(AthlComp.Name);
                CompetitionName.Text = gl.GetCompetitionName();
                CompetitionName.Text = AthlComp.Name;
            }
            else
            {
                CompCode.Text        = gl.GetCompetitionCode();
                CompetitionName.Text = gl.GetCompetitionName();
                AthlComp             = AthlCompCRUD.GetCompetitionRec(CompCode.Text);
            }
            if (AthlComp.tegundstigakeppni == 1)
            {
                Response.Redirect("~/PointsStandingMIYngri.aspx?Code=" + CompCode.Text);
            }
        }
示例#9
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "DeleteCompetitorInComp")
            {
                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if ((AccessLevelText == "1") || (AccessLevelText == "2"))
                {
                    Global      gl           = new Global();
                    int         index        = Convert.ToInt32(e.CommandArgument);
                    GridViewRow CurrentRow   = GridView1.Rows[index];
                    string      CompCode     = GridView1.DataKeys[0].Value.ToString();
                    int         IndexOfBibno = gl.GetColumnIndexByName(CurrentRow, "rasnumer");
                    int         BibNo        = Convert.ToInt32(CurrentRow.Cells[IndexOfBibno].Text);

                    if ((CompCode != "") & (BibNo > 0))
                    {
                        AthleticCompetitionCRUD       AthlCompCRUD = new AthleticCompetitionCRUD();
                        Athl_CompetitorsInCompetition Competitor   = new Athl_CompetitorsInCompetition();
                        Competitor = AthlCompCRUD.GetCompetitorInComp(CompCode, BibNo);
                        AthlCompCRUD.DeleteCompetitorInCompetition(Competitor);
                        GridView1.DataBind();
                    }
                }
            }

            if (e.CommandName == "RegisterEvents")
            {
                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if ((AccessLevelText == "1") || (AccessLevelText == "2"))
                {
                    Global      gl           = new Global();
                    int         index        = Convert.ToInt32(e.CommandArgument);
                    GridViewRow CurrentRow   = GridView1.Rows[index];
                    string      CompCode     = GridView1.DataKeys[0].Value.ToString();
                    int         IndexOfBibno = gl.GetColumnIndexByName(CurrentRow, "rasnumer");
                    int         BibNo        = Convert.ToInt32(CurrentRow.Cells[IndexOfBibno].Text);

                    if ((CompCode != "") & (BibNo > 0))
                    {
                        AthleticCompetitionCRUD       AthlCompCRUD = new AthleticCompetitionCRUD();
                        Athl_CompetitorsInCompetition Competitor   = new Athl_CompetitorsInCompetition();
                        Competitor = AthlCompCRUD.GetCompetitorInComp(CompCode, BibNo);
                        Int32 YearOfBirth;
                        YearOfBirth = Competitor.faedingarar;
                        Int32 CompetitorAge = gl.GetCompetitionYear() - YearOfBirth;

                        gl.SetSelComp(CompCode, Competitor.kennitala, Competitor.nafn, Competitor.kyn.ToString(),
                                      Competitor.faedingarar.ToString(), Competitor.felag, CompetitorAge.ToString(), "0");
                        gl.SetBibNumber(BibNo);

                        Response.Redirect("RegisterCompetitorInEvent.aspx");
                    }
                }
            }
        }
示例#10
0
        protected void MotArsins_SelectedIndexChanged(object sender, EventArgs e)
        {
            Global Gl = new Global();

            string CompetitionCode = MotArsins.SelectedValue.ToString();

            Gl.SetCompetitionCode(CompetitionCode);

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

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

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

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

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

            CompetitionHasBeenFinalized = Convert.ToInt32(CompetitionStatus.Value);

            if (CompetitionHasBeenFinalized == 1)
            {
                Response.Redirect("SelectedCompetitionResults.aspx?Code=" + CompetitionCode);
            }
            else
            {
                Response.Redirect("SelectedCompetitionEvents.aspx?Code=" + CompetitionCode);
            }
        }
示例#11
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();
            }
        }
示例#12
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);
            }
        }
示例#13
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 + " : ";
            }
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();
            Global gl = new Global();

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

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

            CompName.Text = gl.GetCompetitionName();
        }
示例#15
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);
        }
示例#16
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);


        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            Athl_Competition        AthlComp = new Athl_Competition();

            CompCode.Text = Request.QueryString.Get("CompCode");
            if ((CompCode.Text == "") || (CompCode.Text == null))
            {
                CompCode.Text = gl.GetCompetitionCode();
            }
            SelectedClub.Text   = Request.QueryString.Get("Club");
            SelectedPlace.Text  = Request.QueryString.Get("Place");
            SelectedGender.Text = Request.QueryString.Get("Gender");
            if ((CompCode.Text != "") && (CompCode.Text != null))
            {
                AthlComp             = AthlCRUD.GetCompetitionRec(CompCode.Text);
                CompetitionName.Text = AthlComp.Name;
            }
            SelectionDescription.Text = "";
            if ((SelectedClub.Text != "") && (SelectedClub.Text != null))
            {
                if (SelectedGender.Text == "0")
                {
                    SelectionDescription.Text = "Karlar og konur " + SelectedClub.Text + " í " + SelectedPlace.Text + ". sæti";
                }
                else
                if (SelectedGender.Text == "1")
                {
                    SelectionDescription.Text = "Karlar " + SelectedClub.Text + " í " + SelectedPlace.Text + ". sæti";
                }
                else
                {
                    SelectionDescription.Text = "Konur " + SelectedClub.Text + " í " + SelectedPlace.Text + ". sæti";
                }
            }
        }
示例#18
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;
     }
 }
        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ð";
                }
            }
        }
示例#20
0
        protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            string[] WordsArray;
            string   AgeGr;
            Int32    Gend;
            Int32    AgeFr;
            Int32    AgeTo;
            Int32    ColNo;

            string EventLineNoText = "";
            bool   UserIsSignedin  = false;

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

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

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

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

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

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

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

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

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

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


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


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

                string SelectedEventStatus  = Gl.GetGlobalValue("TVEventStat");
                string SelectedGenderFilter = Gl.GetGlobalValue("TVGenderFilter");
                string SelectedEventDate    = Gl.GetGlobalValue("TVSelectedDate");
                if ((SelectedEventStatus == "") && (SelectedGenderFilter == "") && (SelectedEventDate == ""))
                {
                    Gl.SetGlobalValue("TVEventStat", EventStat.SelectedValue.ToString());
                    Gl.SetGlobalValue("TVGenderFilter", GenderFilter.SelectedValue.ToString());
                    Gl.SetGlobalValue("TVSelectedDate", SelectDay.SelectedValue.ToString());
                }
                else
                {
                    EventStat.SelectedValue    = SelectedEventStatus;
                    GenderFilter.SelectedValue = SelectedGenderFilter;
                    SelectDay.SelectedValue    = SelectedEventDate;
                }
            }
        }
        // AccessLevelText = "0" : Not logged in - Aðeins fyrirspurnir
        // AccessLevelText = "1" : Club Representative
        // AccessLevelText = "2" : Administrator
        // AccessLevelText = "3" : Can edit entry sheets
        // AccessLevelText = "4" : Competition Administrator

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

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

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

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

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

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

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

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

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

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

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

                if (NoOfDates <= 1)
                {
                    EventDateFilterLabel.Visible    = false;
                    EventDateFilterDropDown.Visible = false;
                }
                else
                {
                    EventDateFilterLabel.Visible    = true;
                    EventDateFilterDropDown.Visible = true;
                }
            }
        }
示例#23
0
        protected void VistaNyttMot_Click(object sender, EventArgs e)
        {
            Global   Gl         = new Global();
            bool     reiknaungl = false;
            bool     reiknaIAAF = false;
            DateTime Dags;
            bool     dagsOk    = false;
            Int16    tegstigak = -1;
            string   valinnv   = "";

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

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

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

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

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

            Gl.SetCompetitionCode(AthlComp.Code);
            Gl.SetCompetitionName(AthlComp.Name);
        }
示例#24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Global Gl = new Global();

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

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

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


                    GamliVollur.Text = ValinnV.ToString();
                }


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

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

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

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

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

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

                        AthleticsEntities1 AthlEnt = new AthleticsEntities1();

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

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

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

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

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


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

                        Gl.SetSelComp("", "", "", "", "", "", "", "");
                    }
                }
            }
        }
示例#25
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");
        }
示例#26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Athl_Competition        AthlComp     = new Athl_Competition();
            AthleticCompetitionCRUD AthlCompCRUD = new AthleticCompetitionCRUD();

            Global Gl = new Global();

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

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

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

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

            CompCode.Text = Gl.GetCompetitionCode();

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



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

            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();

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

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

                AccessLevelText = Session["CurrentAccessLevel"].ToString();
                if (AccessLevelText == "0")
                {
                    //AddCompeitors.Visible = false;
                    YourCompetitors.Visible      = false;
                    YourCompetitorsLabel.Visible = false;
                    CoachPage.Visible            = false;
                    CoachPageLabel.Visible       = false;
                }
            }
        }
        protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            string[] WordsArray;
            string   AgeGr;
            Int32    Gend;
            Int32    AgeFr;
            Int32    AgeTo;
            Int32    ColNo;
            Int32    TegundStigak = 0;

            string EventLineNoText = "";
            bool   UserIsSignedin  = false;

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

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

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

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

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

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

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

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

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


            //if (File.Exists(WrkFileName))


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

            ////    HyperLink hp = new HyperLink();
            ////    hp.Text = ".";
            ////    hp.NavigateUrl = path; // WrkFileName;
            ////    e.Row.Cells[ColNoForPDFResults].Controls.Add(hp);
            ////}
            ////else
            ////{
            e.Row.Cells[ColNoForPDFResults].Visible = false;
            ////}
        }
示例#28
0
        protected void SelectCompetitorGridView_SelectedIndexChanged(object sender, EventArgs e)
        {
            Global Gl = new Global();

            AthleticCompetitionCRUD       AthlCompCRUD         = new AthleticCompetitionCRUD();
            Athl_CompetitorsInCompetition AthlCompetitorInComp = new Athl_CompetitorsInCompetition();
            string CompetitorCode;
            bool   WasOkToMove      = false;
            string ErrorMessageText = "";

            GridViewRow CurrRow = SelectCompetitorGridView.SelectedRow;
            Int32       IndexForCompetitorCode = Gl.GetColumnIndexByName(CurrRow, "CompetitorCode");

            CompetitorCode = CurrRow.Cells[IndexForCompetitorCode].Text;
            string ChangeToClub = "";

            if (RegistrationAction.SelectedValue.ToString() == "1") //(ChangeClubsCheckBox.Checked == true)
            {
                ChangeToClub = SelectedClub.SelectedValue.ToString();
            }
            else
            {
                ChangeToClub = "";
            }

            AthlCompetitorInComp = AthlCompCRUD.CopyCompetitorToCompetition(CompetitorCode, Gl.GetCompetitionCode(), Gl.GetCompetitionYear(),
                                                                            ChangeToClub, out WasOkToMove, out ErrorMessageText);
            if (WasOkToMove == false)
            {
                ErrorMsgBox.Text = ErrorMessageText;
            }
            //AthlCompetitorInComp = AthlCompCRUD.InitCompetitorInComp();

            //AthlCompetitorInComp.mot = Gl.GetCompetitionCode();
            //AthlCompetitorInComp.rasnumer = Gl.ReturnNextBibno(AthlCompetitorInComp.mot);
            //string KeppNo = SelectCompetitorGridView.SelectedRow.Cells[1].Text;
            //KeppNo = HttpUtility.HtmlDecode(KeppNo);
            //AthlCompetitorInComp.keppendanumer = KeppNo;
            //if (SelectCompetitorGridView.SelectedRow.Cells[2].Text == "Karl")
            //{
            //    AthlCompetitorInComp.kyn = 1;
            //}
            //else
            //{
            //    AthlCompetitorInComp.kyn = 2;
            //}
            //AthlCompetitorInComp.kennitala = SelectCompetitorGridView.SelectedRow.Cells[3].Text;
            //string Name = SelectCompetitorGridView.SelectedRow.Cells[4].Text;
            //Name = HttpUtility.HtmlDecode(Name);
            //AthlCompetitorInComp.nafn = Name;
            //AthlCompetitorInComp.faedingarar = Convert.ToInt16(SelectCompetitorGridView.SelectedRow.Cells[5].Text);
            //AthlCompetitorInComp.aldurkeppanda = Convert.ToInt32(SelectCompetitorGridView.SelectedRow.Cells[6].Text);
            //string Club = SelectCompetitorGridView.SelectedRow.Cells[7].Text;
            //Club = HttpUtility.HtmlDecode(Club);
            //AthlCompetitorInComp.felag = Club;
            ////string NoOfPerf = SelectCompetitorGridView.SelectedRow.Cells[8].Text;
            //AthlCompetitorInComp.faedingardagur = Convert.ToDateTime(SelectCompetitorGridView.SelectedRow.Cells[9].Text);
            //string Land = SelectCompetitorGridView.SelectedRow.Cells[10].Text;
            //Land = HttpUtility.HtmlDecode(Land);
            //AthlCompetitorInComp.land = Land;

            AthlCompCRUD.InsertCompetitorInCompetition(AthlCompetitorInComp);

            //Gl.SetSelComp(CompCode, Kennitala, Name, Gender, YearOfBirth, Club, Age, NoOfPerf);

            Response.Redirect("~/CompetitorsForUser.aspx");
        }
示例#29
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
            {
            }
        }
示例#30
0
        protected void InsertSelected_Click(object sender, EventArgs e)
        {
            if (RegistrationAction.SelectedValue.ToString() == "0")
            {
                string strMsg = "Þú verður að tilgreina hvort þú viljir flytja valda keppendur yfir í félagið þitt!";
                Response.Write("<script>alert('" + strMsg + "')</script>");
                //string Jascript = "<script language="\""javascript\" type=\"text/javascript\">alert('" + strMsg + "');</script>";
                //Response.Write(Jascript);
                return;
            }
            Int32    i;
            Int32    SelCellIndex;
            Int32    CompetitionYear;
            string   CompetitorCode;
            CheckBox SelectedCompetitor;
            Global   gl       = new Global();
            string   CompCode = gl.GetCompetitionCode();
            AthleticCompetitionCRUD       AthlCompCRUD         = new AthleticCompetitionCRUD();
            Athl_CompetitorsInCompetition AthlCompetitorInComp = new Athl_CompetitorsInCompetition();
            AthleticsEntities1            AthlEnt = new AthleticsEntities1();

            GridViewRow CurrRow;
            bool        WasOkToMove = false;
            string      Kennit      = "";
            string      CurrentClub = "";
            string      ErrorMsgText;
            string      UseThisClub = SelectedClub.SelectedValue.ToString();
            string      MoveToClub;

            if (RegistrationAction.SelectedValue.ToString() == "2") //(ChangeClubsCheckBox.Checked == true)
            {
                MoveToClub = UseThisClub;
            }
            else
            {
                MoveToClub = "";
            }
            CompetitionYear = Convert.ToInt32(gl.GetCompetitionYear());
            for (i = 0; i < SelectCompetitorGridView.Rows.Count; i++)  //Mens Events
            {
                SelectedCompetitor = (CheckBox)SelectCompetitorGridView.Rows[i].FindControl("ValinChk");
                if (SelectedCompetitor.Checked)
                {
                    ((CheckBox)SelectCompetitorGridView.Rows[i].FindControl("ValinChk")).Checked = false;

                    CurrRow        = SelectCompetitorGridView.Rows[i];
                    SelCellIndex   = gl.GetColumnIndexByName(CurrRow, "Félag");
                    CurrentClub    = CurrRow.Cells[SelCellIndex].Text;
                    SelCellIndex   = gl.GetColumnIndexByName(CurrRow, "CompetitorCode");
                    CompetitorCode = CurrRow.Cells[SelCellIndex].Text;

                    if ((CompetitorCode == "") || (CompetitorCode == "&nbsp;"))
                    {
                        SelCellIndex = gl.GetColumnIndexByName(CurrRow, "Kennitala");
                        Kennit       = CurrRow.Cells[SelCellIndex].Text;
                        if (Kennit != "")
                        {
                            string ClubForNewCompetitor = UseThisClub;
                            if (MoveToClub != "")
                            {
                                ClubForNewCompetitor = MoveToClub;
                            }
                            ObjectParameter NewCompetitorNo;
                            NewCompetitorNo = new ObjectParameter("CompetitorCodeOut", "");

                            AthlEnt.RegisterCompetitorFromNatReg(Kennit, ClubForNewCompetitor, NewCompetitorNo);
                            CompetitorCode = NewCompetitorNo.Value.ToString();
                        }
                    }

                    AthlCompetitorInComp = AthlCompCRUD.CopyCompetitorToCompetition(CompetitorCode, CompCode, CompetitionYear, MoveToClub, out WasOkToMove, out ErrorMsgText);

                    if ((WasOkToMove == false) && ((ErrorMsgText == "") == false))
                    {
                        Response.Write("<script>alert('" + ErrorMsgText + "')</script>");
                        return;
                    }
                    AthlCompCRUD.InsertCompetitorInCompetition(AthlCompetitorInComp);
                }
            }

            Response.Redirect("SelectedCompetitionCompetitors.aspx?Code=" + CompCode);
        }