Ejemplo n.º 1
0
        void GetCrewAssistHotelInformation(object obj)
        {
            SF = new CrewAssistBLL();
            Session["ContactPerson"] = null;
            Session["ContractRate"]  = null;
            Session["HotelEmailTo"]  = null;

            DateTime starDate = DateTime.Now;
            DateTime enddate  = DateTime.Now.AddDays(1);

            List <CrewAssistHotelInformation> _HotelInformationList = new List <CrewAssistHotelInformation>();


            _HotelInformationList = SF.CrewAssistHotelInformation(0,
                                                                  GlobalCode.Field2Int(((System.Web.UI.WebControls.ListBox)obj).SelectedValue),
                                                                  "", "", starDate, 0);


            uoTextContractedRate.Text = "";
            uoTextBoxMealVoucher.Text = "";
            uoTextBoxComfirmRate.Text = "";
            CheckBoxEmail.Checked     = false;
            uoTextBoxEmail.Text       = "";
            //CheckBoxFax.Checked = false;
            //CheckBoxFax.Text = "Fax : ";

            //CheckBoxCopycrewassist.Checked = false;
            //CheckBoxCopycrewhotels.Checked = false;



            //if (uoTextBoxStatus.Text.ToString() == "ON")
            //{
            //    if (uoHiddenFieldRequestDate.Value == "")
            //    {
            //        starDate = GlobalCode.Field2DateTime(GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value));
            //        enddate = GlobalCode.Field2DateTime(GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value).AddDays(+1));
            //    }
            //    else
            //    {
            //        starDate = GlobalCode.Field2DateTime(GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value).AddDays(-1));
            //        enddate = GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value);
            //    }
            //}
            //else
            //{
            //    if (uoHiddenFieldRequestDate.Value == "")
            //    {
            //        starDate = GlobalCode.Field2DateTime(GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value));
            //        enddate = GlobalCode.Field2DateTime(GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value).AddDays(+1));
            //    }
            //    else
            //    {
            //        enddate = GlobalCode.Field2DateTime(GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value).AddDays(+1));
            //        starDate = GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value);
            //    }

            //}
            uoTextBoxCheckinDate.Text  = GlobalCode.Field2Date(starDate);
            uoTextBoxCheckoutDate.Text = GlobalCode.Field2Date(enddate);

            uoTextBoxDuration.Text = "1";

            uoTxtBoxTimeOut.Text = DateTime.Now.Hour.ToString() + ":00";
            uoTxtBoxTimeIn.Text  = DateTime.Now.Hour.ToString() + ":00";

            uoDropDownListCurrency.SelectedIndex = GlobalCode.GetselectedIndex(uoDropDownListCurrency, _HotelInformationList[0].CurrencyID);

            if (_HotelInformationList.Count > 0)
            {
                //uoLabelAdress.Text = _HotelInformationList[0].Address;
                //uoLabelTelephone.Text = _HotelInformationList[0].ContactNo;
                uoHiddenFieldCityCode.Value = _HotelInformationList[0].CityCode;

                uoTextContractedRate.Text = _HotelInformationList[0].ContractedRate;

                uoTextBoxMealVoucher.Text = _HotelInformationList[0].MealVoucher;
                uoTextBoxComfirmRate.Text = _HotelInformationList[0].ContractRoomRateTaxPercentage;

                uoTextBoxEmail.Text = _HotelInformationList[0].EmailTo;
                //CheckBoxFax.Text =  "Fax : " + _HotelInformationList[0].FaxNo;

                //TextBoxWhoConfirm.Text = _HotelInformationList[0].ContactPerson;

                if (uoTextBoxEmail.Text.ToString().Length > 0)
                {
                    CheckBoxEmail.Checked  = true;
                    uoTextBoxEmail.Enabled = true;
                }

                uoCheckboxBreakfast.Checked = _HotelInformationList[0].IsBreakfast;
                uoCheckboxLunch.Checked     = _HotelInformationList[0].IsLunch;
                uoCheckboxDinner.Checked    = _HotelInformationList[0].IsDinner;

                uoCheckBoxIsWithShuttle.Checked = _HotelInformationList[0].IsWithShuttle;



                //if (_HotelInformationList[0].ATTEMail.Count > 0)
                //{
                //    uoHiddenFieldHotelEmail.Value = _HotelInformationList[0].ATTEMail[0].Email;
                //}

                Session["ContactPerson"] = _HotelInformationList[0].ContactPerson;
                Session["ContractRate"]  = _HotelInformationList[0].ContractedRate;
                Session["HotelEmailTo"]  = _HotelInformationList[0].EmailTo;


                uoHiddenFieldContractStart.Value = _HotelInformationList[0].ContractDateStarted;
                uoHiddenFieldContractEnd.Value   = _HotelInformationList[0].ContractDateEnd;



                uoDropDownListRoomeType.SelectedValue = GlobalCode.Field2String(_HotelInformationList[0].RoomTypeID);
            }

            //ScriptManager.RegisterStartupScript(Page, GetType(), "key", "HighLightTab();", true);
        }