private string TopMenuSubCategory(string countryID, string catID,string type)
        {
            string sql = "Select ID,TenTheLoai from tblTheLoai where MaDanhMuc=" + catID + " and MaQuocGia=" + countryID;
            string sql2 = "Select t.tieude,t.id from tblInfomation t,tblTheLoai tt,tblDanhMuc d where t.TheLoaiID=tt.Id and tt.madanhmuc=d.id and tt.maquocgia=" + countryID;
            clsBSDungChung bs = new clsBSDungChung();
            DataTable tbCat = new DataTable();
            DataTable tbInfo = new DataTable();
            tbCat = bs.GetDataTableSQL(sql, "SubCategory");
            tbInfo = bs.GetDataTableSQL(sql2, "Info");
            StringBuilder menu = new StringBuilder();

            if (type == "1")
            {
                for (int i = 0; i < tbInfo.Rows.Count; i++)
                {
                    menu.Append("<div><a class=\"link-news\" href=\"/InfomationDetail.aspx?country=" + countryID + "&sub=" + catID + "&id=" + tbInfo.Rows[i][1].ToString() + "\">- " + tbInfo.Rows[i][0].ToString() + "</a></div>");
                }
            }
            else if (type=="2")
            {
                for (int i = 0; i < tbCat.Rows.Count; i++)
                {
                    menu.Append("<div><a class=\"link-news\" href=\"/Tour.aspx?country=" + countryID + "&sub=" + catID + "&cateid=" + tbCat.Rows[i][0].ToString() + " \">- " + tbCat.Rows[i][1].ToString() + "</a></div>");

                }
            }
            return menu.ToString();
        }
        private string TopMenuCategory(string countryID)
        {
            string sql = "SELECT t.TenDanhMuc, t.ID,t.TypeID FROM dbo.tblDanhMuc t  where t.ID in(Select l.maDanhmuc from tblTheLoai l where l.maquocgia=" + countryID + " group by l.MaDanhMuc)";
            clsBSDungChung bs = new clsBSDungChung();
            DataTable tbCat = new DataTable();
            tbCat = bs.GetDataTableSQL(sql, "Cate");
            StringBuilder menu = new StringBuilder();

            for (int i = 0; i < tbCat.Rows.Count; i++)
            {
                if (Convert.ToInt32(tbCat.Rows[i][2].ToString()) != 1)
                {
                    menu.Append("<div class=\"root\"><a class=\"link-news2\" href=\"/TourList.aspx?country=" + countryID + "&sub=" + tbCat.Rows[i][1].ToString() + "\" onclick=\"toggleNode(this.parentNode); return false;\">+ " + tbCat.Rows[i][0].ToString() + "</a>");
                }
                else
                {
                    menu.Append("<div class=\"root\"><a class=\"link-news2\" href=\"/Infomation.aspx?country=" + countryID + "&loaiid=" + tbCat.Rows[i][1].ToString() + "\" onclick=\"toggleNode(this.parentNode); return false;\">+ " + tbCat.Rows[i][0].ToString() + "</a>");
                }
                menu.Append(TopMenuSubCategory(countryID, tbCat.Rows[i][1].ToString(), tbCat.Rows[i][2].ToString()));

                menu.Append("</div>");
            }

            return menu.ToString();
        }
        private string SliderHotTours()
        {
            try
            {
                //
                string sql = "Select top 10 ID,TieuDe,Url from tblHinhAnh where tourid in (SELECT TOP 4 id FROM [tblTour] where hot=1) order by tourid";
                clsBSDungChung bs = new clsBSDungChung();
                DataTable tbImage = new DataTable();
                tbImage = bs.GetDataTableSQL(sql, "Cruises");
                StringBuilder menu = new StringBuilder();
                menu.Append("<div id=\"gallery\">");

                for (int i = 0; i < tbImage.Rows.Count; i++)
                {
                    if (i==0)
                    {
                        menu.Append("<a href=\"#\" class=\"show\">");
                    }
                    else
                    {
                        menu.Append("<a href=\"#\">");
                    }
                    menu.Append("<img src=\"images/Hinhanh/" + tbImage.Rows[i][2] + "\" alt=\"\" alt=\"\" title=\"\" width=\"950px\" height=\"440px\" rel=\"<h3></h3>" + tbImage.Rows[i][1] + "\"/></a>");

                }
                menu.Append("");
                menu.Append("</div> ");
                return menu.ToString();
            }
            catch
            {
                throw;
            }
        }
 private string TopMenuCountry()
 {
     string sqlQuocGia = "Select ID,TenQuocGia from tblQuocGia";
     clsBSDungChung bs = new clsBSDungChung();
     DataTable tbCountry = new DataTable();
     tbCountry = bs.GetDataTableSQL(sqlQuocGia, "QuocGia");
     StringBuilder menu = new StringBuilder();
     menu.Append("<ul class=\"sf-menu\">");
         menu.Append("<li class=\"current\">");
         menu.Append("<a class=\"link\" href=\"/Default.aspx\" style=\"font-weight:bold;\">HOME</a>");
         menu.Append("<ul>");
         menu.Append("</ul>");
         menu.Append("</li>");
     for (int i = 0; i < tbCountry.Rows.Count; i++)
     {
         menu.Append("<li class=\"current\">");
         menu.Append("<a href=\"/Default.aspx?country=" + tbCountry.Rows[i][0].ToString() + " \" style=\"font-weight:bold;\">" + tbCountry.Rows[i][1].ToString() + "</a>");
         menu.Append("<ul>");
         menu.Append(TopMenuCategory(tbCountry.Rows[i][0].ToString()));
         menu.Append("</ul>");
         menu.Append("</li>");
     }
     menu.Append("</ul>");
     return menu.ToString();
 }
 private string TopMenuCountry(string countryID)
 {
     string sqlQuocGia = "Select ID,TenQuocGia from tblQuocGia where ID="+countryID;
     clsBSDungChung bs = new clsBSDungChung();
     DataTable tbCountry = new DataTable();
     tbCountry = bs.GetDataTableSQL(sqlQuocGia, "QuocGia");
     return tbCountry.Rows[0][1].ToString().ToUpper();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["TL"]!=null)
     {
         string sqlQuocGia = "   Select tentheloai from tbltheloai where ID=" + Request.QueryString["TL"];
         clsBSDungChung bs = new clsBSDungChung();
         lblType.Text = bs.GetDataTableSQL(sqlQuocGia, "tblNews").Rows[0]["TenTheLoai"].ToString();
     }
 }
        private string TopMenuTravel()
        {
            string sqlQuocGia = "Select * from tblCateNew where id<>1";
             clsBSDungChung bs = new clsBSDungChung();
             DataTable tbCountry = new DataTable();
             tbCountry = bs.GetDataTableSQL(sqlQuocGia, "tblNews2");
             StringBuilder menu = new StringBuilder();
             for (int i = 0; i < tbCountry.Rows.Count; i++)
             {
                 menu.Append("<li><a href=\"News.aspx?cateid=" + tbCountry.Rows[i]["ID"] + "\">" + tbCountry.Rows[i]["TieuDe"] + "</a></li>");
             }

             return menu.ToString();
        }
