Beispiel #1
0
        protected void InsertCompetitors_Click(object sender, EventArgs e)
        {
            Int32                         i;
            Int32                         SelCellIndex;
            Int32                         CompetitionYear;
            string                        MoveToClub = "";
            bool                          WasOkToMove;
            string                        ErrorText;
            string                        CompetitorCode;
            CheckBox                      SelectedEvent;
            Global                        gl                   = new Global();
            AthleticsEntities1            AthlEnt              = new AthleticsEntities1();
            AthleticCompetitionCRUD       AthlCompCRUD         = new AthleticCompetitionCRUD();
            Athl_CompetitorsInCompetition AthlCompetitorInComp = new Athl_CompetitorsInCompetition();
            GridViewRow                   CurrRow;

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

                    //AthlCompetitorInComp = AthlCompCRUD.InitCompetitorInComp();

                    //AthlCompetitorInComp.mot = gl.GetCompetitionCode();
                    //AthlCompetitorInComp.rasnumer = gl.ReturnNextBibno(AthlCompetitorInComp.mot);
                    CurrRow        = SelectedCompetitors.Rows[i];
                    SelCellIndex   = gl.GetColumnIndexByName(CurrRow, "CompetitorCode");
                    CompetitorCode = CurrRow.Cells[SelCellIndex].Text;

                    //string KeppNo = SelectedCompetitors.SelectedRow.Cells[SelRowIndex].Text;

                    CompetitorCode = CurrRow.Cells[SelCellIndex].Text;

                    ObjectParameter IsRegisteredParameter;
                    IsRegisteredParameter = new ObjectParameter("IsRegistered", typeof(global::System.Int32));

                    AthlEnt.CompetitorIsAlreadyRegisteredInCompetition(CompCode.Text, CompetitorCode, IsRegisteredParameter);

                    Int32 CompetitorIsAlreadyRegistered = Convert.ToInt32(IsRegisteredParameter.Value.ToString());
                    if (CompetitorIsAlreadyRegistered == 0)
                    {
                        AthlCompetitorInComp = AthlCompCRUD.CopyCompetitorToCompetition(CompetitorCode, CompCode.Text, CompetitionYear, MoveToClub, out WasOkToMove, out ErrorText);
                    }
//CopyCompetitorToCompetition(string CompetitorCode, string CompetitonCode, Int32 CompetitionYear, string MoveToClub,
//           out bool WasOkToMove, out string ReasonText)
                    //KeppNo = HttpUtility.HtmlDecode(KeppNo);
                    //AthlCompetitorInComp.keppendanumer = KeppNo;
                    //if (SelectedCompetitors.SelectedRow.Cells[2].Text == "Karl")
                    //{
                    //    AthlCompetitorInComp.kyn = 1;
                    //}
                    //else
                    //{
                    //    AthlCompetitorInComp.kyn = 2;
                    //}
                    //AthlCompetitorInComp.kennitala = SelectedCompetitors.SelectedRow.Cells[3].Text;
                    //string Name = SelectedCompetitors.SelectedRow.Cells[4].Text;
                    //Name = HttpUtility.HtmlDecode(Name);
                    //AthlCompetitorInComp.nafn = Name;
                    //AthlCompetitorInComp.faedingarar = Convert.ToInt16(SelectedCompetitors.SelectedRow.Cells[5].Text);
                    //AthlCompetitorInComp.aldurkeppanda = Convert.ToInt32(SelectedCompetitors.SelectedRow.Cells[6].Text);
                    //string Club = SelectedCompetitors.SelectedRow.Cells[7].Text;
                    //Club = HttpUtility.HtmlDecode(Club);
                    //AthlCompetitorInComp.felag = Club;
                    ////string NoOfPerf = SelectCompetitorGridView.SelectedRow.Cells[8].Text;
                    //AthlCompetitorInComp.faedingardagur = Convert.ToDateTime(SelectedCompetitors.SelectedRow.Cells[9].Text);
                    //string Land = SelectedCompetitors.SelectedRow.Cells[10].Text;
                    //Land = HttpUtility.HtmlDecode(Land);
                    //AthlCompetitorInComp.land = Land;

                    AthlCompCRUD.InsertCompetitorInCompetition(AthlCompetitorInComp);
                    AthlEnt.InsertToLogFile(CurrentUserName.Text, "Skráning í mót", CompCode.Text, AthlCompetitorInComp.keppendanumer, "");

                    //       AthlCompEvents = AthlCompCRUD.InitCompetitionEvent();
                    //       AthlCompEvents.mot = gl.GetCompetitionCode();
                }
            }
            SelectedCompetitors.DataBind();

            //Response.Redirect("NyttMot.aspx?Comp=" + gl.GetCompetitionCode());
        }
Beispiel #2
0
        protected void EventsGW_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            int ColEventLine          = 0;
            int ColDate               = 0;
            int ColTime               = 0;
            int ColDateDropDown       = 0;
            int ColNoOfLanes          = 0;
            int ColNoOfRounds         = 0;
            int ColNoAgeFrom          = 0;
            int ColNoAgeTo            = 0;
            int ColNoTypeOfEvent      = 0;
            int ColNoCloserType       = 0;
            int ColNoEventDescription = 0;
            int ColNoNoOfCompetitors  = 0;

            AthleticsEntities1 AthlEnt = new AthleticsEntities1();

            GridViewRow CurrRow;

            CurrRow = e.Row;
            Global gl = new Global();

            ColEventLine          = gl.GetColumnIndexByName(CurrRow, "lina");
            ColDate               = gl.GetColumnIndexByName(CurrRow, "dagsetning");
            ColTime               = gl.GetColumnIndexByName(CurrRow, "timi");
            ColDateDropDown       = gl.GetColumnIndexByName(CurrRow, "DropDDate");
            ColNoOfLanes          = gl.GetColumnIndexByName(CurrRow, "fjoldiibrauta");
            ColNoOfRounds         = gl.GetColumnIndexByName(CurrRow, "fjoldiumferda");
            ColNoAgeFrom          = gl.GetColumnIndexByName(CurrRow, "aldurfra");
            ColNoAgeTo            = gl.GetColumnIndexByName(CurrRow, "aldurtil");
            ColNoTypeOfEvent      = gl.GetColumnIndexByName(CurrRow, "tegundgreinar");
            ColNoEventDescription = gl.GetColumnIndexByName(CurrRow, "heitigreinar");
            ColNoCloserType       = gl.GetColumnIndexByName(CurrRow, "nanaritegundargreining");
            ColNoNoOfCompetitors  = gl.GetColumnIndexByName(CurrRow, "NoOfCompetitorsInEv");

            if ((e.Row.RowType == DataControlRowType.DataRow) && (ArraysHaveBeenPopulated == false))
            {
                NoOfEventLines = NoOfEventLines + 1;
                EventLineArr[NoOfEventLines] = Convert.ToInt32(e.Row.Cells[ColEventLine].Text);
                TimeArr[NoOfEventLines]      = e.Row.Cells[ColTime].Text;
                DropDownList ddl       = (DropDownList)e.Row.FindControl("DropDDate");
                int          ElementNo = 0;
                foreach (string colName in CompetitionDateArr)
                {
                    ElementNo = ElementNo + 1;
                    if (ElementNo <= NoOfDatesinCompetition)
                    {
                        ddl.Items.Add(new ListItem(colName));
                    }
                }
                ddl.SelectedValue                   = HttpUtility.HtmlDecode(e.Row.Cells[ColDate].Text);
                DateArr[NoOfEventLines]             = HttpUtility.HtmlDecode(e.Row.Cells[ColDate].Text);
                NoOfLanesArr[NoOfEventLines]        = gl.TryConvertStringToInt32(e.Row.Cells[ColNoOfLanes].Text);
                NoOfRoundsArr[NoOfEventLines]       = gl.TryConvertStringToInt32(e.Row.Cells[ColNoOfRounds].Text);
                AgeFromsArr[NoOfEventLines]         = gl.TryConvertStringToInt32(e.Row.Cells[ColNoAgeFrom].Text);
                AgeToArr[NoOfEventLines]            = gl.TryConvertStringToInt32(e.Row.Cells[ColNoAgeTo].Text);
                NoOfCompetitorsArr[NoOfEventLines]  = gl.TryConvertStringToInt32(e.Row.Cells[ColNoNoOfCompetitors].Text);
                EventDescriptionArr[NoOfEventLines] = HttpUtility.HtmlDecode(e.Row.Cells[ColNoEventDescription].Text);
                string TypeOfEv   = e.Row.Cells[ColNoTypeOfEvent].Text;
                string CloserType = HttpUtility.HtmlDecode(e.Row.Cells[ColNoCloserType].Text);
                if (TypeOfEv == "Hlaup")
                {
                    TextBox NoOfRndsTextBox = (TextBox)e.Row.FindControl("NoOfRounds");
                    NoOfRndsTextBox.Text    = "";
                    NoOfRndsTextBox.Enabled = false;
                }
                else
                {
                    TextBox NoOfLanesTextBox = (TextBox)e.Row.FindControl("NoOfLanes");
                    NoOfLanesTextBox.Text    = "";
                    NoOfLanesTextBox.Enabled = false;
                    if (CloserType == "Hástökk - Stangarstökk")
                    {
                        TextBox NoOfRndsTextBox = (TextBox)e.Row.FindControl("NoOfRounds");
                        NoOfRndsTextBox.Text    = "";
                        NoOfRndsTextBox.Enabled = false;
                    }
                }
            }
            e.Row.Cells[ColEventLine].Text          = null;
            e.Row.Cells[ColDate].Text               = null;
            e.Row.Cells[ColTime].Text               = null;
            e.Row.Cells[ColNoOfRounds].Text         = null;
            e.Row.Cells[ColNoOfLanes].Text          = null;
            e.Row.Cells[ColNoAgeFrom].Text          = null;
            e.Row.Cells[ColNoAgeTo].Text            = null;
            e.Row.Cells[ColNoTypeOfEvent].Text      = null;
            e.Row.Cells[ColNoEventDescription].Text = null;
            e.Row.Cells[ColNoCloserType].Text       = null;
        }
