private void BindGrid() { grdBrands.DataSource = ApartmentService.ApartmentInfo_GetByAll(Lang); grdBrands.DataBind(); if (grdBrands.PageCount <= 1) { grdBrands.PagerStyle.Visible = false; } else { grdBrands.PagerStyle.Visible = true; } }
private void LoadSaleApartments() { string chuoi = ""; List <ApartmentInfo> listApartmentInfos = new List <ApartmentInfo>(); listApartmentInfos = ApartmentService.ApartmentInfo_GetByAll("vi"); if (listApartmentInfos.Count > 0) { for (int i = 0; i < listApartmentInfos.Count; i++) { chuoi += "<div class=\" row \" style=\"line-height: 25px;\">"; chuoi += "<h3><span style=\" color: blue;\"> <a href = \" Default2.aspx?mod=" + listApartmentInfos[i].Tag + "\">" + listApartmentInfos[i].Title + "</a> </span></h3>"; //cột trái chuoi += "<div class=\"span3\">"; chuoi += "<img src=\"" + listApartmentInfos[i].Image1 + "\" />"; chuoi += "</div>"; //cột phải chuoi += "<div class=\"span6\">"; chuoi += "<p>" + listApartmentInfos[i].Description + "</p>"; chuoi += "<p>" + "Giá: " + "<span style=\"color: red; font-weight:bold;\">" + listApartmentInfos[0].Price + "</span>" + " VND" + " | " + "Tổng diện tích: " + "<span style=\"color: red; font-weight:bold;\">" + listApartmentInfos[0].TotalArea + "</span>" + " | " + "Diện tích nhà: " + "<span style=\"color: red; font-weight:bold;\">" + listApartmentInfos[0].FloorArea + "</span>" + " | " + "Số phòng ngủ: " + "<span style=\"color: red; font-weight:bold;\">" + listApartmentInfos[0].BedroomNumber + "</span>" + "</p>"; chuoi += "<p>" + "<table><tr><td width=\"60%\">Địa chỉ: " + "<span style=\"color: blue; font-weight:bold;\">" + listApartmentInfos[i].Address + "</span>" + "</td><td width=\"40%\">Người đăng: " + "<span style=\"color: blue; font-weight:bold;\">" + listApartmentInfos[i].CreateBy + "</span>" + "</td></tr></table></p>"; chuoi += "</div>"; chuoi += "</div>"; //chuoi += "<hr style=\" border: 1px solid grey;\">"; } } else { chuoi += "<p>" + "Không có dữ liều nào để hiển thị </p>"; } ltrTab1.Text = chuoi; //ltrTab2.Text = chuoi; listApartmentInfos.Clear(); }
private void LoadHome() { string chuoi = ""; List <ApartmentInfo> listApartmentInfos = new List <ApartmentInfo>(); listApartmentInfos = ApartmentService.ApartmentInfo_GetByAll("vi"); if (listApartmentInfos.Count > 0) { for (int i = 0; i < listApartmentInfos.Count; i++) { chuoi += "<div class=\" row \" style=\" margin-left: 10px; line-height: 20px;\">"; chuoi += "<h3 style=\" color: blue;\"> <a href = \" Default2.aspx?mod=" + listApartmentInfos[i].Tag + "\" style=\" color: olive;\">" + listApartmentInfos[i].Title + "</a> </h3>"; //cột trái chuoi += "<div class=\"span1\" style=\" width: 135px;\">"; chuoi += "<a href=\" " + listApartmentInfos[i].Tag + " \" alt=\" Xem chi tiết \"><img src=\"" + listApartmentInfos[i].Image1 + "\"/></a>"; chuoi += "</div>"; //cột phải chuoi += "<div class=\"span5\">"; chuoi += "<p ><span style=\" color: green;\" >" + listApartmentInfos[i].Description + "</span></p>"; chuoi += "<p>" + "Giá: " + "<span style=\"color: red;\">" + listApartmentInfos[0].Price + "</span>" + " VND" + " | " + "Tổng diện tích: " + "<span style=\"color: red;\">" + listApartmentInfos[0].TotalArea + "</span>" + " | " + "Diện tích nhà: " + "<span style=\"color: red;\">" + listApartmentInfos[0].FloorArea + "</span>" + " | " + "Số phòng ngủ: " + "<span style=\"color: red; font-weight:bold;\">" + listApartmentInfos[0].BedroomNumber + "</span>" + "</p>"; chuoi += "<p>" + "<table><tr><td width=\"50%\">Địa chỉ: " + "<span style=\"color: blue;\">" + listApartmentInfos[i].Address + "</span>" + "</td><td width=\"50%\">Người đăng: " + "<span style=\"color: blue; \">" + listApartmentInfos[i].CreateBy + "</span>" + "</td></tr></table></p>"; chuoi += "</div>"; chuoi += "<hr style=\" margin-left: 9px; width: 99%; color: grey\">"; chuoi += "</div>"; } } else { chuoi += "<p>" + "Không có dữ liều nào để hiển thị </p>"; } ltrTab1.Text = chuoi; listApartmentInfos.Clear(); }