Exemplo n.º 1
0
    private string GetListAdv(string igid, string cssImage)
    {
        string    s  = "";
        DataTable dt = new DataTable();

        dt = GroupsItems.GetAllData("", " * ", GroupsItemsTSql.GetItemsInGroupCondition(
                                        igid, ItemsTSql.GetItemsByIienable("1")),
                                    GroupsItemsColumns.IorderColumn);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            //Neu quang cao co dat link thi them the <a>
            if (!dt.Rows[i]["VISEOLINK"].ToString().Equals(""))
            {
                string target = "";
                //Neu link quang cao dat mo tai trang khac
                if (dt.Rows[i]["VIPARAMS"].ToString().Equals("1"))
                {
                    target = "target='_blank'";
                }
                s += "<a class='iconLogo' " + target + " title='" + dt.Rows[i]["VITITLE"] + "' href='" +
                     dt.Rows[i]["VISEOLINK"] + "'>";
            }
            else
            {
                s += "<a class='iconLogo' >";
            }

            //Neu quang cao la hinh anh
            if (dt.Rows[i]["FISALEPRICE"].ToString().Equals("0"))
            {
                s += ImagesExtension.SetTypeImageAdvertising(
                    dt.Rows[i]["FIPRICE"].ToString(),
                    pic,
                    dt.Rows[i]["VIIMAGE"].ToString(),
                    dt.Rows[i]["VITITLE"].ToString(),
                    dt.Rows[i]["VIKEY"].ToString(),
                    dt.Rows[i]["VIDESC"].ToString(),
                    cssImage, false);
            }
            else //Neu quang cao la flash
            {
                s += ImagesExtension.SetTypeImageAdvertising(
                    dt.Rows[i]["FIPRICE"].ToString(),
                    dt.Rows[i]["VIAUTHOR"].ToString(),
                    "", "",
                    dt.Rows[i]["VIKEY"].ToString(),
                    dt.Rows[i]["VIDESC"].ToString(),
                    cssImage, false);
            }



            //Neu quang cao co dat link thi them the <a>
            if (!dt.Rows[i]["VISEOLINK"].ToString().Equals(""))
            {
                s += "</a>";
            }
            else
            {
                s += "</a>";
            }
        }

        return(s);
    }
Exemplo n.º 2
0
    private void LoadListSlider(string position, string cssImage)
    {
        //get data
        // lấy danh sách group có vị trí xác định
        string fields    = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn);
        string orderBy   = GroupsColumns.IgorderColumn;
        string condition = DataExtension.AndConditon(GroupsTSql.GetByApp(app),
                                                     GroupsTSql.GetByLang(lang),
                                                     GroupsTSql.GetGroupsByIgenable("1"),
                                                     GroupsTSql.GetGroupsByVgparams(position),
                                                     GroupsTSql.GetByLang(lang));
        DataTable dt = Groups.GetGroups("1", fields, condition, orderBy);

        if (dt.Rows.Count.Equals(0))
        {
            return;
        }
        string igid = "";

        // items info
        string title    = "";
        string img      = "";
        string href     = "";
        string viparams = "";
        string target   = "";
        string content  = "";

        string strList = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            igid = dt.Rows[i][GroupsColumns.IgidColumn].ToString();
            // getListItem
            DataTable dataItems = GroupsItems.GetAllData("1", " * ",
                                                         GroupsItemsTSql.GetItemsInGroupCondition(igid,
                                                                                                  ItemsTSql.GetItemsByIienable("1")),
                                                         GroupsItemsColumns.IorderColumn);
            if (dt.Rows.Count.Equals(0))
            {
                continue;
            }
            else
            {
                string s = "";
                for (int j = 0; j < dataItems.Rows.Count; j++)
                {
                    title    = dataItems.Rows[j][ItemsColumns.VititleColumn].ToString();
                    viparams = dataItems.Rows[j][ItemsColumns.ViparamsColumn].ToString();
                    if (viparams.Equals("1"))
                    {
                        target = "target='_blank'";
                    }
                    else
                    {
                        target = "";
                    }
                    href        = dataItems.Rows[j][ItemsColumns.ViurlColumn].ToString();
                    img         = ImagesExtension.SetTypeImageAdvertising("1", pic, dataItems.Rows[j][ItemsColumns.ViimageColumn].ToString(), title, "", "", cssImage, false);
                    content     = dataItems.Rows[j][ItemsColumns.VISEOTITLEColumn].ToString();
                    ltrAdv.Text = @"
                    <a href='" + href + "' title='" + title + @"' class='logo'>
                        " + img + @"
                    </a>";
                }
            }
        }
        //// render
        //ltrAdv.Text = "<ul class='khoi1170'>" + strList + "</ul>";
    }