Beispiel #3
0
        protected void SendApplication_Click(object sender, EventArgs e)
        {
            Global gl = new Global();
            bool   EmailAdrIsOk;
            string EmailTxt            = "";
            string EmailValidationText = "";

            if (RequestedUserID.Text == "")
            {
                ErrorMsg.Text = "Þú verður að fylla út umbeðna notendakennið";
                return;
            }
            if (Name.Text == "")
            {
                ErrorMsg.Text = "Þú verður að fylla út Nafnið";
                return;
            }
            if ((EmailAddress.Text == "") || (EmailAddress.Text != EmailAddressAgain.Text))
            {
                ErrorMsg.Text = "Þú verður að fylla út tölvupóstfangið þitt tvisvar sinnum. Það verður að vera alveg eins í bæði skiptin";
                return;
            }
            EmailTxt     = EmailAddress.Text;
            EmailAdrIsOk = gl.ValidEmailAddress(EmailTxt);

            if (EmailAdrIsOk == false)
            {
                ErrorMsg.Text = "Tölvupóstfangið verður að vera rétt byggt upp. Dæmi: '*****@*****.**'";
                return;
            }
            if (Club_1.Text == "")
            {
                ErrorMsg.Text = "Þú verður að fylla út a.m.k. eitt félag sem þú tengist";
                return;
            }

            RequestedUserID.Text = RequestedUserID.Text.ToUpper();

            ObjectParameter MsgOut;

            MsgOut = new ObjectParameter("MessageOut", typeof(global::System.String));

            AthleticsEntities1 AthlEnt = new AthleticsEntities1();

            AthlEnt.SaveApplicationForAccess(RequestedUserID.Text, Name.Text, EmailAddress.Text, EmailAddressAgain.Text, TelephoneNo.Text,
                                             Club_1.Text, Club_2.Text, Club_3.Text, MsgOut);

            ErrorMsg.Text = MsgOut.Value.ToString();

            if (ErrorMsg.Text == "")
            {
                RequestedUserID.ReadOnly   = true;
                Name.ReadOnly              = true;
                EmailAddress.ReadOnly      = true;
                EmailAddressAgain.ReadOnly = true;
                TelephoneNo.ReadOnly       = true;
                Club_1.ReadOnly            = true;
                Club_2.ReadOnly            = true;
                Club_3.ReadOnly            = true;

                ErrorMsg.Text           = "Staðfesting og lykilorð verður sent á tölvupóstfang " + EmailAddress.Text + " fljótlega.";
                SendApplication.Visible = false;
                Response.Write("<script language=javascript>alert('Staðfesting og lykilorð verður sent bráðlega.')</script>");
            }
        }
