예제 #1
0
        /// <summary>
        /// Date Created:   13/02/2012
        /// Created By:     Josephine Gad
        /// (description)   get default values
        /// ---------------------------------------
        /// Date Modified:  27/03/2012
        /// Modified By:    Josephine Gad
        /// (description)   Change dt or URLs from QueryString to uoHiddenFieldDate.value
        /// ---------------------------------------
        /// Date Modified:  22/05/2012
        /// Modified By:    Josephine Gad
        /// (description)   Add binding of uoDropDownListRegion on first load
        /// ---------------------------------------
        /// Date Modified:  23/05/2012
        /// Modified By:    Josephine Gad
        /// (description)   Remove  iBranchID = GlobalCode.Field2Int(Session["Hotel"]), because there is no filter for branch in this design
        /// ---------------------------------------
        /// Modified By:    Josephine gad
        /// Date Modified:  03/10/2012
        /// Description:    Change HotelDashboardDTO.RegionList to List<RegionList> listRegion
        ///                 Change HotelDashboardDTO.HotelExceptionCount to Session["HotelDashboardDTO_HotelExceptionCount"]
        ///                 Change HotelDashboardDTO.HotelOverflowCount to Session["HotelDashboardDTO_HotelOverflowCount"]
        ///                 Change HotelDashboardDTO.NoTravelRequestCount to Session["HotelDashboardDTO_NoTravelRequestCount"]
        ///                 Change HotelDashboardDTO.ArrDeptSameOnOffDateCount to Session["HotelDashboardDTO_ArrDeptSameOnOffDateCount"]
        /// </summary>
        /// <param name="LoadType"></param>
        protected void LoadDefaults(Int16 LoadType)
        {
            string sBranchName;
            Int32  iBranchID = 0;

            if (LoadType == 0)
            {
                iBranchID = 0;
            }
            if (uoHiddenFieldRole.Value == TravelMartVariable.RoleHotelVendor)
            {
                sBranchName = "";
            }
            else
            {
                sBranchName = uoTextBoxSearch.Text.Trim();
            }
            uoHiddenFieldBranchID.Value = iBranchID.ToString();

            if (LoadType == 0)
            {
                uoHiddenFieldFromDefaultView.Value = "0";
            }
            else
            {
                uoHiddenFieldFromDefaultView.Value = "1";
            }

            HotelDashboardBLL bll = new HotelDashboardBLL();

            string sBranch;

            if (uoHiddenFieldRole.Value == TravelMartVariable.RoleHotelVendor)
            {
                sBranch = "";
            }
            else
            {
                sBranch = uoTextBoxSearch.Text.Trim();
            }

            bll.LoadHotelDashboardList2(GlobalCode.Field2TinyInt(uoHiddenFieldLoadType.Value),
                                        GlobalCode.Field2Int(Session["Region"]),
                                        GlobalCode.Field2Int(Session["Country"]),
                                        GlobalCode.Field2Int(Session["City"]),
                                        GlobalCode.Field2Int(Session["Port"]),
                                        uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                        GlobalCode.Field2Int(uoHiddenFieldBranchID.Value),
                                        GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                        GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                        sBranch, 0, 50);

            //uoListViewDashboard.DataSource = null;
            uoListViewDashboard.DataSourceID = "uoObjectDataSourceDashboard";
            //uoListViewDashboard.DataBind();


            Int32 ExceptionCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_HotelExceptionCount"]);//(Int32)HotelDashboardDTO.HotelExceptionCount;

            if (ExceptionCount >= 0)
            {
                uoHyperLinkException.Visible     = true;
                uoHyperLinkException.Text        = "Exception(" + ExceptionCount.ToString() + ")";
                uoHyperLinkException.NavigateUrl = "/Hotel/HotelExceptionBookings.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            }
            else
            {
                uoHyperLinkException.Visible = false;
            }

            Int32 OverflowCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_HotelOverflowCount"]);//(Int32)HotelDashboardDTO.HotelOverflowCount;

            if (OverflowCount >= 0)
            {
                uoHyperLinkOverflow.Visible     = true;
                uoHyperLinkOverflow.Text        = "Overflow(" + OverflowCount.ToString() + ")";
                uoHyperLinkOverflow.NavigateUrl = "/Hotel/HotelOverflowBooking3.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            }
            else
            {
                uoHyperLinkOverflow.Visible = false;
            }

            Int32 NoTravelRequestCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_NoTravelRequestCount"]);//GlobalCode.Field2Int(HotelDashboardDTO.NoTravelRequestCount);

            if (NoTravelRequestCount >= 0)
            {
                uoHyperLinkNoHotelRequest.Visible     = true;
                uoHyperLinkNoHotelRequest.Text        = "No Travel Request(" + NoTravelRequestCount.ToString() + ")";
                uoHyperLinkNoHotelRequest.NavigateUrl = "NoTravelRequest2.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            }
            else
            {
                uoHyperLinkNoHotelRequest.Visible = false;
            }

            Int32 ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_ArrDeptSameOnOffDateCount"]);//GlobalCode.Field2Int(HotelDashboardDTO.ArrDeptSameOnOffDateCount);

            if (ArrDeptSameOnOffDateCount >= 0)
            {
                uoHyperLinkArrDepSameDate.Visible     = true;
                uoHyperLinkArrDepSameDate.Text        = "Same Day Arr/Dep(" + ArrDeptSameOnOffDateCount.ToString() + ")";
                uoHyperLinkArrDepSameDate.NavigateUrl = "ArrivalDepartureSameDate.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            }
            else
            {
                uoHyperLinkArrDepSameDate.Visible = false;
            }

            Int32 NoHotelContractCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_NoContractCount"]);//GlobalCode.Field2Int(HotelDashboardDTO.NoContractCount);

            if (NoHotelContractCount >= 0)
            {
                uoHyperLinkNoHotelContract.Visible     = true;
                uoHyperLinkNoHotelContract.Text        = "Non Turn Ports(" + NoHotelContractCount.ToString() + ")";
                uoHyperLinkNoHotelContract.NavigateUrl = "/Hotel/HotelNonTurnPortsPA.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value + "&ex=" + "11";
            }
            else
            {
                uoHyperLinkNoHotelContract.Visible = false;
            }
            Int32 RestrictedNationalityCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_RestrictedNationalityCount"]);

            if (RestrictedNationalityCount >= 0)
            {
                uoHyperLinkRestrictedNationality.Visible     = true;
                uoHyperLinkRestrictedNationality.Text        = "Restricted Nationalities(" + RestrictedNationalityCount.ToString() + ")";
                uoHyperLinkRestrictedNationality.NavigateUrl = "RestrictedNationality.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            }

            if (LoadType == 0)
            {
                List <RegionList> listRegion = new List <RegionList>();
                listRegion = (List <RegionList>)Session["HotelDashboardDTO_RegionList"];

                uoDropDownListRegion.Items.Clear();
                uoDropDownListRegion.DataSource     = listRegion;
                uoDropDownListRegion.DataTextField  = "RegionName";
                uoDropDownListRegion.DataValueField = "RegionId";
                uoDropDownListRegion.DataBind();
                uoDropDownListRegion.Items.Insert(0, new ListItem("--Select Region--", "0"));

                DateTime dtE1CHProcess = TMSettings.E1CHLastProcessedDate;
                uoLabelE1Processed.Text = "E1 Crew History Last Processed: " + dtE1CHProcess.ToString("MMM/dd/yyyy HH:mm tt");
            }
            string sRegion = GlobalCode.Field2String(Session["Region"]);

            if (sRegion != "")
            {
                if (uoDropDownListRegion.Items.FindByValue(sRegion) != null)
                {
                    uoDropDownListRegion.SelectedValue = sRegion;
                }
            }
            BindPort();
        }
예제 #2
0
        /// <summary>
        /// Date Modified:  16/08/2012
        /// Modified By:    Jefferson Bermundo
        /// (description)   Clean Copy of HotelView4
        /// -------------------------------------------
        /// Modified By:    Josephine Gad
        /// Date Modified:  03/10/2012
        /// Description:    Change HotelDashboardDTO.RegionList to List<RegionList> listRegion
        ///                 Change HotelDashboardDTO.HotelExceptionCount to Session["HotelDashboardDTO_HotelExceptionCount"]
        ///                 Change HotelDashboardDTO.HotelOverflowCount to Session["HotelDashboardDTO_HotelOverflowCount"]
        ///                 Change HotelDashboardDTO.NoTravelRequestCount to Session["HotelDashboardDTO_NoTravelRequestCount"]
        ///                 Change HotelDashboardDTO.ArrDeptSameOnOffDateCount to Session["HotelDashboardDTO_ArrDeptSameOnOffDateCount"]
        /// -------------------------------------------
        /// Modified By:    Josephine Gad
        /// Date Modified:  11/10/2012
        /// Description:    Remove uoDropDownListRegion
        /// -------------------------------------------
        /// Modified By:    Josephine Gad
        /// Date Modified:  28/Nov/2012
        /// Description:    Add LoadHotelDashboardList2 for the default value
        ///                 Remove unnecessary links
        /// -------------------------------------------
        /// </summary>
        /// <param name="LoadType"></param>
        protected void LoadDefaults(Int16 LoadType)
        {
            string sBranchName;
            Int32  iBranchID = 0;

            if (LoadType == 0)
            {
                iBranchID = 0;
            }
            if (uoHiddenFieldRole.Value == TravelMartVariable.RoleHotelVendor)
            {
                sBranchName = "";
            }

            if (Session["UserBranchId"] != null)
            {
                int.TryParse(Session["UserBranchId"].ToString(), out iBranchID);
                uoHiddenFieldBranchId.Value = Session["UserBranchId"].ToString();
            }
            uoHiddenFieldBranchId.Value = iBranchID.ToString();

            HotelDashboardBLL bll = new HotelDashboardBLL();

            bll.LoadHotelDashboardList2(GlobalCode.Field2TinyInt(uoHiddenFieldLoadType.Value),
                                        GlobalCode.Field2Int(Session["Region"]),
                                        GlobalCode.Field2Int(Session["Country"]),
                                        GlobalCode.Field2Int(Session["City"]),
                                        GlobalCode.Field2Int(Session["Port"]),
                                        uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                        iBranchID,
                                        GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                        GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                        "", 0, 50);

            //uoListViewDashboard.DataSource = null;
            uoListViewDashboard.DataSourceID = "uoObjectDataSourceDashboard";
            //uoListViewDashboard.DataBind();

            //Int32 ExceptionCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_HotelExceptionCount"]);//(Int32)HotelDashboardDTO.HotelExceptionCount;
            //if (ExceptionCount >= 0)
            //{
            //    uoHyperLinkException.Visible = true;
            //    uoHyperLinkException.Text = "Exception(" + ExceptionCount.ToString() + ")";
            //    uoHyperLinkException.NavigateUrl = "/Hotel/HotelExceptionBookings.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            //}
            //else
            //{
            //    uoHyperLinkException.Visible = false;
            //}

            //Int32 OverflowCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_HotelOverflowCount"]);//(Int32)HotelDashboardDTO.HotelOverflowCount;
            //if (OverflowCount >= 0)
            //{
            //    uoHyperLinkOverflow.Visible = true;
            //    uoHyperLinkOverflow.Text = "Overflow(" + OverflowCount.ToString() + ")";
            //    uoHyperLinkOverflow.NavigateUrl = "/Hotel/HotelOverflowBooking3.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            //}
            //else
            //{
            //    uoHyperLinkOverflow.Visible = false;
            //}

            //Int32 NoTravelRequestCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_NoTravelRequestCount"]);//GlobalCode.Field2Int(HotelDashboardDTO.NoTravelRequestCount);
            //if (NoTravelRequestCount >= 0)
            //{
            //    uoHyperLinkNoHotelRequest.Visible = true;
            //    uoHyperLinkNoHotelRequest.Text = "No Travel Request(" + NoTravelRequestCount.ToString() + ")";
            //    uoHyperLinkNoHotelRequest.NavigateUrl = "NoTravelRequest2.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            //}
            //else
            //{
            //    uoHyperLinkNoHotelRequest.Visible = false;
            //}

            //Int32 ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(Session["HotelDashboardDTO_ArrDeptSameOnOffDateCount"]);//GlobalCode.Field2Int(HotelDashboardDTO.ArrDeptSameOnOffDateCount);
            //if (ArrDeptSameOnOffDateCount >= 0)
            //{
            //    uoHyperLinkArrDepSameDate.Visible = true;
            //    uoHyperLinkArrDepSameDate.Text = "Same Day Arr/Dep(" + ArrDeptSameOnOffDateCount.ToString() + ")";
            //    uoHyperLinkArrDepSameDate.NavigateUrl = "ArrivalDepartureSameDate.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldDate.Value;
            //}
            //else
            //{
            //    uoHyperLinkArrDepSameDate.Visible = false;
            //}
        }