Пример #1
0
        List <ListEl> GetLists()
        {
            var lst = dc.ONLlists.Where(l => l.group_id != null && l.comp_id == link.comp_id &&
                                        l.ONLlistdatas.Count(ld => ld.climber_id == link.iid) > 0);

            List <ListEl> res  = new List <ListEl>();
            int           rInd = -1;

            foreach (var l in lst)
            {
                ListEl le = new ListEl(l.iid, l.style, l.round, l.group_id.Value);
                res.Add(le);
                if (rInd < 0 && le.Style.ToLower() == "трудность" && le.Round.ToLower().IndexOf("квалификация 2") == 0)
                {
                    rInd = res.Count - 1;
                }
            }
            if (rInd >= 0)
            {
                try
                {
                    List <ListEl> r2 = new List <ListEl>();
                    for (int i = 0; i <= rInd; i++)
                    {
                        r2.Add(res[i]);
                    }
                    var lq = (from l in dc.ONLlists
                              where l.round == "Квалификация" &&
                              l.style == "Трудность" &&
                              l.group_id == res[rInd].GroupID
                              select l.iid).First();
                    r2.Add(new ListEl(lq, res[rInd].Style,
                                      "Квалификация", res[rInd].GroupID));
                    for (int i = rInd + 1; i < res.Count; i++)
                    {
                        r2.Add(res[i]);
                    }
                    res.Clear();
                    res = r2;
                }
                catch { }
            }
            return(res);
        }
Пример #2
0
        private void FillBulletedList(string pos, string res, BulletedList dl, Label lb, ListEl le)
        {
            string ps = "", rs = "";

            if (pos.Length > 0)
            {
                ps = pos + " место";
            }
            if (res.Length > 0)
            {
                rs = "Результат: " + res;
            }
            if (ps != "" && rs != "")
            {
                ps += ", ";
            }

            ListItem li = new ListItem(le.Round + ": " + ps + rs,
                                       "~/ResultService.aspx?" + Constants.PARAM_IID + "=" + le.Iid.ToString());
            string imageID = Label2.ID;
            string js      = "loadS()";

            li.Attributes.Add("onclick", js);
            dl.Items.Add(li);
            dl.Visible = true;
            lb.Visible = true;
        }