Exemplo n.º 1
0
 /// <summary>
 /// Date Created:   27/03/2013
 /// Created By:     Marco Abejar
 /// (description)   Save Hotel Request Companion
 /// ---------------------------------------------------------------------------
 /// </summary>
 private void AddHotelRequestCompanion()
 {
     try
     {
         SeafarerBLL.SeafarerSaveComapnionRequest(
             uoHiddenFieldHotelRequestDetailID.Value,
             uoHiddenFieldHotelRequestID.Value,
             uoTextBoxCompLastname.Text,
             uoTextBoxCompFirstname.Text,
             uoTextBoxCompRelationship.Text,
             uoDropDownListCompGender.SelectedValue,
             uoHiddenFieldUser.Value
             );
         uoCheckBoxAddCompanion.Checked          = false;
         uoTextBoxCompFirstname.Text             = "";
         uoTextBoxCompLastname.Text              = "";
         uoTextBoxCompRelationship.Text          = "";
         uoDropDownListCompGender.SelectedIndex  = 0;
         uoHiddenFieldHotelRequestDetailID.Value = "0";
         GetSFCompanion();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     { }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Date Created:   14/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get seafarer's name
        /// </summary>
        /// <returns></returns>
        private string AirGetSeafarerName()
        {
            IDataReader dr = null;
            string      SeafarernameString = "";

            try
            {
                dr = SeafarerBLL.SeafarerGetDetails(Session["strSFCode"].ToString(),
                                                    GlobalCode.Field2String(Session["TravelRequestID"]), GlobalCode.Field2String(Session["ManualRequestID"]), true);
                if (dr.Read())
                {
                    SeafarernameString = dr["NAME"].ToString();
                }
                return(SeafarernameString);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Dispose();
                }
            }
        }
        /// <summary>
        /// Date Created:   26/June/2015
        /// Created By:     Josephine monteza
        /// (description)   Get Seafarer list
        /// ---------------------------------------------
        /// </summary>
        private void BindSeafarer()
        {
            List <SeafarerListDTO> list = new List <SeafarerListDTO>();

            if (uoDropDownListReportBy.SelectedValue == "1" || uoDropDownListReportBy.SelectedValue == "2")
            {
                list = SeafarerBLL.GetSeafarerListByFilter(uoDropDownListReportBy.SelectedValue, uoTextBoxSearch.Text.Trim());
            }

            uoDropDownListFilter.Items.Clear();

            uoDropDownListFilter.DataSource     = list;
            uoDropDownListFilter.DataTextField  = "Name";
            uoDropDownListFilter.DataValueField = "SFID";
            uoDropDownListFilter.DataBind();

            ListItem item = new ListItem("--SELECT SEAFARER--", "0");

            uoDropDownListFilter.Items.Insert(0, item);

            if (list.Count == 1)
            {
                uoDropDownListFilter.SelectedValue = list[0].SFID;
            }
            else
            {
                uoDropDownListFilter.SelectedValue = "0";
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Date Created:   04/10/2011
        /// Created By:     Josephine Gad
        /// (description)   Get Seafarer details by E1 ID
        /// ---------------------------------------------
        /// Date Modified:   17/02/2012
        /// Modified By:     Josephine Gad
        /// (description)    Change DataTable to List
        /// ---------------------------------------------
        /// </summary>
        /// <param name="E1ID"></param>
        private void GetSeafarerDetails(string E1ID)
        {
            List <SeafarerDTO> list = null;

            try
            {
                list = SeafarerBLL.GetSeafarerByFilter("2", E1ID);
                if (list.Count > 0)
                {
                    uoTextBoxNationality.Text = list[0].Nationality;          //dr["Nationality"].ToString();
                    uoTextBoxGender.Text      = list[0].Gender;               //dr["Gender"].ToString();
                    uoTextBoxRank.Text        = list[0].Rank;                 //dr["Rank"].ToString();
                    uoTextBoxCostCenter.Text  = list[0].CostCenter;           //dr["CostCenter"].ToString();

                    uoHiddenFieldNationalityID.Value = list[0].NationalityID; //dr["NationalityID"].ToString();
                    uoHiddenFieldRankID.Value        = list[0].RankID;        //dr["RankID"].ToString();
                    uoHiddenFieldCostCenterID.Value  = list[0].CostCenterID;  //dr["CostCenterID"].ToString();
                }
                else
                {
                    ClearSeafererDetails();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (list != null)
                {
                    list = null;
                }
            }
        }
Exemplo n.º 5
0
        private DataTable GetSfCompanionDataTable()
        {
            DataTable dtSFInfo = null;

            try
            {
                dtSFInfo = SeafarerBLL.SeafarerGetCompanionDetails(uoHiddenFieldHotelRequestID.Value);
                return(dtSFInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        private IDataReader GetSfInfoDataTable()
        {
            IDataReader dtSFInfo = null;

            try
            {
                dtSFInfo = SeafarerBLL.SeafarerGetRequestDetails(Request.QueryString["sfID"].ToString(),
                                                                 uoHiddenFieldTravelRequestID.Value, uoHiddenFieldHotelRequestID.Value, uoHiddenFieldHotelRequestApp.Value);
                return(dtSFInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Date Created:   04/02/2013
 /// Created By:     Marco Abejar
 /// (description)   Submit Hotel Request
 /// ---------------------------------------------------------------------------
 /// </summary>
 private void SubmitRequest()
 {
     try
     {
         SeafarerBLL.SeafarerSubmitRequest(uoHiddenFieldHotelRequestID.Value,
                                           uoHiddenFieldUser.Value, txtContactName.Text.Trim(),
                                           txtContactNo.Text.Trim(), "Submit Hotel Request", "SubmitRequest", Path.GetFileName(Request.Path));
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Successful", "alert('Request has been booked successfully.');", true);
         OpenParent();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     { }
 }
Exemplo n.º 8
0
        private void GetSeafarer()
        {
            /// <summary>
            /// Date Created: 19/07/2011
            /// Created By: Ryan Bautista
            /// (description) Populate Seafarer details in dropdown list
            /// </summary>

            DataTable dt = SeafarerBLL.GetSeafarer();

            if (dt.Rows.Count > 0)
            {
                this.uoDropDownListSeafarer.DataSource     = dt;
                this.uoDropDownListSeafarer.DataTextField  = "NAME";
                this.uoDropDownListSeafarer.DataValueField = "colSeafarerIdInt";
                this.uoDropDownListSeafarer.DataBind();
                this.uoDropDownListSeafarer.Items.Insert(0, new ListItem("- Select a Seafarer -", "0"));
            }
        }
Exemplo n.º 9
0
        private void seafarerGetName()
        {
            /// <summary>
            /// Date Created: 27/07/2011
            /// Created By: Gabriel Oquialda
            /// (description) Load seafarer name to dropdownlist
            /// </summary>

            DataTable dt = new DataTable();

            dt = SeafarerBLL.GetSeafarer();

            if (dt.Rows.Count > 0)
            {
                uoDropDownListSeafarerName.DataSource     = dt;
                uoDropDownListSeafarerName.DataTextField  = "NAME";
                uoDropDownListSeafarerName.DataValueField = "colSeafarerIdInt";
                uoDropDownListSeafarerName.DataBind();
                uoDropDownListSeafarerName.Items.Insert(0, new ListItem("- Select a Seafarer -", "0"));
            }
        }
Exemplo n.º 10
0
        private void GetSeafarerBySfID(string SfID)
        {
            /// <summary>
            /// Date Created: 19/07/2011
            /// Created By: Ryan Bautista
            /// (description) Populate Seafarer details in dropdown list by Seafarer ID
            /// </summary>

            IDataReader dt = SeafarerBLL.SeafarerGetDetails(SfID, "", "", true);

            if (dt.Read())
            {
                uoTextBoxBrand.Text  = dt["Brand"].ToString();
                uoTextBoxVessel.Text = dt["Vessel"].ToString();
                uoTextBoxRank.Text   = dt["Rank"].ToString();
            }
            else
            {
                uoTextBoxBrand.Text  = "";
                uoTextBoxVessel.Text = "";
                uoTextBoxRank.Text   = "";
            }
            dt.Dispose();
        }
Exemplo n.º 11
0
        /// <summary>
        /// Date Created:   27/03/2013
        /// Created By:     Marco Abejar
        /// (description)   Save Hotel Request
        /// ---------------------------------------------------------------------------
        /// Date Modified:  30/May/2013
        /// Modified By:    Josephine Gad
        /// (description)   Add Shuttle, Tax, Lunch Dinner, Airport and fields for Audit Trail
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void SaveRequest()
        {
            try
            {
                string strLogDescription;
                if (uoHiddenFieldHotelRequestApp.Value == "1")
                {
                    strLogDescription = "Add Hotel Request";
                }
                else
                {
                    strLogDescription = "Edit Hotel Request";
                }
                DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                string sHRID = SeafarerBLL.SeafarerSaveRequest(uoTextBoxRequestNo.Text
                                                               , uoTextBoxE1ID.Text
                                                               , uoTextBoxLastname.Text
                                                               , uoTextBoxFirstname.Text
                                                               , uoDropDownListGender.SelectedValue
                                                               , uoDropDownListRegion.SelectedValue
                                                               , uoDropDownListPort.SelectedValue
                                                               , uoDropDownListAirport.SelectedValue
                                                               , uoDropDownListHotel.SelectedValue
                                                               , uoTextBoxCheckinDate.Text
                                                               , uoTextBoxCheckoutDate.Text
                                                               , uoHiddenFieldNoOfNites.Value
                                                               , uoDropdownRoomOccupancy.SelectedValue
                                                               , uoCheckboxBreakfast.Checked
                                                               , uoCheckboxLunch.Checked
                                                               , uoCheckboxDinner.Checked
                                                               , uoCheckBoxLunchDinner.Checked
                                                               , uoCheckBoxIsWithShuttle.Checked

                                                               , uoDropDownListRank.SelectedValue
                                                               , uoDropDownListVessel.SelectedValue
                                                               , uoHiddenFieldCostCenterID.Value
                                                               , uoTextBoxRemarks.Text
                                                               , uoHiddenFieldSFStatus.Value
                                                               , uoTxtBoxTimeIn.Text
                                                               , uoTxtBoxTimeOut.Text
                                                               , uoTextBoxAmount.Text
                                                               , uoCheckContractBoxTaxInclusive.Checked
                                                               , uoTextBoxTaxPercent.Text

                                                               , uoHiddenFieldUser.Value
                                                               , uoHiddenFieldTravelRequestID.Value
                                                               , uoDropDownListCurrency.SelectedValue

                                                               , strLogDescription, "SaveRequest"
                                                               , Path.GetFileName(Request.UrlReferrer.AbsolutePath)
                                                               , CommonFunctions.GetDateTimeGMT(dateNow), dateNow
                                                               );

                uoHiddenFieldHotelRequestID.Value = (sHRID.Length > 0)
                        ? sHRID : uoHiddenFieldHotelRequestID.Value;

                if (uoListViewCompanionList.Items.Count > 0)
                {
                    OpenParent();
                }
                else
                {
                    uoCheckBoxAddCompanion.Checked = true;
                    uoTextBoxCompLastname.Focus();
                    uoHiddenFieldHotelRequestApp.Value = "1";
                    GetSFInfo();
                }
                uoListViewCompanion.Visible = true;
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Successful", "alert('Updates have been saved successfully.');", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            { }
        }
Exemplo n.º 12
0
        //protected void uoDropDownListAirport_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    GetHotelBranch();
        //}

        #endregion

        #region "Procedures"

        #region "Binding Objects"
        /// <summary>
        /// Date Created:   04/10/2011
        /// Created By:     Josephine Gad
        /// (description)   Get Seafarer list
        /// ---------------------------------------------
        /// Date Modified:   17/12/2012
        /// Modified By:     Josephine Gad
        /// (description)    Change Datatable to List
        /// ---------------------------------------------
        /// </summary>
        private void GetSeafarer()
        {
            List <SeafarerListDTO> list = null;

            try
            {
                list = SeafarerBLL.GetSeafarerListByFilter(uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim());
                ListItem item = new ListItem("--SELECT SEAFARER--", "0");
                uoDropDownListSeafarer.Items.Clear();
                uoDropDownListSeafarer.Items.Add(item);

                var listSeafarer = (from a in list
                                    select new {
                    Name = a.Name,
                    SFID = a.SFID
                }).ToList();

                uoDropDownListSeafarer.DataSource     = listSeafarer;
                uoDropDownListSeafarer.DataTextField  = "Name";
                uoDropDownListSeafarer.DataValueField = "SFID";
                uoDropDownListSeafarer.DataBind();

                if (listSeafarer.Count == 1)
                {
                    uoDropDownListSeafarer.SelectedIndex = 1;
                }
                else
                {
                    ClearSeafererDetails();
                    if (GlobalCode.Field2String(Request.QueryString["sfId"]) != "")
                    {
                        uoDropDownListSeafarer.SelectedValue = GlobalCode.Field2String(Request.QueryString["sfId"]);
                        GetSeafarerDetails(uoDropDownListSeafarer.SelectedValue);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (list != null)
                {
                    list = null;
                }
            }
            //DataTable dt = null;
            //try
            //{
            //    dt = SeafarerBLL.GetSeafarerByFilter(uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim());
            //    ListItem item = new ListItem("--SELECT SEAFARER--", "0");
            //    uoDropDownListSeafarer.Items.Clear();
            //    uoDropDownListSeafarer.Items.Add(item);
            //    uoDropDownListSeafarer.DataSource = dt;
            //    uoDropDownListSeafarer.DataTextField = "Name";
            //    uoDropDownListSeafarer.DataValueField = "SFID";
            //    uoDropDownListSeafarer.DataBind();

            //    if (dt.Rows.Count == 1)
            //    {
            //        uoDropDownListSeafarer.SelectedIndex = 1;
            //        GetSeafarerDetails(uoDropDownListSeafarer.SelectedValue);
            //    }
            //    else
            //    {
            //        ClearSeafererDetails();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    if (dt != null)
            //    {
            //        dt.Dispose();
            //    }
            //}
        }