Beispiel #4
0
        protected void CoachesPageGV_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            int ColNoEvent             = 0;
            int ColNoLineType          = 0;
            int ColNoCallRoom          = 0;
            int ColNoEventDate         = 0;
            int ColNoEventTime         = 0;
            int ColNoBibNo             = 0;
            int ColNoCompetitor        = 0;
            int ColNoYoB               = 0;
            int ColNoClub              = 0;
            int ColNoHeatNo            = 0;
            int ColNoLaneNo            = 0;
            AthleticsEntities1 AthlEnt = new AthleticsEntities1();
            GridViewRow        CurrRow;

            CurrRow = e.Row;
            Global gl = new Global();

            ColNoEvent      = gl.GetColumnIndexByName(CurrRow, "EventName");
            ColNoCallRoom   = gl.GetColumnIndexByName(CurrRow, "CallRoomTime");
            ColNoEventDate  = gl.GetColumnIndexByName(CurrRow, "EventDate");
            ColNoEventTime  = gl.GetColumnIndexByName(CurrRow, "EventTime");
            ColNoLineType   = gl.GetColumnIndexByName(CurrRow, "LineType");
            ColNoBibNo      = gl.GetColumnIndexByName(CurrRow, "BibNo");
            ColNoCompetitor = gl.GetColumnIndexByName(CurrRow, "CompetitorName");
            ColNoYoB        = gl.GetColumnIndexByName(CurrRow, "CompetitorYearOfBirth");
            ColNoClub       = gl.GetColumnIndexByName(CurrRow, "CompetitorClub");
            ColNoHeatNo     = gl.GetColumnIndexByName(CurrRow, "HeatNumber");
            ColNoLaneNo     = gl.GetColumnIndexByName(CurrRow, "LaneOrOrder");

            //<asp:BoundField DataField="EventName" HeaderText="Grein" SortExpression="EventName" />
            //<asp:BoundField DataField="CallRoomTime" HeaderText="Nafnakall" SortExpression="CallRoomTime" DataFormatString="{0:t}" />
            //<asp:BoundField DataField="EventDate" HeaderText="Dagsetn." SortExpression="EventDate" DataFormatString="{0:d}" />
            //<asp:BoundField DataField="EventTime" HeaderText="Tími greinar" SortExpression="EventTime" DataFormatString="{0:t}" />
            //<asp:BoundField DataField="BibNo" HeaderText="Rásnr." SortExpression="BibNo" />
            //<asp:BoundField DataField="CompetitorName" HeaderText="Keppandi" SortExpression="CompetitorName" />
            //<asp:BoundField DataField="CompetitorYearOfBirth" HeaderText="F.ár" SortExpression="CompetitorYearOfBirth" />
            //<asp:BoundField DataField="CompetitorClub" HeaderText="Félag" SortExpression="CompetitorClub" />
            //<asp:BoundField DataField="HeatNumber" HeaderText="Riðill" SortExpression="HeatNumber" />
            //<asp:BoundField DataField="LaneOrOrder" HeaderText="Braut/Röð" SortExpression="LaneOrOrder" />
            //<asp:BoundField DataField="LineType" HeaderText="LineType" SortExpression="LineType" />
            //<asp:BoundField DataField="EventLineNo" HeaderText="EventLineNo" SortExpression="EventLineNo" Visible="False" />
            //<asp:BoundField DataField="EventType" HeaderText="EventType" SortExpression="EventType" Visible="False" />
            //<asp:BoundField DataField="CloserEventType" HeaderText="CloserEventType" SortExpression="CloserEventType" Visible="False" />


            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //AthlEnt.InsertToLogFile("Vindur í línu ", e.Row.Cells[ColNoWind].Text);

                if (e.Row.Cells[ColNoLineType].Text == "1")  //Event Name and Date
                {
                    e.Row.Cells[ColNoCompetitor].Text        = e.Row.Cells[ColNoEvent].Text;
                    e.Row.Cells[ColNoCompetitor].Font.Bold   = true;
                    e.Row.Cells[ColNoCompetitor].Font.Italic = true;
                    e.Row.Cells[ColNoCompetitor].Font.Size   = 10;
//                    e.Row.Cells[ColNoEvent].ColumnSpan = 6;
                    e.Row.Cells[ColNoBibNo].Text    = null;
                    e.Row.Cells[ColNoEvent].Text    = null;
                    e.Row.Cells[ColNoYoB].Text      = null;
                    e.Row.Cells[ColNoClub].Text     = null;
                    e.Row.Cells[ColNoHeatNo].Text   = null;
                    e.Row.Cells[ColNoLaneNo].Text   = null;
                    e.Row.Cells[ColNoLineType].Text = null;
                }
                else
                {
                    //e.Row.Cells[4].Text = e.Row.Cells[ColNoName].Text;
                    e.Row.Cells[ColNoLineType].Text  = null;
                    e.Row.Cells[ColNoEvent].Text     = null;
                    e.Row.Cells[ColNoCallRoom].Text  = null;
                    e.Row.Cells[ColNoEventDate].Text = null;
                    e.Row.Cells[ColNoEventTime].Text = null;
                    //   e.Row.Cells[ColNoEvent]
                }
            }
            else
            {
//                e.Row.Cells[ColNoEventName].Text = null;
//                e.Row.Cells[ColNoEventDate].Text = null;
                e.Row.Cells[ColNoLineType].Text = null;
            }
        }
