Exemplo n.º 1
0
        protected void ddl_hsx2_SelectedIndexChanged(object sender, EventArgs e)
        {
            WSSDT.WSSDT dthoai = new WSSDT.WSSDT();
            DataSet     ds     = new DataSet();
            string      idHSX  = ddl_hsx2.SelectedValue.ToString();
            string      sql    = "SELECT idDT, TenDT FROM DIENTHOAI WHERE ANHIEN=1 AND idHSX=" + idHSX;

            //string sql = "SELECT idDT, TenDT FROM DIENTHOAI";
            ds = dthoai.SelectQuery(sql);

            DataTable dt = new DataTable();

            dt = ds.Tables[0];

            ListItem item;

            ddl_dt2.Items.Clear();
            item       = new ListItem();
            item.Value = "0";
            item.Value = "-----Chọn Model-----";
            ddl_dt2.Items.Add(item);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                item       = new ListItem();
                item.Value = dt.Rows[i]["idDT"].ToString();
                item.Text  = dt.Rows[i]["TenDT"].ToString();
                ddl_dt2.Items.Add(item);
            }
        }
Exemplo n.º 2
0
        public void ShowDienThoaiTrungCap()
        {
            WSSDT.WSSDT dtsc = new WSSDT.WSSDT();
            DataSet ds = new DataSet();
            ds = dtsc.SelectQuery("SELECT TOP 8 idDT, TenDT, TenHSX, Gia, HinhAnh FROM DIENTHOAI dt, HANGSANXUAT hsx WHERE dt.idHSX = hsx.idHSX AND dt.AnHien = 1 AND Gia < 7000000 AND Gia >= 4000000");

            DienThoaiTrungCap.DataSource = ds;
            DienThoaiTrungCap.DataBind();
        }
Exemplo n.º 3
0
        public void ShowDienThoaiMoi()
        {
            WSSDT.WSSDT dtm = new WSSDT.WSSDT();
            DataSet ds = new DataSet();
            ds = dtm.SelectQuery("SELECT TOP 8 idDT, TenDT, TenHSX, Gia, HinhAnh FROM DIENTHOAI dt, HANGSANXUAT hsx WHERE dt.idHSX = hsx.idHSX AND dt.AnHien = 1");

            DienThoaiMoiXuatHien.DataSource = ds;
            DienThoaiMoiXuatHien.DataBind();
        }
Exemplo n.º 4
0
        public void ShowDienThoaiMoi()
        {
            WSSDT.WSSDT dtm = new WSSDT.WSSDT();
            DataSet     ds  = new DataSet();

            ds = dtm.SelectQuery("SELECT TOP 8 idDT, TenDT, TenHSX, Gia, HinhAnh FROM DIENTHOAI dt, HANGSANXUAT hsx WHERE dt.idHSX = hsx.idHSX AND dt.AnHien = 1");

            DienThoaiMoiXuatHien.DataSource = ds;
            DienThoaiMoiXuatHien.DataBind();
        }
Exemplo n.º 5
0
        public void ShowDienThoaiThongDung()
        {
            WSSDT.WSSDT dtsc = new WSSDT.WSSDT();
            DataSet     ds   = new DataSet();

            ds = dtsc.SelectQuery("SELECT TOP 8 idDT, TenDT, TenHSX, Gia, HinhAnh FROM DIENTHOAI dt, HANGSANXUAT hsx WHERE dt.idHSX = hsx.idHSX AND dt.AnHien = 1 AND Gia < 4000000");

            DienThoaiThongDung.DataSource = ds;
            DienThoaiThongDung.DataBind();
        }
Exemplo n.º 6
0
        public void ShowTitleTenHSX()
        {
            string idHSX = Request.QueryString["idHSX"].ToString();

            WSSDT.WSSDT dthsx = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            string sql = "SELECT TenHSX FROM HANGSANXUAT WHERE idHSX = " + idHSX ;
            ds = dthsx.SelectQuery(sql);

            TitleTenHSX.DataSource = ds;
            TitleTenHSX.DataBind();
        }
Exemplo n.º 7
0
        public void ShowTitleTenHSX()
        {
            string idHSX = Request.QueryString["idHSX"].ToString();

            WSSDT.WSSDT dthsx = new WSSDT.WSSDT();
            DataSet     ds    = new DataSet();

            string sql = "SELECT TenHSX FROM HANGSANXUAT WHERE idHSX = " + idHSX;

            ds = dthsx.SelectQuery(sql);

            TitleTenHSX.DataSource = ds;
            TitleTenHSX.DataBind();
        }
