private void OnRowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType != DataControlRowType.DataRow)
            return;

        DataRowView rowView = (DataRowView)e.Row.DataItem;
        MLText firstname = new MLText();
        MLText lastname = new MLText();

        firstname.LoadFromXML(rowView["FirstName"].ToString());
        lastname.LoadFromXML(rowView["LastName"].ToString());
        e.Row.Cells[0].Text = string.Format("{0} {1}", firstname, lastname);

        e.Row.Cells[2].Text = (bool)rowView["IsTaken"]
                            ? (string)GetLocalResourceObject("Taken")
                            : (string)GetLocalResourceObject("Granted");
    }
    private void OnRowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType != DataControlRowType.DataRow)
            return;

        DataRowView rowView = (DataRowView)e.Row.DataItem;
        MLText firstname = new MLText();
        MLText lastname = new MLText();

        firstname.LoadFromXML(rowView["OwnerFirstName"].ToString());
        lastname.LoadFromXML(rowView["OwnerLastName"].ToString());
        e.Row.Cells[2].Text = string.Format("{0} {1}", firstname, lastname);

        Image image = e.Row.Cells[0].FindControl("imgType") as Image;
        if (image == null)
            return;

        image.ImageUrl = string.Format("~/Images/RequestObject/reqobj_{0}.png", rowView["ObjType"].ToString());
    }
Example #3
0
        public void LoadFromXML()
        {
            m_MLText = new MLText();
            m_MLText["ru"] = TextRu;
            m_MLText["en"] = TextEn;

            MLText mlt = new MLText();
            mlt.LoadFromXML(m_MLText.ToXMLString());

            Assert.AreEqual(TextRu, mlt["ru"]);
            Assert.AreEqual(TextEn, mlt["en"]);

            mlt.LoadFromXML(new MLText().ToXMLString());
            Assert.AreEqual(0, mlt.Cultures.Length);

            mlt.LoadFromXML(TextEnUK);
            Assert.AreEqual(TextEnUK, mlt[MLText.CurrentCultureID]);
        }