Beispiel #5
0
        protected void RecordsPBsAndSBs_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            int ColNoLineType      = 0;
            int ColNoName          = 0;
            int ColNoClub          = 0;
            int ColNoYearOfBirth   = 0;
            int ColNoRemarks       = 0;
            int ColNoPerformance   = 0;
            int ColNoEventName     = 0;
            int ColNoNoOfRecords   = 0;
            int ColNoNoOfPbsAndSbs = 0;

            int NoOfRecords   = 0;
            int NoOfPbsAndSbs = 0;
            int FirstLine     = 1;

            //<asp:BoundField DataField="Name" HeaderText="Nafn" SortExpression="Name" />
            //<asp:BoundField DataField="Club" HeaderText="Félag" SortExpression="Club" />
            //<asp:BoundField DataField="YearOfBirth" HeaderText="F.ár" SortExpression="YearOfBirth" />
            //<asp:BoundField DataField="Remarks" HeaderText="Athugasemd" SortExpression="Remarks" />
            //<asp:BoundField DataField="Performance" HeaderText="Árangur" SortExpression="Performance" />
            //<asp:BoundField DataField="EventName" He


            AthleticsEntities1 AthlEnt = new AthleticsEntities1();

            GridViewRow CurrRow;

            CurrRow = e.Row;
            Global gl = new Global();

            ColNoLineType      = gl.GetColumnIndexByName(CurrRow, "LineType");
            ColNoName          = gl.GetColumnIndexByName(CurrRow, "Name");
            ColNoClub          = gl.GetColumnIndexByName(CurrRow, "Club");
            ColNoYearOfBirth   = gl.GetColumnIndexByName(CurrRow, "YearOfBirth");
            ColNoRemarks       = gl.GetColumnIndexByName(CurrRow, "Remarks");
            ColNoPerformance   = gl.GetColumnIndexByName(CurrRow, "Performance");
            ColNoEventName     = gl.GetColumnIndexByName(CurrRow, "EventName");
            ColNoNoOfRecords   = gl.GetColumnIndexByName(CurrRow, "NoOfRecords");
            ColNoNoOfPbsAndSbs = gl.GetColumnIndexByName(CurrRow, "NoOfPbsAndSbs");

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (FirstLine == 1)
                {
                    NoOfRecords   = Convert.ToInt32(e.Row.Cells[ColNoNoOfRecords].Text);
                    NoOfPbsAndSbs = Convert.ToInt32(e.Row.Cells[ColNoNoOfPbsAndSbs].Text);
                    FirstLine     = 0;
                    if ((NoOfRecords > 0) || (NoOfPbsAndSbs > 0))
                    {
                        if (NoOfRecords > 0)
                        {
                            InfoLine.Text = "Fjöldi meta: " + NoOfRecords.ToString();
                            if (NoOfPbsAndSbs > 0)
                            {
                                InfoLine.Text = InfoLine.Text + ", Fjöldi Pb/Sb: " + NoOfPbsAndSbs.ToString();
                            }
                        }
                        else
                        {
                            InfoLine.Text = "Fjöldi Pb/Sb: " + NoOfPbsAndSbs.ToString();
                        }
                    }
                }

                if (e.Row.Cells[ColNoLineType].Text == "1")  //Record = 1, Pb or Sb = 2
                {
                    e.Row.Cells[ColNoLineType].Text         = "Met";
                    e.Row.Cells[ColNoName].Font.Bold        = true;
                    e.Row.Cells[ColNoClub].Font.Bold        = true;
                    e.Row.Cells[ColNoYearOfBirth].Font.Bold = true;
                    e.Row.Cells[ColNoRemarks].Font.Bold     = true;
                    e.Row.Cells[ColNoRemarks].ForeColor     = System.Drawing.Color.Red;
                    e.Row.Cells[ColNoPerformance].Font.Bold = true;
                    e.Row.Cells[ColNoEventName].Font.Bold   = true;
                }
                else
                {
                    e.Row.Cells[ColNoLineType].Text = null;
                }
                e.Row.Cells[ColNoNoOfRecords].Text   = null;
                e.Row.Cells[ColNoNoOfPbsAndSbs].Text = null;
            }
            else
            {
                e.Row.Cells[ColNoLineType].Text      = null;
                e.Row.Cells[ColNoNoOfRecords].Text   = null;
                e.Row.Cells[ColNoNoOfPbsAndSbs].Text = null;
            }
        }
Beispiel #6
0
        protected void FillPage(string CompCode, Int32 EventNo, Athl_CompetitionEvents AthlEvent)
        {
            Int32 LabelNo = 0;
            Int32 TextBoxNo = 0;
            Global gl = new Global();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            AthleticsEntities1 AthlEnt = new AthleticsEntities1();
            // var CompetitorsInEventDataset = AthlEnt.CompetitorsInEventInResultOrder1(CompCode, EventNo, "%");
            var CompetitorsInEventDataset = AthlEnt.CompetitorsInEvResultOrder(CompCode, EventNo, "%");
            Int32 NoOfLines = 0;
            string FirstInCloserOrder = "";
            Int32 IndexOfDash;

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

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

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

        }
Beispiel #7
0
        protected void SaveRaceResultOrder_Click(object sender, EventArgs e)
        {
            Global gl = new Global();
            string CompCode = gl.GetCompetitionCode();
            //Int32 EventLineNo = Convert.ToInt32(gl.GetCompetitionEventNo());
            string EventLineNoText = Request.QueryString.Get("Event");
            Int32 EventLineNo = Convert.ToInt32(EventLineNoText);
            AthleticsEntities1 AthlEnt = new AthleticsEntities1();
            AthleticCompetitionCRUD AthlCRUD = new AthleticCompetitionCRUD();
            Athl_CompetitorsInEvent AthlCompetitorsInEventRec = new Athl_CompetitorsInEvent();
            Athl_CompetitionEvents AthlCompEvent = new Athl_CompetitionEvents();
            string TextBoxID;
            string CurrValue;
            Int32 CurrValueInt;
            bool NeedToUpdateOrderByResults = false;
            string[] ControlNameParts;
            Int32 LineNoForTextBox;
            Int32 BibNo = 0;

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

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

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

            if (SelectDay.SelectedValue.ToString() == "%")
            {
                SelectedDay1 = CompDatesArr[1];
                SelectedDay2 = CompDatesArr[2];
                SelectedDay3 = CompDatesArr[3];
            }
            else
            {
                SelectedDay1 = SelectDay.SelectedValue.ToString();
                SelectedDay1 = SelectedDay1.Substring(0, SelectedDay1.Length - 1);
            }

            int ColRecordType          = 0;
            int ColUtskyring           = 0;
            int ColAgeGroupDescr       = 0;
            int ColFelag               = 0;
            int ColNoPointsDay1        = 0;
            int ColNoPointsDay2        = 0;
            int ColNoPointsDay3        = 0;
            int ColSamtalsStig         = 0;
            AthleticsEntities1 AthlEnt = new AthleticsEntities1();

            GridViewRow CurrRow;

            CurrRow = e.Row;
            Global gl = new Global();

            ColRecordType    = gl.GetColumnIndexByName(CurrRow, "RecordType");
            ColUtskyring     = gl.GetColumnIndexByName(CurrRow, "Utskyring");
            ColAgeGroupDescr = gl.GetColumnIndexByName(CurrRow, "AgeGroupDescription");
            ColFelag         = gl.GetColumnIndexByName(CurrRow, "HeitiFelags");
            ColSamtalsStig   = gl.GetColumnIndexByName(CurrRow, "TotalPoints");
            ColNoPointsDay1  = gl.GetColumnIndexByName(CurrRow, "PointsDay1");
            ColNoPointsDay2  = gl.GetColumnIndexByName(CurrRow, "PointsDay2");
            ColNoPointsDay3  = gl.GetColumnIndexByName(CurrRow, "PointsDay3");

            if (e.Row.RowType == DataControlRowType.Header)
            {
                if (AthlCompRec.tungumal > 0) //English or Icelandic and English
                {
                    e.Row.Cells[ColFelag].Text        = "Country";
                    e.Row.Cells[ColNoPointsDay1].Text = "Points " + SelectedDay1;
                    e.Row.Cells[ColNoPointsDay2].Text = "Points " + SelectedDay2;
                    e.Row.Cells[ColNoPointsDay3].Text = "Points " + SelectedDay3;
                    e.Row.Cells[ColSamtalsStig].Text  = "Total Points";
                }
                else
                {
                    e.Row.Cells[ColNoPointsDay1].Text = "Stig " + SelectedDay1;
                    e.Row.Cells[ColNoPointsDay2].Text = "Stig " + SelectedDay2;
                    e.Row.Cells[ColNoPointsDay3].Text = "Stig " + SelectedDay3;
                    e.Row.Cells[ColSamtalsStig].Text  = "Samtals stig";
                }
                if (SelectedDay2 == "")
                {
                    e.Row.Cells[ColNoPointsDay2].Text = null;
                    e.Row.Cells[ColNoPointsDay3].Text = null;
                    e.Row.Cells[ColSamtalsStig].Text  = null;
                }
                else
                {
                    if (SelectedDay3 == "")
                    {
                        e.Row.Cells[ColNoPointsDay3].Text = null;
                    }
                }
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //AthlEnt.InsertToLogFile("Vindur í línu ", e.Row.Cells[ColNoWind].Text);

                if (e.Row.Cells[ColRecordType].Text == "1")  //Description
                {
                    e.Row.Cells[ColFelag].Text         = e.Row.Cells[ColAgeGroupDescr].Text + " - " + e.Row.Cells[ColUtskyring].Text;
                    e.Row.Cells[ColFelag].Font.Bold    = true;
                    e.Row.Cells[ColFelag].Font.Italic  = true;
                    e.Row.Cells[ColFelag].Font.Size    = 14;
                    e.Row.Cells[ColFelag].ColumnSpan   = 4;
                    e.Row.Cells[ColRecordType].Text    = null;
                    e.Row.Cells[ColUtskyring].Text     = null;
                    e.Row.Cells[ColAgeGroupDescr].Text = null;
                    e.Row.Cells[ColNoPointsDay1].Text  = null;
                    e.Row.Cells[ColNoPointsDay2].Text  = null;
                    e.Row.Cells[ColNoPointsDay3].Text  = null;
                    e.Row.Cells[ColSamtalsStig].Text   = null;
                }
                else
                {
                    e.Row.Cells[ColRecordType].Text    = null;
                    e.Row.Cells[ColUtskyring].Text     = null;
                    e.Row.Cells[ColAgeGroupDescr].Text = null;
                    if (SelectedDay2 == "")
                    {
                        e.Row.Cells[ColSamtalsStig].Text  = null;
                        e.Row.Cells[ColNoPointsDay2].Text = null;
                        e.Row.Cells[ColNoPointsDay3].Text = null;
                    }
                    else
                    {
                        if (SelectedDay3 == "")
                        {
                            e.Row.Cells[ColNoPointsDay3].Text = null;
                        }
                    }
                }
            }
            else
            {
                e.Row.Cells[ColRecordType].Text    = null;
                e.Row.Cells[ColUtskyring].Text     = null;
                e.Row.Cells[ColAgeGroupDescr].Text = null;
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Global             gl      = new Global();
                AthleticsEntities1 AthlEnt = new AthleticsEntities1();
                CompCode.Text        = gl.GetCompetitionCode();
                CompetitionName.Text = gl.GetCompetitionName();
                AthlCompRec          = AthlCRUD.GetCompetitionRec(CompCode.Text);

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

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

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

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

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