Exemplo n.º 8
0
        public void ShowDienThoaiTheoHSX()
        {
            string idHSX = Request.QueryString["idHSX"].ToString() ;
            if (idHSX == "")
            {
                idHSX = "4";
            }

            WSSDT.WSSDT dthsx = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            string sql = "SELECT TOP 10 idDT, TenDT, TenHSX, Gia, HinhAnh, MoTa FROM DIENTHOAI DT, HANGSANXUAT HSX WHERE DT.idHSX = HSX.idHSX AND DT.idHSX = " + idHSX + " AND DT.AnHien = 1";
            ds = dthsx.SelectQuery(sql);

            DienThoaiTheoHSX.DataSource = ds;
            DienThoaiTheoHSX.DataBind();
        }
        public void ShowThongTinChiTiet()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtct = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            string sql = "";
            sql = "SELECT BaiViet ";
            sql += "FROM THONGTINCHITIET ";
            sql += "WHERE idDT = " + idDT;

            //Response.Write(sql);
            ds = dtct.SelectQuery(sql);

            ThongTinChiTiet.DataSource = ds;
            ThongTinChiTiet.DataBind();
        }
        public void ShowDienThoaiChiTiet()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtct = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            string sql="";
            sql  = "SELECT idDT, TenDT, TenHSX, Gia, HinhAnh, MoTa, PhuKien, BaoHanh, KhuyenMai, NgayCapNhat ";
            sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
            sql += "WHERE DT.idHSX = HSX.idHSX AND DT.idDT = " + idDT;

            //Response.Write(sql);
            ds = dtct.SelectQuery(sql);

            DienThoaiChiTiet.DataSource = ds;
            DienThoaiChiTiet.DataBind();
        }
        public void ShowTinhNangDienThoai()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtct = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            string sql = "";
            sql = "SELECT * ";
            sql += "FROM TINHNANGDIENTHOAI ";
            sql += "WHERE idDT = " + idDT;

            //Response.Write(sql);
            ds = dtct.SelectQuery(sql);

            TinhNangDienThoai.DataSource = ds;
            TinhNangDienThoai.DataBind();
        }
        public void ShowDienThoaiChiTiet()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtct = new WSSDT.WSSDT();
            DataSet     ds   = new DataSet();

            string sql = "";

            sql  = "SELECT idDT, TenDT, TenHSX, Gia, HinhAnh, MoTa, PhuKien, BaoHanh, KhuyenMai, NgayCapNhat ";
            sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
            sql += "WHERE DT.idHSX = HSX.idHSX AND DT.idDT = " + idDT;

            //Response.Write(sql);
            ds = dtct.SelectQuery(sql);

            DienThoaiChiTiet.DataSource = ds;
            DienThoaiChiTiet.DataBind();
        }
        public void ShowThongTinChiTiet()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtct = new WSSDT.WSSDT();
            DataSet     ds   = new DataSet();

            string sql = "";

            sql  = "SELECT BaiViet ";
            sql += "FROM THONGTINCHITIET ";
            sql += "WHERE idDT = " + idDT;

            //Response.Write(sql);
            ds = dtct.SelectQuery(sql);

            ThongTinChiTiet.DataSource = ds;
            ThongTinChiTiet.DataBind();
        }
        public void ShowTinhNangDienThoai()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtct = new WSSDT.WSSDT();
            DataSet     ds   = new DataSet();

            string sql = "";

            sql  = "SELECT * ";
            sql += "FROM TINHNANGDIENTHOAI ";
            sql += "WHERE idDT = " + idDT;

            //Response.Write(sql);
            ds = dtct.SelectQuery(sql);

            TinhNangDienThoai.DataSource = ds;
            TinhNangDienThoai.DataBind();
        }
        public void ShowDienThoaiDongGia()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtdg = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            string sql = "";

            sql  = "SELECT idDT, TenDT, Gia ";
            sql += "FROM DIENTHOAI ";
            sql += "WHERE Gia >= ((SELECT Gia FROM DIENTHOAI WHERE idDT = " + idDT + ") - 1000000) ";
            sql += "AND Gia <= ((SELECT Gia FROM DIENTHOAI WHERE idDT = " + idDT + ") + 1000000)";

            //Response.Write(sql);
            ds = dtdg.SelectQuery(sql);

            DienThoaiDongGia.DataSource = ds;
            DienThoaiDongGia.DataBind();
        }
        public void ShowDienThoaiDongGia()
        {
            string idDT = Request.QueryString["idDT"].ToString();

            WSSDT.WSSDT dtdg = new WSSDT.WSSDT();
            DataSet     ds   = new DataSet();

            string sql = "";

            sql  = "SELECT idDT, TenDT, Gia ";
            sql += "FROM DIENTHOAI ";
            sql += "WHERE Gia >= ((SELECT Gia FROM DIENTHOAI WHERE idDT = " + idDT + ") - 1000000) ";
            sql += "AND Gia <= ((SELECT Gia FROM DIENTHOAI WHERE idDT = " + idDT + ") + 1000000)";

            //Response.Write(sql);
            ds = dtdg.SelectQuery(sql);

            DienThoaiDongGia.DataSource = ds;
            DienThoaiDongGia.DataBind();
        }
Exemplo n.º 17
0
        public void ShowDienThoaiTheoHSX()
        {
            string idHSX = Request.QueryString["idHSX"].ToString();

            if (idHSX == "")
            {
                idHSX = "4";
            }


            WSSDT.WSSDT dthsx = new WSSDT.WSSDT();
            DataSet     ds    = new DataSet();

            string sql = "SELECT TOP 10 idDT, TenDT, TenHSX, Gia, HinhAnh, MoTa FROM DIENTHOAI DT, HANGSANXUAT HSX WHERE DT.idHSX = HSX.idHSX AND DT.idHSX = " + idHSX + " AND DT.AnHien = 1";

            ds = dthsx.SelectQuery(sql);

            DienThoaiTheoHSX.DataSource = ds;
            DienThoaiTheoHSX.DataBind();
        }
        public void ShowHSX()
        {
            WSSDT.WSSDT hsxss = new WSSDT.WSSDT();

            DataSet ds = new DataSet();
            ds = hsxss.SelectQuery("SELECT idHSX, TenHSX FROM HANGSANXUAT WHERE ANHIEN=1");

            DataTable dt = new DataTable();
            dt = ds.Tables[0];

            ListItem item;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                item = new ListItem();
                item.Value = dt.Rows[i]["idHSX"].ToString();
                item.Text = dt.Rows[i]["TenHSX"].ToString();
                ddl_hsx1.Items.Add(item);
                ddl_hsx2.Items.Add(item);
                ddl_hsx3.Items.Add(item);
            }
        }
Exemplo n.º 19
0
        public void ShowHSX()
        {
            WSSDT.WSSDT hsxss = new WSSDT.WSSDT();

            DataSet ds = new DataSet();

            ds = hsxss.SelectQuery("SELECT idHSX, TenHSX FROM HANGSANXUAT WHERE ANHIEN=1");

            DataTable dt = new DataTable();

            dt = ds.Tables[0];

            ListItem item;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                item       = new ListItem();
                item.Value = dt.Rows[i]["idHSX"].ToString();
                item.Text  = dt.Rows[i]["TenHSX"].ToString();
                ddl_hsx1.Items.Add(item);
                ddl_hsx2.Items.Add(item);
                ddl_hsx3.Items.Add(item);
            }
        }
