コード例 #1
0
        protected void BindTemplates(int programmeId)
        {
            const string sql = "SELECT * FROM PagesTemplate WHERE ProgrammeId = @Id";

            using (var c = ConnectionFactory.GetConnection())
            {
                var templates = c.Query <Models.PagesTemplate>(sql, new { Id = programmeId });
                if (!templates.Any())
                {
                    return;
                }

                DataRepeater.DataSource = templates;
                DataRepeater.DataBind();
            }
        }
コード例 #2
0
    private void BindGridView()
    {
        Dictionary <string, string> otherculturedic = null;

        if (FileName == null)
        {
            return;
        }

        var dic = GetResDic(FileName);

        if (dic == null)
        {
            return;
        }

        if (OtherCultureExist)
        {
            otherculturedic = GetResDic(GetCurrentAlternateFileName(FileName));
        }

        List <Phrase> li = new List <Phrase>();

        foreach (var n in dic)
        {
            var p = new Phrase()
            {
                Label      = n.Key,
                Original   = n.Value,
                Translated = otherculturedic != null && otherculturedic.ContainsKey(n.Key) ? otherculturedic[n.Key] : string.Empty
            };
            li.Add(p);
        }

        DataRepeater.DataSource = li;
        DataRepeater.DataBind();
    }