Пример #8
0
        private string TopMenuCountry()
        {
            string sqlQuocGia = "Select ID,TenQuocGia from tblQuocGia";
            clsBSDungChung bs = new clsBSDungChung();
            DataTable tbCountry = new DataTable();
            tbCountry = bs.GetDataTableSQL(sqlQuocGia, "QuocGia");
            StringBuilder menu = new StringBuilder();
               for (int i = 0; i < tbCountry.Rows.Count; i++)
            {
                menu.Append("<li><a href=\"?country=" + tbCountry.Rows[i][0].ToString() + "\">" + tbCountry.Rows[i][1].ToString() + "</a>");
                menu.Append(TopMenuCategory(tbCountry.Rows[i][0].ToString()));
                menu.Append("</li>");
            }

            return menu.ToString();
        }
        private string TopMenu(string type)
        {
            string sqlQuocGia = " Select ID,TieuDe from tblNews Where typeID="+type;
            clsBSDungChung bs = new clsBSDungChung();
            DataTable tbCountry = new DataTable();
            tbCountry = bs.GetDataTableSQL(sqlQuocGia, "tblNews");
            StringBuilder menu = new StringBuilder();
            for (int i = 0; i < tbCountry.Rows.Count; i++)
            {
                if(type=="5")
                    menu.Append("<li><a href=\"HalongBayDetail.aspx?ID=" + tbCountry.Rows[i]["ID"] + "\">" + tbCountry.Rows[i]["TieuDe"] + "</a></li>");
                if (type == "6")
                    menu.Append("<li><a href=\"HalongHotelDetail.aspx?ID=" + tbCountry.Rows[i]["ID"] + "\">" + tbCountry.Rows[i]["TieuDe"] + "</a></li>");

            }

            return menu.ToString();
        }
 private string SliderCruises()
 {
     try
     {
         string sql = "Select ID,TieuDe,Url from tblHinhAnh where Loai=3";
         clsBSDungChung bs = new clsBSDungChung();
         DataTable tbCruises = new DataTable();
         tbCruises = bs.GetDataTableSQL(sql, "Cruises");
         StringBuilder menu = new StringBuilder();
         menu.Append("<ul id=\"mycarousel\" class=\"jcarousel-skin-tango\"> ");
         for (int i = 0; i < tbCruises.Rows.Count; i++)
         {
             menu.Append("<li class=\"jcarousel-item\"><a href=\"http://www.halongsagatravel.com/\"><img src=\"Images/HinhAnh/" + tbCruises.Rows[i][2] + "\" alt=\"\" /></a></li>");
         }
         menu.Append("</ul> ");
         return menu.ToString();
     }
     catch
     {
         throw;
     }
 }