Exemplo n.º 20
0
        public void ShowSoSanhDienThoai3()
        {
            string idDT3 = ddl_dt3.SelectedValue.ToString();

            WSSDT.WSSDT ssdt = new WSSDT.WSSDT();
            DataSet     ds   = new DataSet();

            string sql = "";

            sql  = "SELECT DT.idDT, TenHSX, TenDT, Gia, HinhAnh, Mang2G, Mang3G, Sim, KichThuoc, TrongLuong, ";
            sql += "MauSac, LoaimanHinh, KichThuocManHinh, Audio, Video, Radio, KieuChuong, ";
            sql += "LoaNgoai, BoNhoTrong, TheNho, Wlan, GPRS, HSPDA, Bluetooth, USB, GPS, Jack35, ";
            sql += "CameraChinh, ChucNang, CameraPhu, QuayPhim, TinNhan, TrinhDuyet, HeDieuHanh, ";
            sql += "CPU, Chipset, GPU, JAVA, TroChoi, LoaiPin, ThoiGianCho, ThoiGianHoatDong, Khac ";
            sql += "FROM DIENTHOAI dt, HANGSANXUAT hsx, TINHNANGDIENTHOAI tndt ";
            sql += "WHERE dt.idHSX = hsx.idHSX AND dt.idDT = tndt.idDT AND DT.idDT = " + idDT3;

            //Response.Write(sql);
            ds = ssdt.SelectQuery(sql);

            DataTable dt = new DataTable();

            dt = ds.Tables[0];

            ltr_TenDT3.Text            = dt.Rows[0]["TenDT"].ToString();
            img_HinhAnh3.ImageUrl      = "images/" + dt.Rows[0]["TenHSX"] + "/" + dt.Rows[0]["HinhAnh"];
            ltr_Gia3.Text              = dt.Rows[0]["Gia"].ToString() + "VNĐ";
            ltr_Mang2G3.Text           = dt.Rows[0]["Mang2G"].ToString();
            ltr_Mang3G3.Text           = dt.Rows[0]["Mang3G"].ToString();
            ltr_Sim3.Text              = dt.Rows[0]["Sim"].ToString();
            ltr_KichThuoc3.Text        = dt.Rows[0]["KichThuoc"].ToString();
            ltr_TrongLuong3.Text       = dt.Rows[0]["TrongLuong"].ToString();
            ltr_MauSac3.Text           = dt.Rows[0]["MauSac"].ToString();
            ltr_LoaiManHinh3.Text      = dt.Rows[0]["LoaiManHinh"].ToString();
            ltr_KichThuocManHinh3.Text = dt.Rows[0]["KichThuocManHinh"].ToString();
            ltr_Audio3.Text            = dt.Rows[0]["Audio"].ToString();
            ltr_Video3.Text            = dt.Rows[0]["Video"].ToString();
            ltr_Radio3.Text            = dt.Rows[0]["Radio"].ToString();
            ltr_KieuChuong3.Text       = dt.Rows[0]["KieuChuong"].ToString();
            ltr_LoaNgoai3.Text         = dt.Rows[0]["LoaNgoai"].ToString();
            ltr_BoNhoTrong3.Text       = dt.Rows[0]["BoNhoTrong"].ToString();
            ltr_TheNho3.Text           = dt.Rows[0]["TheNho"].ToString();
            ltr_Wlan3.Text             = dt.Rows[0]["Wlan"].ToString();
            ltr_GPRS3.Text             = dt.Rows[0]["GPRS"].ToString();
            ltr_HSPDA3.Text            = dt.Rows[0]["HSPDA"].ToString();
            ltr_Bluetooth3.Text        = dt.Rows[0]["Bluetooth"].ToString();
            ltr_USB3.Text              = dt.Rows[0]["USB"].ToString();
            ltr_GPS3.Text              = dt.Rows[0]["GPS"].ToString();
            ltr_Jack353.Text           = dt.Rows[0]["Jack35"].ToString();
            ltr_CameraChinh3.Text      = dt.Rows[0]["CameraChinh"].ToString();
            ltr_ChucNang3.Text         = dt.Rows[0]["ChucNang"].ToString();
            ltr_CameraPhu3.Text        = dt.Rows[0]["CameraPhu"].ToString();
            ltr_QuayPhim3.Text         = dt.Rows[0]["QuayPhim"].ToString();
            ltr_TinNhan3.Text          = dt.Rows[0]["TinNhan"].ToString();
            ltr_TrinhDuyet3.Text       = dt.Rows[0]["TrinhDuyet"].ToString();
            ltr_HeDieuHanh3.Text       = dt.Rows[0]["HeDieuHanh"].ToString();
            ltr_CPU3.Text              = dt.Rows[0]["CPU"].ToString();
            ltr_Chipset3.Text          = dt.Rows[0]["Chipset"].ToString();
            ltr_GPU3.Text              = dt.Rows[0]["GPU"].ToString();
            ltr_JAVA3.Text             = dt.Rows[0]["JAVA"].ToString();
            ltr_TroChoi3.Text          = dt.Rows[0]["TroChoi"].ToString();
            ltr_LoaiPin3.Text          = dt.Rows[0]["LoaiPin"].ToString();
            ltr_ThoiGianCho3.Text      = dt.Rows[0]["ThoiGianCho"].ToString();
            ltr_ThoiGianHoatDong3.Text = dt.Rows[0]["ThoiGianHoatDong"].ToString();
            ltr_Khac3.Text             = dt.Rows[0]["Khac"].ToString();
        }
