private void LayDanhSachLoaiPhong()
    {
        string s   = "";
        string iid = "";

        if (Request["iid"] != null)
        {
            iid = StringExtension.RemoveSqlInjectionChars(Request["iid"]);
        }

        string condition = DataExtension.AndConditon(
            SubitemsTSql.GetSubitemsByVskey(app),
            SubitemsTSql.GetSubitemsByIid(iid),
            SubitemsTSql.GetSubitemsByVslang(lang),
            SubitemsColumns.IsenableColumn + "<>2"
            );
        string    order = SubitemsColumns.isOrder;
        DataTable dt    = Subitems.GetSubItems("", "*", condition, order);

        if (dt.Rows.Count > 0)
        {
            s += @"
<table class='formatted'>
<tr>
    <th class='stt'>TT</th>
    <th>Loại phòng</th>
    <th>Sức chứa</th>
    <th>Giá</th>
    <th class='thuTu'>Thứ tự</th>
    <th class='trangThai'>Trạng thái</th>
    <th class='congCu'>Công cụ</th>
</tr>";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                s += @"
<tr id='row_" + dt.Rows[i][SubitemsColumns.IsidColumn] + @"'>
    <td class='tac'>" + (i + 1) + @"</td>
    <td>" + dt.Rows[i][SubitemsColumns.VstitleColumn] + @"<br/>
        " + ImagesExtension.GetImage(pic, dt.Rows[i][SubitemsColumns.VsimageColumn].ToString(), "", "itiImage", false, true, dt.Rows[i][SubitemsColumns.VscontentColumn].ToString()) + @"
    </td>
    <td class='tac'>" + dt.Rows[i][SubitemsColumns.isTotalSubitem] + @"</td>
    <td class='tac'>" + PriceExtension.HienThiGia(dt.Rows[i][SubitemsColumns.fsPrice].ToString(), dt.Rows[i][SubitemsColumns.fsSalePrice].ToString()) + @"</td>
    <td class='tac'>" + dt.Rows[i][SubitemsColumns.isOrder] + @"</td>
    <td class='tac'><span class='EnableIcon" + dt.Rows[i][SubitemsColumns.IsenableColumn] + @"'>&nbsp;</span></td>
    <td class='tac'>
        <a href='javascript:EditRoomType(" + dt.Rows[i][SubitemsColumns.IsidColumn] + @")' class='iconEdit'>Sửa</a>&nbsp;&nbsp;&nbsp;
        <a href='javascript:DeleteRoomType(" + dt.Rows[i][SubitemsColumns.IsidColumn] + @")' class='iconDelete'>Xóa</a>
    </td>
</tr>";
            }


            s += "</table>";
        }

        Response.Write(s);
    }
Ejemplo n.º 2
0
        private string GetPriceText(double amount, string textAmount)
        {
            var result  = PriceExtension.FormatPriceText(amount);
            var divider = '.';

            if (textAmount.Length > 0 && textAmount[textAmount.Length - 1] == divider)
            {
                result += divider;
            }

            return(result);
        }
Ejemplo n.º 3
0
        public void ApplyPriceRange(long minPrice, long maxPrice)
        {
            if (minPrice == _lowestPriceInLong && maxPrice == _highestPriceInLong)
            {
                return;
            }

            _lowestPriceInLong  = minPrice;
            _highestPriceInLong = maxPrice;

            _lowestPrice  = PriceExtension.ConvertAmountToDouble(minPrice);
            _highestPrice = PriceExtension.ConvertAmountToDouble(maxPrice);

            _minPriceValue = _lowestPrice;
            _maxPriceValue = _highestPrice;

            SetMinPriceText(_lowestPrice);
            SetMaxPriceText(_highestPrice);
            UpdateSliderValues();
        }
    /// <summary>
    /// Hiện ra bảng danh sách loại phòng khách hàng đã chọn
    /// </summary>
    /// <param name="dtLoaiPhong"></param>
    /// <returns></returns>
    private string HienBangChiTietPhong(DataTable dt)
    {
        string s = "";

        s += @"
<table style='width:100%;border-collapse:collapse;border:solid 1px #d6d6d6'>
<tr>
    <th style='padding:5px;border:solid 1px #d6d6d6;font-weight:bold'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Room types") + @"</th>
    <th style='padding:5px;border:solid 1px #d6d6d6;font-weight:bold'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Room rate/r.n") + @"</th>
    <th style='padding:5px;border:solid 1px #d6d6d6;font-weight:bold'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Discount") + @"</th>
    <th style='padding:5px;border:solid 1px #d6d6d6;font-weight:bold'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Nights") + @"</th>
    <th style='padding:5px;border:solid 1px #d6d6d6;font-weight:bold'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Nr.rooms") + @"</th>
</tr>
";
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            s += @"
<tr>
    <td style='padding:5px;border:solid 1px #d6d6d6'>" + dt.Rows[i]["name"] + @"</td>
    <td style='padding:5px;border:solid 1px #d6d6d6;text-align:center'>" + PriceExtension.HienThiGia02(dt.Rows[i]["price"].ToString(),
                                                                                                       dt.Rows[i]["saleoffprice"].ToString()) + @"
    </td>
    <td style='padding:5px;border:solid 1px #d6d6d6;text-align:center'>" + TienDuocGiam(double.Parse(dt.Rows[i]["price"].ToString()),
                                                                                        double.Parse(dt.Rows[i]["saleoffprice"].ToString())) + @"</td>
    <td style='padding:5px;border:solid 1px #d6d6d6;text-align:center'>
        " + dt.Rows[i]["nights"] + @"
    </td>
    <td style='padding:5px;border:solid 1px #d6d6d6;text-align:center'>
        " + dt.Rows[i]["rooms"] + @"
    </td>
</tr>";
        }

        s += "</table>";

        return(s);
    }
Ejemplo n.º 5
0
        private void InvokePriceChangeEvent(double amount)
        {
            var resultPrice = PriceExtension.ConvertDoubleToAmount(amount);

            PriceEntered.SafeRaise(resultPrice);
        }
Ejemplo n.º 6
0
 public override void ModifyShowingParams(ref ShowingItemsInfo showingInfo)
 {
     showingInfo.MinPriceRange = PriceExtension.ConvertDoubleToAmount(_minPriceValue);
     showingInfo.MaxPriceRange = PriceExtension.ConvertDoubleToAmount(_maxPriceValue);
 }
Ejemplo n.º 7
0
 public override void ResetShowingParams(ShowingItemsInfo showingInfo)
 {
     _minPriceValue = PriceExtension.ConvertAmountToDouble(showingInfo.MinPriceRange);
     _maxPriceValue = PriceExtension.ConvertAmountToDouble(showingInfo.MaxPriceRange);
 }