Пример #1
0
        /// <summary>
        /// Date Created:   12/10/2011
        /// Created By:     Charlene Remotigue
        /// Description     Get hotel list
        /// ---------------------------------------------
        /// Date Modified:   14/02/2012
        /// Modified By:     Josephine Gad
        /// (description)    Change DataTable to List
        /// ---------------------------------------------
        /// </summary>
        private void BindHotel()
        {
            List <HotelDTO> hotelList = HotelBLL.GetHotelBranchByCity("", uoDropDownListCity.SelectedValue);
            var             listHotel = (from a in hotelList
                                         select new
            {
                HotelID = a.HotelIDString,
                HotelName = a.HotelNameString
            }).ToList();

            uoDropDownListHotel.Items.Clear();
            ListItem item = new ListItem("--SELECT HOTEL--", "0");

            uoDropDownListHotel.Items.Add(item);

            uoDropDownListHotel.DataSource     = listHotel;
            uoDropDownListHotel.DataTextField  = "HotelName";
            uoDropDownListHotel.DataValueField = "HotelID";
            uoDropDownListHotel.DataBind();

            if (hotelList.Count == 1)
            {
                uoDropDownListHotel.SelectedIndex = 1;
            }
            else if (hotelList.Count > 0)
            {
                if (Session["Hotel"] != null)
                {
                    if (uoDropDownListHotel.Items.FindByValue(Session["Hotel"].ToString()) != null)
                    {
                        uoDropDownListHotel.SelectedValue = Session["Hotel"].ToString();
                    }
                }
            }
        }
        /// <summary>
        /// Author: Charlene Remotigue
        /// Date Created:   07/12/2011
        /// Description:    Load room types for the given branch
        /// -------------------------------------------
        /// Modified By:    Josephine Gad
        /// Date Modified:  24/02/2012
        /// Description:    Change DataTable to List
        /// </summary>
        private void HotelGetRoomType()
        {
            List <HotelBranchRoomType> list = null;

            try
            {
                list = HotelBLL.HotelRoomTypeGetDetailsByBranch(uoDropDownListHotelBranch.SelectedValue);
                uoDropDownListRoomType.Items.Clear();
                if (list.Count > 0)
                {
                    uoDropDownListRoomType.DataSource     = list;
                    uoDropDownListRoomType.DataTextField  = "colRoomNameVarchar";
                    uoDropDownListRoomType.DataValueField = "colRoomTypeID";
                }
                uoDropDownListRoomType.Items.Insert(0, new ListItem("--Select Room Type--", "0"));
                uoDropDownListRoomType.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (list != null)
                {
                    list = null;
                }
            }
        }
        /// <summary>
        /// Author:         Charlene Remotigue
        /// Date Created:   09/11/2011
        /// Description:    load room types per branch
        /// -------------------------------------------
        /// Modified By:    Josephine Gad
        /// Date Modified:  24/02/2012
        /// Description:    Change DataTable to List
        /// </summary>
        protected void LoadRoomTypes()
        {
            List <HotelBranchRoomType> list = null;

            try
            {
                //DataTable roomTypeDataTable = HotelBLL.HotelRoomTypeGetDetailsByBranch(uoDropDownListHotelBranch.SelectedValue);
                list = HotelBLL.HotelRoomTypeGetDetailsByBranch(uoDropDownListHotelBranch.SelectedValue);
                ListItem item = new ListItem("Select Room Type--", "0");
                uoDropDownListRoomType.Items.Clear();
                uoDropDownListRoomType.Items.Add(item);
                uoDropDownListRoomType.DataSource     = list;
                uoDropDownListRoomType.DataTextField  = "colRoomNameVarchar";
                uoDropDownListRoomType.DataValueField = "colRoomTypeID";
                uoDropDownListRoomType.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (list != null)
                {
                    list = null;
                }
            }
        }
        /// <summary>
        /// Date Created:   24/11/2011
        /// Created By:     Josephine Gad
        /// (description)   Set Column Name for room types
        /// <summary>
        private void BindColumnName()
        {
            Label uoLabelRoomType1 = (Label)uoListViewDashboard.FindControl("uoLabelRoomType1");
            Label uoLabelRoomType2 = (Label)uoListViewDashboard.FindControl("uoLabelRoomType2");

            //Label uoLabelRoomType3 = (Label)uoListViewDashboard.FindControl("uoLabelRoomType3");
            //Label uoLabelRoomType4 = (Label)uoListViewDashboard.FindControl("uoLabelRoomType4");
            //Label uoLabelRoomType5 = (Label)uoListViewDashboard.FindControl("uoLabelRoomType5");
            if (uoLabelRoomType1 != null)
            {
                DataTable dt = null;
                try
                {
                    dt = HotelBLL.HotelRoomTypeGetDetails();
                    if (dt.Rows.Count > 0)
                    {
                        int i = 1;
                        foreach (DataRow r in dt.Rows)
                        {
                            if (i == 1)
                            {
                                uoLabelRoomType1.Text = r["colRoomNameVarchar"].ToString();
                            }
                            else if (i == 2)
                            {
                                uoLabelRoomType2.Text = r["colRoomNameVarchar"].ToString();
                            }
                            else if (i > 2)
                            {
                                break;
                            }
                            //else if (i == 3)
                            //{
                            //    uoLabelRoomType3.Text = r["colRoomNameVarchar"].ToString();
                            //}
                            //else if (i == 4)
                            //{
                            //    uoLabelRoomType4.Text = r["colRoomNameVarchar"].ToString();
                            //}
                            //else if (i == 5)
                            //{
                            //    uoLabelRoomType5.Text = r["colRoomNameVarchar"].ToString();
                            //}
                            i++;
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    if (dt != null)
                    {
                        dt.Dispose();
                    }
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Date Created:   04/01/2011
        /// Created By:     Josephine Gad
        /// (description)   Check if Hotel has Event
        /// </summary>
        private void EventNotification()
        {
            IDataReader dr = null;

            try
            {
                //DateTime dtDate = CommonFunctions.ConvertDateByFormat(uoHiddenFieldStartDate.Value);
                dr = HotelBLL.GetEventNotification(int.Parse(uoHiddenFieldUserBranch.Value), 0, uoHiddenFieldStartDate.Value);
                if (dr.Read())
                {
                    uoLinkButtonEvents.Visible = true;

                    string scriptEventString = "return OpenEventsList('" + uoHiddenFieldUserBranch.Value
                                               + "', '" + 0 + "', '" + uoHiddenFieldStartDate.Value + "');";
                    uoLinkButtonEvents.Attributes.Add("OnClick", scriptEventString);
                }
                else
                {
                    uoLinkButtonEvents.Visible = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                    dr.Dispose();
                }
            }
        }
Пример #6
0
        private void BindRoom()
        {
            try
            {
                DataTable dt = HotelBLL.GetAvailHotelRoomType(uoDropDownListHotel.SelectedValue, uoTextBoxCheckinDate.Text.Trim());

                ListItem item = new ListItem("--SELECT ROOM--", "0");
                uoDropdownRoomOccupancy.Items.Add(item);
                uoDropdownRoomOccupancy.Items.Clear();
                uoDropdownRoomOccupancy.DataSource     = dt;
                uoDropdownRoomOccupancy.DataTextField  = "RoomType";
                uoDropdownRoomOccupancy.DataValueField = "RoomTypeID";
                uoDropdownRoomOccupancy.DataBind();

                if (dt.Rows.Count < 1)
                {
                    uoDropdownRoomOccupancy.Items.Clear();
                    item = new ListItem("NO AVAILABLE ROOM", "0");
                    uoDropdownRoomOccupancy.Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #7
0
        protected bool IsEventExists(object BranchID, object Date)
        {
            //DateTime DateEvent = DateTime.Parse(Date.ToString());
            IDataReader dr = HotelBLL.GetEventNotification(Int32.Parse(BranchID.ToString()), 0, Date.ToString());

            try
            {
                if (dr.Read())
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Dispose();
                }
            }
        }
Пример #8
0
        /// <summary>
        /// Date Created:   04/03/2013
        /// Created By:     Marco Abejar
        /// (description)   Get Room Amount
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetHotelRoomAmount()
        {
            List <HotelRoomBlocksDTO> listHotelRoomBlocks = null;

            try
            {
                string strRoomType = (uoDropdownRoomOccupancy.SelectedValue == "Single") ? "1" : "2";
                listHotelRoomBlocks = HotelBLL.GetHotelRoomOverrideByBranch(uoDropDownListHotel.SelectedValue,
                                                                            strRoomType, uoHiddenFieldDate.Value);
                if (listHotelRoomBlocks.Count > 0)
                {
                    if (uoHiddenFieldRoomAmount.Value == "0")
                    {
                        Decimal fAmount = GlobalCode.Field2Decimal(listHotelRoomBlocks[0].OverrideRate);//GlobalCode.Field2Decimal(dr["EmergencyRate"].ToString());
                        uoTextBoxAmount.Text = fAmount.ToString("0.00");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (listHotelRoomBlocks != null)
                {
                    listHotelRoomBlocks = null;
                }
            }
        }
Пример #9
0
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get hotel list
        /// ---------------------------------------------------------------------------
        /// Date Modified:   15/02/2012
        /// Modified By:     Josephine Gad
        /// (description)    Delete DataTable and replace with List
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void BindHotel()
        {
            try
            {
                //HotelDataTable = HotelBLL.GetHotelBranchByCity(TravelMartVariable.TreadUserID, uoDropDownListCity.SelectedValue);
                List <HotelDTO> hotelList = HotelBLL.GetHotelBranchByRegionPortCountry(GlobalCode.Field2String(Session["UserName"]), uoDropDownListRegion.SelectedValue, uoDropDownListPort.SelectedValue, uoDropDownListCountry.SelectedValue, "0");

                uoDropDownListHotel.Items.Clear();
                ListItem item = new ListItem("--Select Hotel--", "0");
                uoDropDownListHotel.Items.Add(item);

                var listHotel = (from a in hotelList
                                 select new
                {
                    BranchID = a.HotelIDString,
                    BranchName = a.HotelNameString
                }).ToList();
                uoDropDownListHotel.DataSource     = listHotel;
                uoDropDownListHotel.DataTextField  = "BranchName";
                uoDropDownListHotel.DataValueField = "BranchID";
                uoDropDownListHotel.DataBind();

                if (GlobalCode.Field2String(Session["Hotel"]) != "")
                {
                    if (uoDropDownListHotel.Items.FindByValue(GlobalCode.Field2String(Session["Hotel"])) != null)
                    {
                        uoDropDownListHotel.SelectedValue = GlobalCode.Field2String(Session["Hotel"]);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #10
0
        /// <summary>
        /// Date Created:   24/01/2012
        /// Created By:     Josephine Gad
        /// (description)   Loads Hotel Branch by city
        /// ===============================================
        /// Date Modified:  06/03/2012
        /// Modified By:    Josephine Gad
        /// (description)   change DataTable to List
        /// ===============================================
        /// </summary>
        private void BindHotel()
        {
            //DataTable dt = null;
            try
            {
                string sCity = uoDropDownListCity.SelectedValue;
                sCity = (sCity.Trim() == "" ? "0" : sCity);

                List <HotelAirportDTO> list = HotelBLL.GetHotelBranchAll(sCity, GlobalCode.Field2Int(uoHiddenFieldAirportID.Value),
                                                                         false, GlobalCode.Field2TinyInt(uoHiddenFieldRoomType.Value));
                if (list.Count > 0)
                {
                    uoDropDownListHotel.DataSource     = list;
                    uoDropDownListHotel.DataTextField  = "BranchName";
                    uoDropDownListHotel.DataValueField = "BranchID";
                    uoDropDownListHotel.DataBind();
                    uoDropDownListHotel.Items.Insert(0, new ListItem("--Select Hotel Branch--", "0"));
                }
                else
                {
                    uoDropDownListHotel.DataBind();
                    uoDropDownListHotel.Items.Insert(0, new ListItem("--Select Hotel Branch--", "0"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #11
0
        /// <summary>
        /// Date Created:   27/11/2011
        /// Created By:     Josephine Gad
        /// (description)   Save override room blocks
        /// ---------------------------------------------------------------
        /// Date Modified: 03/03/2012
        /// Modified By:   Gabriel Oquialda
        /// (description)  Added validation for total room block(s) versus the no. of reserved room
        /// </summary>
        private void SaveHotelRoomOverride()
        {
            try
            {
                Int32 ContractRoomCount = GlobalCode.Field2Int(uoLabelContractRoomCount.Text);
                Int32 OverrideRoomCount = GlobalCode.Field2Int(uoTextBoxOverrideRoomCount.Text);
                Int32 ReservedRoomCount = GlobalCode.Field2Int(uoHiddenFieldReservedCount.Value);

                Int32 TotalRoomBlock = 0;

                TotalRoomBlock = ContractRoomCount + OverrideRoomCount;

                if (TotalRoomBlock < ReservedRoomCount)
                {
                    AlertMessage("Total room block(s) must not be less than the total no. of reserved room!");
                }
                else
                {
                    DataTable dtOverride = null;

                    string strLogDescription;
                    string strFunction;

                    DateTime dDate = CommonFunctions.ConvertDateByFormat(uoHiddenFieldDate.Value);
                    dtOverride = HotelBLL.SaveHotelRoomOverrideByBranch(uoHiddenFieldBranchID.Value, dDate,
                                                                        uoTextBoxOverrideAmount.Text, uoDropDownListCurrency.SelectedValue, uoTextBoxOverrideTax.Text,
                                                                        uoCheckOverrideBoxTaxInclusive.Checked, uoDropDownListRoomType.SelectedValue, uoTextBoxOverrideRoomCount.Text,
                                                                        uoHiddenFieldUser.Value);

                    if (Convert.ToInt32(dtOverride.Rows[0]["dtReturnType"]) == 0)
                    {
                        //Insert log audit trail (Gabriel Oquialda - 22/02/2012)
                        strLogDescription = "Hotel room override added.";
                        strFunction       = "SaveHotelRoomOverride";

                        DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                        BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(dtOverride.Rows[0]["dtHotelRoomID"]), "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                              CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                    }
                    else if (Convert.ToInt32(dtOverride.Rows[0]["dtReturnType"]) == 1)
                    {
                        //Insert log audit trail (Gabriel Oquialda - 22/02/2012)
                        strLogDescription = "Hotel room override updated.";
                        strFunction       = "SaveHotelRoomOverride";

                        DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                        BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(dtOverride.Rows[0]["dtHotelRoomID"]), "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                              CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                    }

                    OpenParentPage();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #12
0
        /// <summary>
        /// Date Created:   26/12/2011
        /// Created By:     Josephine Gad
        /// (description)   Get list of room types
        /// -------------------------------------------
        /// </summary>
        private void BindRoomTypes()
        {
            DataTable dt = null;

            try
            {
                dt = HotelBLL.HotelRoomType();
                uoDropDownListRoom.Items.Clear();

                if (dt.Rows.Count > 0)
                {
                    uoDropDownListRoom.DataTextField  = "colRoomNameVarchar";
                    uoDropDownListRoom.DataValueField = "colRoomTypeID";
                    uoDropDownListRoom.DataSource     = dt;
                }
                uoDropDownListRoom.DataBind();
                uoDropDownListRoom.Items.Insert(0, new ListItem("--Select Room Type--", "0"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Пример #13
0
        /// <summary>
        /// Date Created: 23/08/2011
        /// Created By: Ryan Bautista
        /// (description) Select all hotel branch details
        /// </summary>
        private void HotelBranchLoad()
        {
            DataTable dt = null;

            try
            {
                dt = HotelBLL.HotelBranchList();
                if (dt.Rows.Count > 0)
                {
                    uoDropDownListVendor.DataSource     = dt;
                    uoDropDownListVendor.DataTextField  = "colVendorBranchNameVarchar";
                    uoDropDownListVendor.DataValueField = "colBranchIDInt";
                    uoDropDownListVendor.DataBind();
                }
                else
                {
                    uoDropDownListVendor.DataBind();
                }
                uoDropDownListVendor.Items.Insert(0, new ListItem("--Select Hotel Branch--", "0"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Пример #14
0
        /// <summary>
        /// Modified By:    Josephine Gad
        /// Date Modified:  20/Dec/2012
        /// Description:    Get Hotel list to filter
        /// ----------------------------------------------
        /// </summary>
        private void GetHotelFilter()
        {
            List <HotelDTO> list = new List <HotelDTO>();

            try
            {
                list = HotelBLL.GetHotelBranchByRegionPortCountry(uoHiddenFieldUser.Value, GlobalCode.Field2String(Session["Region"]),
                                                                  Session["Port"] == null ? "0" : Session["Port"].ToString(), "0", "0");

                int iRowCount = list.Count;
                if (iRowCount == 1)
                {
                    Session["Hotel"] = list[0].HotelIDString;//dt.Rows[0]["BranchID"].ToString();
                }
                if (iRowCount > 0)
                {
                    uoDropDownListHotel.Items.Clear();
                    uoDropDownListHotel.DataSource     = list;
                    uoDropDownListHotel.DataTextField  = "HotelNameString";
                    uoDropDownListHotel.DataValueField = "HotelIDString";
                    uoDropDownListHotel.DataBind();
                    uoDropDownListHotel.Items.Insert(0, new ListItem("--Select Hotel--", "0"));
                    uoDropDownListHotel.SelectedValue = "0";

                    if (GlobalCode.Field2Int(Session["Region"]) > 0)
                    {
                        if (uoDropDownListHotel.Items.FindByValue("-1") == null)
                        {
                            uoDropDownListHotel.Items.Insert(1, new ListItem("--Select ALL Hotel--", "-1"));
                        }
                    }
                    else
                    {
                        if (uoDropDownListHotel.Items.FindByValue("-1") != null)
                        {
                            uoDropDownListHotel.Items.Remove(new ListItem("--Select ALL Hotel--", "-1"));
                        }
                    }

                    uoDropDownListHotel.Enabled = true;

                    if (uoDropDownListHotel.Items.FindByValue(GlobalCode.Field2String(Session["Hotel"])) != null)
                    {
                        uoDropDownListHotel.SelectedValue = GlobalCode.Field2String(Session["Hotel"]);
                    }
                    Session["Hotel"]             = uoDropDownListHotel.SelectedValue;
                    Session["HotelNameToSearch"] = uoDropDownListHotel.SelectedItem.Text;
                    //LoadTravelDetails();
                }
                else
                {
                    uoDropDownListHotel.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #15
0
        /// <summary>
        /// Date Created:   10/02/2012
        /// Created By:     Josephine Gad
        /// (description)   Get hotel room blocks from emergency room blocks
        /// ---------------------------------------------------
        /// Date Modified:   16/02/2012
        /// Modified By:     Josephine Gad
        /// (description)    Replace IDataReader with List
        /// ---------------------------------------------------
        /// </summary>
        private void GetHotelRoomEmergency()
        {
            List <HotelRoomBlocksEmergencyDTO> list = null;

            try
            {
                list = HotelBLL.GetHotelRoomEmergencyByBranch(uoHiddenFieldBranchID.Value,
                                                              uoDropDownListRoomType.SelectedValue, uoHiddenFieldDate.Value);
                if (list.Count > 0)
                {
                    uoLabelBranchName.Text = list[0].BranchName;//dr["BranchName"].ToString();

                    if (uoHiddenFieldDate.Value != "")
                    {
                        DateTime dDate = CommonFunctions.ConvertDateByFormat(uoHiddenFieldDate.Value);
                        uoLabelDate.Text = dDate.ToString("dd-MMM-yyyy (dddd)");
                    }
                    //uoTextBoxEmergencyRoomCount.Text = list[0].RoomBlocks;
                    uoLabelEmergencyRoomBlocks.Text = list[0].RoomBlocks;
                    Decimal fAmount = GlobalCode.Field2Decimal(list[0].Rate);//GlobalCode.Field2Decimal(dr["EmergencyRate"].ToString());
                    uoTextBoxEmergencyAmount.Text = fAmount.ToString("0.00");
                    //if (dr["EmergencyCurrentcyID"] == null)
                    //{
                    //    uoDropDownListCurrency.SelectedValue = dr["OverrideCurrencyID"].ToString();
                    //}
                    //else
                    //{
                    //    uoDropDownListCurrency.SelectedValue = dr["EmergencyCurrentcyID"].ToString();
                    //}
                    uoDropDownListCurrency.SelectedValue    = list[0].Currency;       //dr["EmergencyCurrentcyID"].ToString();
                    uoCheckEmergencyBoxTaxInclusive.Checked = list[0].IsTaxInclusive; //(bool)dr["EmergencyTaxInclusive"];
                    uoTextBoxEmergencyTax.Text = list[0].Tax;                         //dr["EmergencyTaxPercent"].ToString();

                    //Decimal fTax = GlobalCode.Field2Decimal(list[0].Tax);
                    //uoTextBoxEmergencyTax.Text = fTax.ToString("0.0"); //dr["EmergencyTaxPercent"].ToString();

                    if (!uoCheckEmergencyBoxTaxInclusive.Checked)
                    {
                        uoTextBoxEmergencyTax.Enabled = false;
                        uoTextBoxEmergencyTax.Text    = "0.0";
                    }
                    else
                    {
                        uoTextBoxEmergencyTax.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (list != null)
                {
                    list = null;
                }
            }
        }
Пример #16
0
        /// <summary>
        /// Date Created: 21/02/2012
        /// Created By: Gabriel Oquialda
        /// (description) Insert validation of country code
        /// </summary>
        private Boolean countrycodeInInsertExist()
        {
            String CountryCode = uoTextBoxCountryCode.Text;

            Boolean bValidation = HotelBLL.countrycodeInInsertExist(CountryCode, GlobalCode.Field2Int(Session["CountryId"].ToString()));

            return(bValidation);
        }
Пример #17
0
        private void HotelRoomTypeLoad()
        {
            /// <summary>
            /// Date Created: 25/07/2011
            /// Created By: Ryan Bautista
            /// (description) Select all hotel room type
            /// </summary>

            uoDropDownListRoomType.DataSource     = HotelBLL.HotelRoomTypeGetDetails();
            uoDropDownListRoomType.DataTextField  = "colRoomType";
            uoDropDownListRoomType.DataValueField = "colRoomTypeID";
            uoDropDownListRoomType.DataBind();
        }
Пример #18
0
        /// <summary>
        /// Date Created:   07/10/2011
        /// Created By:     Josephine Gad
        /// (description)   Get City List by Country
        /// ---------------------------------------------
        /// </summary>
        //private void GetCity()
        //{
        //    DataTable dt = null;
        //    try
        //    {
        //        dt = CityBLL.GetCityByCountry(uoHiddenFieldCountryID.Value, uoTextBoxFilterCity.Text.Trim(), "0");
        //        ListItem item = new ListItem("--SELECT CITY--", "0");
        //        uoDropDownListCity.Items.Clear();
        //        uoDropDownListCity.Items.Add(item);
        //        if (dt.Rows.Count > 0)
        //        {
        //            uoDropDownListCity.DataSource = dt;
        //        }
        //        uoDropDownListCity.DataBind();

        //        if (dt.Rows.Count == 1)
        //        {
        //            uoDropDownListCity.SelectedIndex = 1;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //        if (dt != null)
        //        {
        //            dt.Dispose();
        //        }
        //    }
        //}
        /// <summary>
        /// Date Created:   05/10/2011
        /// Created By:     Josephine Gad
        /// (description)   Get Hotel List By City
        /// ---------------------------------------------
        /// Date Modified:   14/02/2012
        /// Modified By:     Josephine Gad
        /// (description)    Change DataTable to List
        /// ---------------------------------------------
        /// </summary>
        private void GetHotelBranch()
        {
            List <HotelDTO> hotelList = null;

            try
            {
                hotelList = HotelBLL.GetHotelBranchByRegionPortCountry(GlobalCode.Field2String(Session["UserName"]), "0", "0", "0", "0");
                //HotelBLL.GetHotelBranchByCity("", uoDropDownListCity.SelectedValue);
                var listHotel = (from a in hotelList
                                 select new
                {
                    HotelID = a.HotelIDString,
                    HotelName = a.HotelNameString
                }).ToList();

                uoDropDownListHotel.Items.Clear();
                ListItem item = new ListItem("--SELECT HOTEL--", "0");
                uoDropDownListHotel.Items.Add(item);

                uoDropDownListHotel.DataSource     = listHotel;
                uoDropDownListHotel.DataTextField  = "HotelName";
                uoDropDownListHotel.DataValueField = "HotelID";
                uoDropDownListHotel.DataBind();

                if (hotelList.Count == 1)
                {
                    uoDropDownListHotel.SelectedIndex = 1;
                }
                else if (hotelList.Count > 0)
                {
                    if (GlobalCode.Field2String(Session["Hotel"]) != "")
                    {
                        if (uoDropDownListHotel.Items.FindByValue(GlobalCode.Field2String(Session["Hotel"])) != null)
                        {
                            uoDropDownListHotel.SelectedValue = GlobalCode.Field2String(Session["Hotel"]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (hotelList != null)
                {
                    hotelList = null;
                }
            }
        }
Пример #19
0
        private void CityListByVendorID(Int32 VendorID)
        {
            /// <summary>
            /// Date Created: 25/07/2011
            /// Created By: Ryanb Bautista
            /// (description) Select city list by vendor ID
            /// </summary>

            DataTable dt = HotelBLL.CityListByVendorID(VendorID);

            uoDropDownListLocation.DataSource     = dt;
            uoDropDownListLocation.DataTextField  = "colCityNameVarchar";
            uoDropDownListLocation.DataValueField = "colCityIDInt";
            uoDropDownListLocation.DataBind();
        }
Пример #20
0
        private void BuscarButton_Clic(object serder, RoutedEventArgs e)
        {
            Hotel encotrado = HotelBLL.Buscar(Utilidades.ToInt(IDTextbox.Text));

            if (encotrado != null)
            {
                this.hotel = encotrado;
                Cargar();
                MessageBox.Show("Exito!!", "EXITO", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                Limpiar();
                MessageBox.Show("Hotel No Exite", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #21
0
        private void HotelLoad()
        {
            /// <summary>
            /// Date Created: 25/07/2011
            /// Created By: Ryan Bautista
            /// (description) Select all hotel details
            /// </summary>

            DataTable dt = HotelBLL.HotelVendorGetDetails();

            uoDropDownListHotel.DataSource     = dt;
            uoDropDownListHotel.DataTextField  = "colVendorNameVarchar";
            uoDropDownListHotel.DataValueField = "colVendorIdInt";
            uoDropDownListHotel.DataBind();
            uoDropDownListHotel.SelectedValue = dt.Rows[0]["colVendorIdInt"].ToString();
        }
Пример #22
0
        /// <summary>
        /// Date Created: 23/08/2011
        /// Created By: Ryan Bautista
        /// (description) Select all hotel branch details
        /// </summary>
        private void HotelBranchLoadByVendorID()
        {
            DataTable dt = null;

            try
            {
                int VendorID = 0;
                if (uoDropDownListVendorMain.SelectedValue != "0")
                {
                    VendorID = Convert.ToInt32(uoDropDownListVendorMain.SelectedValue);
                }
                //dt = HotelBLL.HotelBranchList();
                dt = HotelBLL.HotelBranchListByVendorID(VendorID, MUser.GetUserName());
                if (dt.Rows.Count > 0)
                {
                    uoDropDownListVendor.DataSource     = dt;
                    uoDropDownListVendor.DataTextField  = "colVendorBranchNameVarchar";
                    uoDropDownListVendor.DataValueField = "colBranchIDInt";
                    uoDropDownListVendor.DataBind();
                    if (Request.QueryString["vmId"] != null)
                    {
                        uoDropDownListVendor.SelectedValue = Request.QueryString["vmId"];
                        uoDropDownListVendor.Enabled       = false;
                    }
                    else
                    {
                        uoDropDownListVendor.SelectedValue = dt.Rows[0]["colBranchIDInt"].ToString();
                    }
                }
                else
                {
                    uoDropDownListVendor.DataBind();
                    uoDropDownListVendor.Items.Insert(0, new ListItem("--Select Hotel Branch--", "0"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Пример #23
0
        private void EliminarButton_Click(object sender, RoutedEventArgs e)

        {
            if (HotelBLL.Eliminar(Utilidades.ToInt(IDTextbox.Text)))

            {
                Limpiar();

                MessageBox.Show("Eliminado", "EXITO");
            }

            else

            {
                MessageBox.Show("Fallo", "Error");
            }
        }
Пример #24
0
        /// <summary>
        /// Date Created: 25/07/2011
        /// Created By: Ryan Bautista
        /// (description) Select city list by vendor ID
        /// </summary>

        private void CityListByVendorID()
        {
            DataTable dt = null;

            try
            {
                int CountryID = 0;
                if (uoDropDownCountry.SelectedValue != "0")
                {
                    CountryID = Convert.ToInt32(uoDropDownCountry.SelectedValue);
                }
                int VendorID = 0;
                if (uoDropDownListVendor.SelectedValue != "0")
                {
                    VendorID = Convert.ToInt32(uoDropDownListVendor.SelectedValue);
                }

                dt = HotelBLL.CityByVendorBranchIDCountryID(VendorID, CountryID);
                if (dt.Rows.Count > 0)
                {
                    uoDropDownListCity.DataSource     = dt;
                    uoDropDownListCity.DataTextField  = "colCityNameVarchar";
                    uoDropDownListCity.DataValueField = "colCityIDInt";
                    uoDropDownListCity.DataBind();
                    uoDropDownListCity.SelectedValue = dt.Rows[0]["colCityIDInt"].ToString();
                    uoDropDownListCity.Enabled       = false;
                }
                else
                {
                    uoDropDownListCity.DataBind();
                    uoDropDownListCity.Items.Insert(0, new ListItem("--Select City--", "0"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Пример #25
0
        /// <summary>
        /// Date Created:   27/11/2011
        /// Created By:     Josephine Gad
        /// (description)   Save override room blocks
        /// ---------------------------------------------------------------
        /// Date Modified: 03/03/2012
        /// Modified By:   Gabriel Oquialda
        /// (description)  Added validation for total room block(s) versus the no. of reserved room
        /// </summary>
        private void SaveHotelRoomOverride()
        {
            try
            {
                DataTable dtOverride = null;

                string strLogDescription;
                string strFunction;

                DateTime dDate = GlobalCode.Field2DateTime(uoHiddenFieldDate.Value);
                dtOverride = HotelBLL.SaveHotelRoomOverrideByBranch(uoHiddenFieldBranchID.Value, dDate,
                                                                    uoTextBoxOverrideAmount.Text, uoDropDownListCurrency.SelectedValue, uoTextBoxOverrideTax.Text,
                                                                    uoCheckOverrideBoxTaxInclusive.Checked, uoDropDownListRoomType.SelectedValue, uoTextBoxOverrideRoomCount.Text,
                                                                    uoHiddenFieldUser.Value);

                if (Convert.ToInt32(dtOverride.Rows[0]["dtReturnType"]) == 0)
                {
                    //Insert log audit trail (Gabriel Oquialda - 22/02/2012)
                    strLogDescription = "Hotel room override added.";
                    strFunction       = "SaveHotelRoomOverride";

                    DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(dtOverride.Rows[0]["dtHotelRoomID"]), "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, uoHiddenFieldUser.Value);
                }
                else if (Convert.ToInt32(dtOverride.Rows[0]["dtReturnType"]) == 1)
                {
                    //Insert log audit trail (Gabriel Oquialda - 22/02/2012)
                    strLogDescription = "Hotel room override updated.";
                    strFunction       = "SaveHotelRoomOverride";

                    DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(dtOverride.Rows[0]["dtHotelRoomID"]), "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, uoHiddenFieldUser.Value);
                }
                //AlertMessage();
                OpenParentPage("Room blocks successfully saved!");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #26
0
        private void GuardarButton_Click(object serder, RoutedEventArgs e)
        {
            if (!Validar())
            {
                return;
            }
            var paso = HotelBLL.Guardar(hotel);

            if (paso)
            {
                Limpiar();
                MessageBox.Show("Exito Exito", "Exito", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("Fallo", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #27
0
        ///// <summary>
        ///// Date Created: 23/08/2011
        ///// Created By: Ryan Bautista
        ///// (description) Select all hotel details by region
        ///// </summary>
        private void HotelLoad()
        {
            DataTable dt = null;

            try
            {
                dt = HotelBLL.HotelVendorGetDetailsByRegion(MUser.GetUserName());
                if (dt.Rows.Count > 0)
                {
                    uoDropDownListVendorMain.DataSource     = dt;
                    uoDropDownListVendorMain.DataTextField  = "colVendorNameVarchar";
                    uoDropDownListVendorMain.DataValueField = "colVendorIdInt";
                    uoDropDownListVendorMain.DataBind();
                    if (Request.QueryString["hvID"] != null)
                    {
                        uoDropDownListVendorMain.SelectedValue = Request.QueryString["hvID"];
                        uoDropDownListVendorMain.Enabled       = false;

                        if (uotextboxContractTitle.Text == "")
                        {
                            uotextboxContractTitle.Text = uoDropDownListVendorMain.SelectedItem.Text;
                        }
                    }
                }
                else
                {
                    uoDropDownListVendorMain.DataBind();
                }
                uoDropDownListVendorMain.Items.Insert(0, new ListItem("--Select Hotel--", "0"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Пример #28
0
        protected void uoButtonSave_Click(object sender, EventArgs e)
        {
            /// <summary>
            /// Date Created: 19/07/2011
            /// Created By: Ryan Bautista
            /// (description) Save Seafarer details
            /// ----------------------------------------
            /// Date Modified: 28/07/2011
            /// Modified By: Gabriel Oquialda
            /// (description) Added OpenParentPage() for
            ///               javascript fancybox close
            /// </summary>

            string   CheckInDateString = uoTextBoxCheckInDate.Text;
            string   CheckInTimeString = uoTextBoxCheckInTime.Text;
            DateTime CheckInDateTime   = GlobalCode.Field2DateTime(CheckInDateString + " " + CheckInTimeString);

            //if (Request.QueryString["hId"] == null)
            //{
            HotelBLL.InsertHotelBooking(Convert.ToInt32(uoHiddenFieldSfID.Value), Convert.ToInt32(uoDropDownListHotel.SelectedValue),
                                        Convert.ToInt32(uoDropDownListRoomType.SelectedValue),
                                        CheckInDateTime,
                                        Convert.ToInt32(uoTextBoxNoOfdays.Text),
                                        uoDropDownListHotelStatus.Text, GlobalCode.Field2String(Session["UserName"]), GlobalCode.Field2String(Session["strSFStatus"]),
                                        Request.QueryString["SeqNo"], Convert.ToInt32(uoDropDownListLocation.SelectedValue),
                                        CheckInTimeString, uoCheckBoxBreakfast.Checked, uoCheckBoxLunch.Checked, uoCheckBoxDinner.Checked,
                                        uoTextBoxRemarks.Text, uoCheckBoxCrewBill.Checked, uoCheckBoxShuttle.Checked);

            OpenParentPage();
            //}
            //else
            //{
            //    HotelBLL.UpdateHotelBooking(Int32.Parse(Request.QueryString["hId"].ToString()), Convert.ToInt32(uoDropDownListHotel.SelectedValue),
            //                                   Convert.ToInt32(uoDropDownListRoomType.SelectedValue),
            //                                   CheckInDateTime,
            //                                   Convert.ToInt32(uoTextBoxNoOfdays.Text),
            //                                   uoDropDownListHotelStatus.Text, GlobalCode.Field2String(Session["UserName"]), Convert.ToInt32(uoDropDownListLocation.SelectedValue),
            //                                   CheckInTimeString, uoCheckBoxBreakfast.Checked, uoCheckBoxLunch.Checked, uoCheckBoxDinner.Checked,
            //                                   uoTextBoxRemarks.Text, uoCheckBoxCrewBill.Checked);
            //}
        }
Пример #29
0
        private void BuscarBoton_Click(object sender, RoutedEventArgs e)
        {
            var lista = new List <Hotel>();

            if (CriterioTextBox.Text.Trim().Length > 0)
            {
                switch (FiltroComboBox.SelectedIndex)
                {
                case 0:
                    lista = HotelBLL.GetList(p => p.HotelID == Convert.ToInt32(CriterioTextBox.Text));
                    break;

                case 1:
                    lista = HotelBLL.GetList(p => p.NombreHotel == CriterioTextBox.Text);
                    break;

                case 2:
                    lista = HotelBLL.GetList(p => p.Direccion == CriterioTextBox.Text);
                    break;

                case 3:
                    lista = HotelBLL.GetList(p => p.Telefono == CriterioTextBox.Text);
                    break;
                }
            }


            else
            {
                lista = HotelBLL.GetList(c => true);
            }
            if (lista == null)
            {
                MessageBox.Show("Proyecto no encontrado", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            DatosDataGrid.ItemsSource = null;
            DatosDataGrid.ItemsSource = lista;
        }
Пример #30
0
        /// ----------------------------------------------
        /// Modified By:    Josephine Gad
        /// Date Modified:  02/10/2012
        /// Description:    Add option "Select ALL Hotel" ,"-1" if there is selected Region
        /// ----------------------------------------------
        /// </summary>
        private void GetHotelFilter()
        {
            List <HotelDTO> list = new List <HotelDTO>();

            try
            {
                list = HotelBLL.GetHotelBranchByRegionPortCountry(uoHiddenFieldUser.Value, uoDropDownListRegion.SelectedValue,
                                                                  uoDropDownListPort.SelectedValue, "0", uoDropDownListAirport.SelectedValue);

                int iRowCount = list.Count;
                if (iRowCount > 0)
                {
                    uoDropDownListHotel.Items.Clear();
                    uoDropDownListHotel.DataSource     = list;
                    uoDropDownListHotel.DataTextField  = "HotelNameString";
                    uoDropDownListHotel.DataValueField = "HotelIDString";
                    uoDropDownListHotel.DataBind();
                    uoDropDownListHotel.Items.Insert(0, new ListItem("--Select Hotel--", "0"));

                    //if (uoDropDownListHotel.Items.FindByValue("-1") != null)
                    //{
                    //    uoDropDownListHotel.Items.Remove(new ListItem("--Select ALL Hotel--", "-1"));
                    //}

                    //RemoveDuplicateItems(uoDropDownListHotel);
                    uoDropDownListHotel.Enabled = true;
                }
                else
                {
                    uoDropDownListHotel.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }