Esempio n. 1
0
        public static string FillBoulder(SqlConnection cn)
        {
            string res = "";
            NowClimbingListsTableAdapter ta = new NowClimbingListsTableAdapter();

            ta.Connection = cn;
            DsListShow.NowClimbingListsDataTable table = ta.GetDataByStyle("Боулдеринг");

            foreach (DsListShow.NowClimbingListsRow row in table.Rows)
            {
                string nowClCur = ClimbingCompetition.ResultListBoulder.getNowClStr(row.iid, cn);
                if (nowClCur.Length > 0)
                {
                    if (res.Length > 0)
                    {
                        res += "; ";
                    }
                    res += row.grp + ": " + nowClCur;
                }
            }
            return(res);
        }
Esempio n. 2
0
        public static string FillSpeed(SqlConnection cn)
        {
            string res = "";
            NowClimbingListsTableAdapter     ta  = new NowClimbingListsTableAdapter();
            SpeedNowClimbingDataTableAdapter sta = new SpeedNowClimbingDataTableAdapter();

            sta.Connection = ta.Connection = cn;
            DsListShow.NowClimbingListsDataTable table = ta.GetDataByStyle("Скорость");

            foreach (DsListShow.NowClimbingListsRow row in table.Rows)
            {
                if (row.IsnowClimbingNull() && row.IsnowClimbingTmpNull() && row.IsnowClimbing3Null())
                {
                    continue;
                }
                if (res.Length > 0)
                {
                    res += "; ";
                }
                res += row.grp + ": ";
                bool stIns = false;
                if (!row.IsnowClimbingNull())
                {
                    foreach (DsListShow.SpeedNowClimbingDataRow row2 in sta.GetDataByIdClm(row.iid, row.nowClimbing))
                    {
                        res  += "Трасса 1: " + GetClimberName(row2) + " (Ст.№ " + row2.start.ToString() + ")";
                        stIns = true;
                        break;
                    }
                }
                if (!row.IsnowClimbingTmpNull())
                {
                    foreach (DsListShow.SpeedNowClimbingDataRow row2 in sta.GetDataByIdClm(row.iid, row.nowClimbingTmp))
                    {
                        if (stIns)
                        {
                            res += ", ";
                        }
                        else
                        {
                            stIns = true;
                        }
                        res += "Трасса 2: " + GetClimberName(row2) + " (Ст.№ " + row2.start.ToString() + ")";
                        break;
                    }
                }
                if (!row.IsnowClimbing3Null())
                {
                    foreach (DsListShow.SpeedNowClimbingDataRow row2 in sta.GetDataByIdClm(row.iid, row.nowClimbing3))
                    {
                        if (row2.IsresNull())
                        {
                            break;
                        }
                        if (stIns)
                        {
                            res += ", ";
                        }
                        string pos;
                        if (row2.IsposNull() || row2.pos == "в/к" || row2.res == "н/я" || row2.pos == "н/я")
                        {
                            pos = "";
                        }
                        else
                        {
                            pos = row2.pos;
                        }
                        res += GetClimberName(row2) + ": " +
                               "рез-т " + row2.res + ((pos.Length > 0) ? ", " + pos + " место" : "");
                        break;
                    }
                }
            }

            return(res);
        }
Esempio n. 3
0
        public static string FillLead(SqlConnection cn)
        {
            string res = "";
            NowClimbingListsTableAdapter    ta  = new NowClimbingListsTableAdapter();
            LeadNowClimbingDataTableAdapter lta = new LeadNowClimbingDataTableAdapter();

            lta.Connection = ta.Connection = cn;
            DsListShow.NowClimbingListsDataTable table = ta.GetDataByStyle("Трудность");

            foreach (DsListShow.NowClimbingListsRow row in table.Rows)
            {
                if (row.IsnowClimbingNull() && row.IsnowClimbingTmpNull())
                {
                    continue;
                }
                if (res.Length > 0)
                {
                    res += "; ";
                }
                res += row.grp;
                string rnd = row.round.ToLower();
                if (rnd.IndexOf("трасса 1") > -1)
                {
                    rnd = "Трасса 1";
                }
                else if (rnd.IndexOf("трасса 2") > -1)
                {
                    rnd = "Трасса 2";
                }
                else
                {
                    rnd = "";
                }
                if (rnd.Length > 0)
                {
                    res += " " + rnd;
                }
                res += ": ";
                bool stIns = false;
                if (!row.IsnowClimbingNull())
                {
                    foreach (DsListShow.LeadNowClimbingDataRow row2 in lta.GetDataByIdClm(row.iid, row.nowClimbing))
                    {
                        res += "На трассе " + row2.surname.ToUpper() + ((row2.IsnameNull()) ? "" : ((row2.name.Length > 0) ? " " + row2.name : "")) +
                               " (Ст.№ " + row2.start.ToString() + ")";
                        stIns = true;
                        break;
                    }
                }
                if (!row.IsnowClimbingTmpNull())
                {
                    foreach (DsListShow.LeadNowClimbingDataRow row2 in lta.GetDataByIdClm(row.iid, row.nowClimbingTmp))
                    {
                        if (row2.IsresNull())
                        {
                            break;
                        }
                        if (stIns)
                        {
                            res += ", ";
                        }
                        string pos;
                        if (row2.IsposNull() || row2.pos == "в/к" || row2.res == "н/я" || row2.pos == "н/я")
                        {
                            pos = "";
                        }
                        else
                        {
                            pos = row2.pos;
                        }
                        res += row2.surname.ToUpper() + ((row2.IsnameNull()) ? "" : ((row2.name.Length > 0) ? " " + row2.name : "")) + ": " +
                               "рез-т " + row2.res + ((pos.Length > 0) ? ", " + pos + " место" : "");
                        break;
                    }
                }
            }

            return(res);
        }