Пример #11
0
        private string TopMenuCategory(string countryID)
        {
            string sql = "SELECT t.TenDanhMuc, t.ID FROM dbo.tblDanhMuc t  where t.ID in(Select l.maDanhmuc from tblTheLoai l where l.maquocgia="+countryID+" group by l.MaDanhMuc)";
            clsBSDungChung bs = new clsBSDungChung();
            DataTable tbCat = new DataTable();
            tbCat = bs.GetDataTableSQL(sql, "Cate");
            StringBuilder menu = new StringBuilder();
            if (tbCat.Rows.Count>0)
            {
                menu.Append("<span>");
            }

            for (int i = 0; i < tbCat.Rows.Count; i++)
            {
                if (Convert.ToInt32(tbCat.Rows[i][1].ToString())!=1)
                menu.Append("<a href=\"/Tour.aspx?country="+countryID+"&cateid=" + tbCat.Rows[i][1].ToString() + "\">" + tbCat.Rows[i][0].ToString() + "</a>");
            }
            if (tbCat.Rows.Count > 0)
            {
                menu.Append("</span>");
            }
            return menu.ToString();
        }
Пример #12
0
        protected void btnEditT_Click(object sender, EventArgs e)
        {
            mtvTour.ActiveViewIndex = 2;
            LinkButton lbt = (LinkButton)sender;
            HiddenField h = (HiddenField)lbt.FindControl("hfID");
            hfID.Value = h.Value;
            clsBSDungChung c = new clsBSDungChung();
            string sql = "Select t.*,case when t.hot is NULL THEN 0  when t.Hot=0 then 0 else 1 END AS Hot2 from tblTour t where t.ID=" + h.Value;
            DataTable tb = c.GetDataTableSQL(sql, "TheLoai");
            cbxTheLoaiEdit.SelectedValue = tb.Rows[0]["TheLoaiID"].ToString();
            txtTieuDeEdit.Text = tb.Rows[0]["TieuDe"].ToString();
            txtViTriEdit.Text = tb.Rows[0]["STT"].ToString();
            hfImage.Value = tb.Rows[0]["HinhAnh"].ToString();
            if (tb.Rows[0]["HinhAnh"].ToString() == "")
            {
                imageTour.Visible = false;

            }
            else {
                imageTour.Visible = true;
                imageTour.ImageUrl = "~/Images/HinhAnh/" + tb.Rows[0]["HinhAnh"].ToString();
            }
            if (tb.Rows[0]["Hot2"].ToString() == "0")
            {
                ckbHotEdit.Checked = false;
            }
            else
            {
                ckbHotEdit.Checked = true;
            }
            fileUploadEdit.Visible = false;
            btnIGM.Visible = true;
            cbxS.SelectedValue = tb.Rows[0]["SearchID"].ToString();
            txtGhiChuEdit.Text = tb.Rows[0]["GhiChu"].ToString();
        }
        protected void btnSua_Click(object sender, EventArgs e)
        {
            mtvTheLoai.ActiveViewIndex = 2;
            LinkButton lbt = (LinkButton)sender;
            HiddenField h = (HiddenField)lbt.FindControl("hfID");
            hfID.Value = h.Value;
            clsBSDungChung c = new clsBSDungChung();
            string sql = "Select t.*,case when t.hot is NULL THEN 0  when t.Hot=0 then 0 else 1 END AS Hot2 from tblTheLoai t where t.ID=" + h.Value;
            DataTable tb = c.GetDataTableSQL(sql,"TheLoai");
            txtNameEdit.Text = tb.Rows[0]["TenTheLoai"].ToString();
            txtViTriEdit.Text = tb.Rows[0]["STT"].ToString();
            if (tb.Rows[0]["Hot2"].ToString()=="0")
            {
                ckbHotEdit.Checked = false;
            }
            else
            {
                ckbHotEdit.Checked = true;
            }

            txtMotaEdit.Text = tb.Rows[0]["Mota"].ToString();
        }