Esempio n. 1
0
        /// <summary>
        /// lấy cấu hình số khách theo tàu
        /// </summary>
        /// <param name="group">nhóm tàu</param>
        /// <returns></returns>
        public IList <QCruiseCharterRange> GetCruiseCharterRange(QCruiseGroup group)
        {
            var queryOver = _commonDao.OpenSession().QueryOver <QCruiseCharterRange>();

            queryOver.Where(p => p.Group == group);
            return(queryOver.List <QCruiseCharterRange>());
        }
Esempio n. 2
0
        /// <summary>
        /// lấy loại phòng
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        public IList <QRoomClass> GetRoomClass(QCruiseGroup group)
        {
            var queryOver = _commonDao.OpenSession().QueryOver <QRoomClass>();

            queryOver.Where(p => p.Group == group);
            return(queryOver.List <QRoomClass>());
        }
Esempio n. 3
0
 public void DisplayDataConfig(SailsModule module, Cruise cruise, QCruiseGroup group, string agentLvCode, int trip, QQuotation qQuotation)
 {
     litCruiseName.Text = cruise.Name;
     _module            = module;
     _qQuotation        = qQuotation;
     _trip        = trip;
     _agentLvCode = agentLvCode;
     rptCharterRanger.DataSource = module.GetCruiseCharterPrice(group.Id, cruise, agentLvCode, trip, qQuotation);
     rptCharterRanger.DataBind();
 }
Esempio n. 4
0
        public void SaveDataConfig(SailsModule module, Cruise cruise, QCruiseGroup group, string agentLvCode, int trip, QQuotation qQuotation)
        {
            litCruiseName.Text = cruise.Name;
            _module            = module;
            _qQuotation        = qQuotation;
            _trip        = trip;
            _agentLvCode = agentLvCode;
            foreach (RepeaterItem item in rptCharterRanger.Items)
            {
                var         charterPrice      = new QCharterPrice();
                HiddenField hidCharterPriceId = item.FindControl("hidCharterPriceId") as HiddenField;

                TextBox  txtValidFrom  = item.FindControl("txtValidFrom") as TextBox;
                TextBox  txtValidTo    = item.FindControl("txtValidTo") as TextBox;
                TextBox  txtPriceUSD   = item.FindControl("txtPriceUSD") as TextBox;
                TextBox  txtPriceVND   = item.FindControl("txtPriceVND") as TextBox;
                CheckBox checkIsDelete = item.FindControl("checkIsDelete") as CheckBox;


                if (hidCharterPriceId != null && (!string.IsNullOrEmpty(hidCharterPriceId.Value) && hidCharterPriceId.Value != "0"))
                {
                    charterPrice = _module.GetById <QCharterPrice>(Convert.ToInt32(hidCharterPriceId.Value));
                }
                if (txtValidFrom != null && !string.IsNullOrEmpty(txtValidFrom.Text))
                {
                    charterPrice.Validfrom = Convert.ToInt32(txtValidFrom.Text);
                }
                if (txtValidTo != null && !string.IsNullOrEmpty(txtValidTo.Text))
                {
                    charterPrice.Validto = Convert.ToInt32(txtValidTo.Text);
                }

                if (txtPriceUSD != null && !string.IsNullOrEmpty(txtPriceUSD.Text))
                {
                    charterPrice.Priceusd = Convert.ToDecimal(txtPriceUSD.Text);
                }
                if (txtPriceVND != null && !string.IsNullOrEmpty(txtPriceVND.Text))
                {
                    charterPrice.Pricevnd = Convert.ToDecimal(txtPriceVND.Text);
                }
                charterPrice.QQuotation     = qQuotation;
                charterPrice.Trip           = trip;
                charterPrice.AgentLevelCode = agentLvCode;
                charterPrice.Cruise         = cruise;
                charterPrice.GroupCruise    = group;
                if (checkIsDelete.Checked)
                {
                    module.Delete(charterPrice);
                }
                else
                {
                    module.SaveOrUpdate(charterPrice);
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// lấy giá theo phòng
        /// </summary>
        /// <param name="quotation">bảng giá</param>
        /// <param name="group">nhóm tàu</param>
        /// <param name="roomClass">loại phòng</param>
        /// <param name="roomType">kiểu phòng</param>
        /// <param name="trip">số ngày trip</param>
        /// <returns></returns>
        public QRoomPrice GetRoomPrice(QQuotation quotation, QCruiseGroup group, QRoomClass roomClass, QRoomType roomType, int trip)
        {
            var queryOver = _commonDao.OpenSession().QueryOver <QRoomPrice>();

            queryOver.Where(p => p.QQuotation == quotation);
            queryOver.Where(p => p.Group == group);
            queryOver.Where(p => p.QRoomClass == roomClass);
            queryOver.Where(p => p.QRoomType == roomType);
            queryOver.Where(p => p.Trip == trip);
            return(queryOver.SingleOrDefault());
        }
Esempio n. 6
0
        public void NewQuotationPriceConfig(SailsModule module, string agentLvCode, int trip, QCruiseGroup group, QQuotation quotation)
        {
            _module                 = module;
            _trip                   = trip;
            _group                  = group;
            _qQuotation             = quotation;
            _agentLvCode            = agentLvCode;
            hidTrip.Value           = trip.ToString();
            rptRoomPrice.DataSource = module.GetGroupRoomPrice(group.Id, agentLvCode, trip, quotation);
            rptRoomPrice.DataBind();

            // load cruise charter price config
            rptCruise.DataSource = module.CruiseGetAllByGroup(group.Id);
            rptCruise.DataBind();
        }
Esempio n. 7
0
        public void SaveQuotationPriceConfig(SailsModule module, string agentLvCode, int trip, int groupId, QQuotation quotation)
        {
            QCruiseGroup group = module.GetById <QCruiseGroup>(groupId);

            // save room price
            foreach (RepeaterItem item in rptRoomPrice.Items)
            {
                var         roomPrice         = new QGroupRomPrice();
                HiddenField hidRoomPriceId    = item.FindControl("hidRoomPriceId") as HiddenField;
                TextBox     txtRoomType       = item.FindControl("txtRoomType") as TextBox;
                TextBox     txtPriceDoubleUsd = item.FindControl("txtPriceDoubleUsd") as TextBox;
                TextBox     txtPriceDoubleVnd = item.FindControl("txtPriceDoubleVnd") as TextBox;
                TextBox     txtPriceTwinUsd   = item.FindControl("txtPriceTwinUsd") as TextBox;
                TextBox     txtPriceTwinVnd   = item.FindControl("txtPriceTwinVnd") as TextBox;
                TextBox     txtPriceExtraUsd  = item.FindControl("txtPriceExtraUsd") as TextBox;
                TextBox     txtPriceExtraVnd  = item.FindControl("txtPriceExtraVnd") as TextBox;
                TextBox     txtPriceChildUsd  = item.FindControl("txtPriceChildUsd") as TextBox;
                TextBox     txtPriceChildVnd  = item.FindControl("txtPriceChildVnd") as TextBox;
                CheckBox    checkIsDelete     = item.FindControl("checkIsDelete") as CheckBox;


                if (!string.IsNullOrEmpty(hidRoomPriceId.Value) && hidRoomPriceId.Value != "0")
                {
                    roomPrice = module.GetById <QGroupRomPrice>(Convert.ToInt32(hidRoomPriceId.Value));
                }
                if (!string.IsNullOrEmpty(txtRoomType.Text))
                {
                    roomPrice.RoomType = txtRoomType.Text;
                }
                if (!string.IsNullOrEmpty(txtPriceDoubleUsd.Text))
                {
                    roomPrice.PriceDoubleUsd = Convert.ToDecimal(txtPriceDoubleUsd.Text);
                }
                if (!string.IsNullOrEmpty(txtPriceDoubleVnd.Text))
                {
                    roomPrice.PriceDoubleVnd = Convert.ToDecimal(txtPriceDoubleVnd.Text);
                }
                if (!string.IsNullOrEmpty(txtPriceTwinUsd.Text))
                {
                    roomPrice.PriceTwinUsd = Convert.ToDecimal(txtPriceTwinUsd.Text);
                }
                if (!string.IsNullOrEmpty(txtPriceTwinVnd.Text))
                {
                    roomPrice.PriceTwinVnd = Convert.ToDecimal(txtPriceTwinVnd.Text);
                }

                if (!string.IsNullOrEmpty(txtPriceExtraUsd.Text))
                {
                    roomPrice.PriceExtraUsd = Convert.ToDecimal(txtPriceExtraUsd.Text);
                }
                if (!string.IsNullOrEmpty(txtPriceExtraVnd.Text))
                {
                    roomPrice.PriceExtraVnd = Convert.ToDecimal(txtPriceExtraVnd.Text);
                }
                if (!string.IsNullOrEmpty(txtPriceChildUsd.Text))
                {
                    roomPrice.PriceChildUsd = Convert.ToDecimal(txtPriceChildUsd.Text);
                }
                if (!string.IsNullOrEmpty(txtPriceChildVnd.Text))
                {
                    roomPrice.PriceChildVnd = Convert.ToDecimal(txtPriceChildVnd.Text);
                }
                roomPrice.GroupCruise    = group;
                roomPrice.AgentLevelCode = agentLvCode;
                roomPrice.QQuotation     = quotation;
                roomPrice.Trip           = trip;
                if (checkIsDelete.Checked)
                {
                    module.Delete(roomPrice);
                }
                else
                {
                    module.SaveOrUpdate(roomPrice);
                }
            }
            //save charter range

            foreach (RepeaterItem cruiseItem in rptCruise.Items)
            {
                var hidCruise   = cruiseItem.FindControl("hidCruise") as HiddenField;
                var cruiseprice = cruiseItem.FindControl("cruiseprice") as CruiseCharterConfigPrice;
                if (cruiseprice != null)
                {
                    if (hidCruise != null && !string.IsNullOrWhiteSpace(hidCruise.Value))
                    {
                        var cruise = module.GetById <Cruise>(Convert.ToInt32(hidCruise.Value));
                        cruiseprice.SaveDataConfig(module, cruise, group, agentLvCode, trip, quotation);
                    }
                }
            }
        }