Exemplo n.º 21
0
        public void ShowTimKiemDienThoai()
        {
            string idhsx   = Request.QueryString["idhsx"].ToString();
            string keyword = Request.QueryString["keyword"].ToString();
            string price1  = Request.QueryString["price1"].ToString();
            string price2  = Request.QueryString["price2"].ToString();
            string sql     = "";

            if (idhsx == "0")
            {
                if (keyword != "" && price1 == "-1" && price2 == "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 == "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 == "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 == "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 == "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
            }
            else
            {
                if (keyword != "" && price1 == "-1" && price2 == "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 == "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 == "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 == "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 == "-1" && price2 != "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 == "-1" && price2 == "-1")
                {
                    sql  = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
            }

            WSSDT.WSSDT search = new WSSDT.WSSDT();
            DataSet     ds     = new DataSet();


            //Response.Write(sql);

            ds = search.SelectQuery(sql);

            TimKiemDienThoai.DataSource = ds;
            TimKiemDienThoai.DataBind();
        }
        protected void ddl_hsx3_SelectedIndexChanged(object sender, EventArgs e)
        {
            WSSDT.WSSDT dthoai = new WSSDT.WSSDT();
            DataSet ds = new DataSet();
            string idHSX = ddl_hsx3.SelectedValue.ToString();
            string sql = "SELECT idDT, TenDT FROM DIENTHOAI WHERE ANHIEN=1 AND idHSX=" + idHSX;
            //string sql = "SELECT idDT, TenDT FROM DIENTHOAI";
            ds = dthoai.SelectQuery(sql);

            DataTable dt = new DataTable();
            dt = ds.Tables[0];

            ListItem item;
            ddl_dt3.Items.Clear();
            item = new ListItem();
            item.Value = "0";
            item.Value = "-----Chọn Model-----";
            ddl_dt3.Items.Add(item);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                item = new ListItem();
                item.Value = dt.Rows[i]["idDT"].ToString();
                item.Text = dt.Rows[i]["TenDT"].ToString();
                ddl_dt3.Items.Add(item);
            }
        }
        public void ShowSoSanhDienThoai1(string idDT1)
        {
            if (idDT1 == "0")
            {
                return;
            }

            WSSDT.WSSDT ssdt = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            string sql = "";
            sql = "SELECT DT.idDT, TenHSX, TenDT, Gia, HinhAnh, Mang2G, Mang3G, Sim, KichThuoc, TrongLuong, ";
            sql += "MauSac, LoaimanHinh, KichThuocManHinh, Audio, Video, Radio, KieuChuong, ";
            sql += "LoaNgoai, BoNhoTrong, TheNho, Wlan, GPRS, HSPDA, Bluetooth, USB, GPS, Jack35, ";
            sql += "CameraChinh, ChucNang, CameraPhu, QuayPhim, TinNhan, TrinhDuyet, HeDieuHanh, ";
            sql += "CPU, Chipset, GPU, JAVA, TroChoi, LoaiPin, ThoiGianCho, ThoiGianHoatDong, Khac ";
            sql += "FROM DIENTHOAI dt, HANGSANXUAT hsx, TINHNANGDIENTHOAI tndt ";
            sql += "WHERE dt.idHSX = hsx.idHSX AND dt.idDT = tndt.idDT AND DT.idDT = " + idDT1;

            //Response.Write(sql);
            ds = ssdt.SelectQuery(sql);

            DataTable dt = new DataTable();
            dt = ds.Tables[0];

            ltr_TenDT1.Text = dt.Rows[0]["TenDT"].ToString();
            img_HinhAnh1.ImageUrl = "images/" + dt.Rows[0]["TenHSX"] + "/" + dt.Rows[0]["HinhAnh"];
            ltr_Gia1.Text = dt.Rows[0]["Gia"].ToString() + "VNĐ";
            ltr_Mang2G1.Text = dt.Rows[0]["Mang2G"].ToString();
            ltr_Mang3G1.Text = dt.Rows[0]["Mang3G"].ToString();
            ltr_Sim1.Text = dt.Rows[0]["Sim"].ToString();
            ltr_KichThuoc1.Text = dt.Rows[0]["KichThuoc"].ToString();
            ltr_TrongLuong1.Text = dt.Rows[0]["TrongLuong"].ToString();
            ltr_MauSac1.Text = dt.Rows[0]["MauSac"].ToString();
            ltr_LoaiManHinh1.Text = dt.Rows[0]["LoaiManHinh"].ToString();
            ltr_KichThuocManHinh1.Text = dt.Rows[0]["KichThuocManHinh"].ToString();
            ltr_Audio1.Text = dt.Rows[0]["Audio"].ToString();
            ltr_Video1.Text = dt.Rows[0]["Video"].ToString();
            ltr_Radio1.Text = dt.Rows[0]["Radio"].ToString();
            ltr_KieuChuong1.Text = dt.Rows[0]["KieuChuong"].ToString();
            ltr_LoaNgoai1.Text = dt.Rows[0]["LoaNgoai"].ToString();
            ltr_BoNhoTrong1.Text = dt.Rows[0]["BoNhoTrong"].ToString();
            ltr_TheNho1.Text = dt.Rows[0]["TheNho"].ToString();
            ltr_Wlan1.Text = dt.Rows[0]["Wlan"].ToString();
            ltr_GPRS1.Text = dt.Rows[0]["GPRS"].ToString();
            ltr_HSPDA1.Text = dt.Rows[0]["HSPDA"].ToString();
            ltr_Bluetooth1.Text = dt.Rows[0]["Bluetooth"].ToString();
            ltr_USB1.Text = dt.Rows[0]["USB"].ToString();
            ltr_GPS1.Text = dt.Rows[0]["GPS"].ToString();
            ltr_Jack351.Text = dt.Rows[0]["Jack35"].ToString();
            ltr_CameraChinh1.Text = dt.Rows[0]["CameraChinh"].ToString();
            ltr_ChucNang1.Text = dt.Rows[0]["ChucNang"].ToString();
            ltr_CameraPhu1.Text = dt.Rows[0]["CameraPhu"].ToString();
            ltr_QuayPhim1.Text = dt.Rows[0]["QuayPhim"].ToString();
            ltr_TinNhan1.Text = dt.Rows[0]["TinNhan"].ToString();
            ltr_TrinhDuyet1.Text = dt.Rows[0]["TrinhDuyet"].ToString();
            ltr_HeDieuHanh1.Text = dt.Rows[0]["HeDieuHanh"].ToString();
            ltr_CPU1.Text = dt.Rows[0]["CPU"].ToString();
            ltr_Chipset1.Text = dt.Rows[0]["Chipset"].ToString();
            ltr_GPU1.Text = dt.Rows[0]["GPU"].ToString();
            ltr_JAVA1.Text = dt.Rows[0]["JAVA"].ToString();
            ltr_TroChoi1.Text = dt.Rows[0]["TroChoi"].ToString();
            ltr_LoaiPin1.Text = dt.Rows[0]["LoaiPin"].ToString();
            ltr_ThoiGianCho1.Text = dt.Rows[0]["ThoiGianCho"].ToString();
            ltr_ThoiGianHoatDong1.Text = dt.Rows[0]["ThoiGianHoatDong"].ToString();
            ltr_Khac1.Text = dt.Rows[0]["Khac"].ToString();
        }
Exemplo n.º 24
0
        public void ShowTimKiemDienThoai()
        {
            string idhsx = Request.QueryString["idhsx"].ToString();
            string keyword = Request.QueryString["keyword"].ToString();
            string price1 = Request.QueryString["price1"].ToString();
            string price2 = Request.QueryString["price2"].ToString();
            string sql = "";
            if (idhsx == "0")
            {
                if (keyword != "" && price1 == "-1" && price2 == "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 == "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 == "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 == "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 == "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "ORDER BY Gia";
                }
            }
            else
            {
                if (keyword != "" && price1 == "-1" && price2 == "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 != "-1" && price2 == "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword != "" && price1 == "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND TenDT LIKE '%" + keyword + "%' ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 != "-1" && price2 == "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia >= '" + price1 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 == "-1" && price2 != "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND Gia <= '" + price2 + "' ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
                if (keyword == "" && price1 == "-1" && price2 == "-1")
                {
                    sql = "SELECT idDT, TenDT, TenHSX, HinhAnh, Gia, MoTa ";
                    sql += "FROM DIENTHOAI DT, HANGSANXUAT HSX ";
                    sql += "WHERE DT.idHSX = HSX.idHSX ";
                    sql += "AND DT.idHSX = '" + idhsx + "' ";
                    sql += "ORDER BY Gia";
                }
            }

            WSSDT.WSSDT search = new WSSDT.WSSDT();
            DataSet ds = new DataSet();

            //Response.Write(sql);

            ds = search.SelectQuery(sql);

            TimKiemDienThoai.DataSource = ds;
            TimKiemDienThoai.DataBind();
        }