void LoadImmigrationCompany(string userid, bool isPostBack)
        {
            MaintenanceViewBLL BLL = new MaintenanceViewBLL();
            List <ImmigrationCompanyGenericClass> ImmigrationCom = new List <ImmigrationCompanyGenericClass>();

            ImmigrationCom = BLL.GetImmigationCompany(userid);

            uoListviewImmigrationCompany.DataSource = ImmigrationCom[0].ImmigrationCompany;
            uoListviewImmigrationCompany.DataBind();


            if (isPostBack == true)
            {
                cboCountry.Items.Clear();
                cboCountry.Items.Add(new ListItem("--Select Country--", "0"));

                cboCountry.DataSource = ImmigrationCom[0].Country.OrderBy(n => n.CountryName);

                cboCountry.DataTextField  = "CountryName";
                cboCountry.DataValueField = "CountryID";
                cboCountry.DataBind();


                Session["Country"] = ImmigrationCom[0].Country;

                cboCity.Items.Clear();
                cboCity.Items.Add(new ListItem("--Select City--", "0"));
            }
        }
        protected void uoListViewPortAgent_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            string strLogDescription;
            string strFunction;

            int index = GlobalCode.Field2Int(e.CommandArgument);

            if (e.CommandName == "Delete")
            {
                MaintenanceViewBLL.DeleteVehicleVendor(index, uoHiddenFieldUser.Value);

                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "Vehicle vendor branch deleted. (flagged as inactive)";
                strFunction       = "uoListViewPortAgent_ItemCommand";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                BLL.AuditTrailBLL.InsertLogAuditTrail(index, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, uoHiddenFieldUser.Value);

                GetPortAgentList();
            }
            else if (e.CommandName != "")
            {
                uoHiddenFieldSortBy.Value = e.CommandName;
                GetPortAgentList();
            }
            else
            {
                uoHiddenFieldSortBy.Value = "SortByName";
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Date Created:   26/12/2011
        /// Created By:     Josephine Gad
        /// (description)   Save stripes and room types
        /// -------------------------------------------
        /// </summary>
        private void SaveStripeRoom()
        {
            DataTable dtStripeRoom = null;

            if (uoHiddenFieldStripe.Value != "")
            {
                dtStripeRoom = MaintenanceViewBLL.SaveStripeRoomType("0", uoHiddenFieldStripe.Value, uoHiddenFieldRoomID.Value,
                                                                     DateTime.Parse(uoHiddenFieldEffectiveDate.Value), uoHiddenFieldContractLength.Value, GlobalCode.Field2String(Session["UserName"]));

                uoDropDownListStripes.SelectedValue = "";
                uoDropDownListRoom.SelectedValue    = "0";

                if (GlobalCode.Field2Int(dtStripeRoom.Rows[0]["dtReturnType"]) == 0)
                {
                    string strLogDescription;
                    string strFunction;

                    //Insert log audit trail (Gabriel Oquialda - 16/02/2012)
                    strLogDescription = "Hotel stripe and room type added.";
                    strFunction       = "SaveStripeRoom";

                    DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                    AuditTrailBLL.InsertLogAuditTrail(GlobalCode.Field2Int(dtStripeRoom.Rows[0]["dtStripeRoomID"]), "", strLogDescription, strFunction, Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                      CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                }
                else
                {
                    AlertMessage("Hotel stripe and room type with same effective date already exists.");
                }
            }
        }
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   04/Jul/2014
        /// Description:    Insert/Delete hotel-brand-hotel matrix
        /// </summary>
        private void SaveBrandAirportHotel()
        {
            DataTable dtBrand   = null;
            DataTable dtAirport = null;

            try
            {
                List <AirportDTO> listAirportAssigned = new List <AirportDTO>();
                listAirportAssigned = GetAirportAssigned();
                var listAirport = (from a in listAirportAssigned
                                   select new
                {
                    AirportIDString = GlobalCode.Field2Int(a.AirportIDString)
                }).ToList();


                dtBrand = new DataTable();
                DataColumn colBrandID = new DataColumn("colBrandID", typeof(Int32));
                dtBrand.Columns.Add(colBrandID);
                DataRow rowBrand;

                dtAirport = new DataTable();
                DataColumn colAirportID = new DataColumn("colAirportID", typeof(Int32));
                dtAirport.Columns.Add(colAirportID);

                for (int i = 0; i < uoCheckBoxListBrand.Items.Count; i++)
                {
                    if (uoCheckBoxListBrand.Items[i].Selected)
                    {
                        rowBrand = dtBrand.NewRow();
                        rowBrand["colBrandID"] = GlobalCode.Field2Int(uoCheckBoxListBrand.Items[i].Value);
                        dtBrand.Rows.Add(rowBrand);
                    }
                }
                dtAirport = getDataTable(listAirport);

                DateTime dateNow = CommonFunctions.GetCurrentDateTime();
                MaintenanceViewBLL.BrandAirportHotelSave(GlobalCode.Field2Int(uoHiddenFieldHotelID.Value),
                                                         uoHiddenFieldUser.Value, "Save Hotel Brand Airport matrix", "SaveBrandAirportHotel",
                                                         Path.GetFileName(Request.Path),
                                                         CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, dtBrand, dtAirport);

                ClosePage("");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dtBrand != null)
                {
                    dtBrand.Dispose();
                }
                if (dtAirport != null)
                {
                    dtAirport.Dispose();
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   16/08/2012
        /// Description:    Bind Airport
        /// </summary>
        private void BindAirport()
        {
            List <Airport> air = new List <Airport>();

            air = MaintenanceViewBLL.GetAirportList(uoHiddenFieldUser.Value,
                                                    uoHiddenFieldRole.Value, 0, 0, true);

            uoDropDownListPort.Items.Clear();
            if (air.Count > 0)
            {
                uoDropDownListPort.DataSource     = air;
                uoDropDownListPort.DataTextField  = "AirportName";
                uoDropDownListPort.DataValueField = "AirportID";
            }
            uoDropDownListPort.DataBind();
            if (air.Count == 1)
            {
                if (uoDropDownListPort.Items.FindByValue(GlobalCode.Field2String(air[0].AirportID)) != null)
                {
                    uoDropDownListPort.SelectedValue = GlobalCode.Field2String(air[0].AirportID);
                }
            }
            if (GlobalCode.Field2String(Session["Airport"]) != "")
            {
                if (uoDropDownListPort.Items.FindByValue(GlobalCode.Field2String(Session["Airport"])) != null)
                {
                    uoDropDownListPort.SelectedValue = GlobalCode.Field2String(Session["Airport"]);
                }
            }
            uoDropDownListPort.Items.Insert(0, new ListItem("--Select Airport--", "0"));
            Session["Airport"] = uoDropDownListPort.SelectedValue;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Date Created:      28/12/2011
        /// Created By:        Josephine Gad
        /// (description)      Save Priority
        /// </summary>
        private void SavePriority()
        {
            foreach (ListViewItem item in uoHotelVendorList.Items)
            {
                string strLogDescription;
                string strFunction;

                HiddenField uoHiddenFieldBranchID = (HiddenField)item.FindControl("uoHiddenFieldBranchID");
                TextBox     uoTextBoxPriority     = (TextBox)item.FindControl("uoTextBoxPriority");

                if (uoHiddenFieldBranchID != null)
                {
                    Int32 AirportHotelID = MaintenanceViewBLL.SaveHotelPriority(uoDropDownListAirport.SelectedValue, uoHiddenFieldBranchID.Value, uoTextBoxPriority.Text, GlobalCode.Field2String(Session["UserName"]));

                    //Insert log audit trail (Gabriel Oquialda - 14/02/2012)
                    strLogDescription = "Hotel branch priority updated.";
                    strFunction       = "SavePriority";

                    DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(AirportHotelID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Date Created:    26/12/2011
        /// Created By:      Josephine Gad
        /// (description)    Get list of stripes
        /// -------------------------------------------
        /// Date Modified:   24/02/2012
        /// Modified By:     Josephine Gad
        /// (description)    Change DataTable to Stripe.StripeList
        /// -------------------------------------------
        /// Date Modified:   31/05/2012
        /// Modified By:     Josephine Gad
        /// (description)    Do not use Stripe.StripeList
        /// -------------------------------------------
        /// </summary>
        private void BindStripes()
        {
            List <Stripe> list = null;

            try
            {
                //if (Stripe.StripeList == null)
                //{
                list = MaintenanceViewBLL.GetStripes();
                //}
                uoDropDownListStripes.Items.Clear();

                if (list.Count > 0)
                {
                    uoDropDownListStripes.DataTextField  = "StripeName";
                    uoDropDownListStripes.DataValueField = "Stripes";
                    uoDropDownListStripes.DataSource     = list;
                }
                uoDropDownListStripes.DataBind();
                uoDropDownListStripes.Items.Insert(0, new ListItem("--Select Stripe--", ""));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //finally
            //{
            //    if (list != null)
            //    {
            //        list = null;
            //    }
            //}
        }
        /// <summary>
        /// Date Created:   08/09/2011
        /// Created By:     Gabriel Oquialda
        /// (description)   Get the list of vehicle vendors branch
        /// ----------------------------------------------
        /// Date Modified:  28/10/2011
        /// Modified By:    Josephine Gad
        /// (description)   Change uoDropDownListRegion.SelectedValue to GlobalCode.Field2String(Session["Region"])
        /// </summary>
        private void GetVehicleVendorBranchListByUser(string strVehicleName)
        {
            uoVehicleVendorList.DataSource = MaintenanceViewBLL.GetVehicleVendorBranchListByUser(strVehicleName, GlobalCode.Field2String(Session["UserName"]),
                                                                                                 GlobalCode.Field2String(Session["Region"]), Session["Country"].ToString(),
                                                                                                 Session["City"].ToString(), Session["Port"].ToString(), Session["Hotel"].ToString(), GlobalCode.Field2String(Session["UserRole"]));

            uoVehicleVendorList.DataBind();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Date Created:      07/03/2012
        /// Created By:        Josephine Gad
        /// (description)      Add try and catch and dispose DataTable
        /// ---------------------------------------------------------------------
        /// </summary>
        protected void DeleteAirport(Int32 AirportSeaportID, string AirportID, string AirportCode, string AirportName)
        {
            List <Airport> AirportList = null;
            Airport        AirportItem = null;

            List <Airport> AirportNotInList = null;

            try
            {
                AirportList      = AirportInSeaport(false);
                AirportNotInList = AirportNotInSeaport(false);

                string strLogDescription;
                string strFunction;

                if (uoHiddenFieldPortID.Value != "" && uoHiddenFieldPortID.Value != "0")
                {
                    if (AirportSeaportID != 0)
                    {
                        strLogDescription = "Airport deleted from Seaport. (flagged as inactive)";
                        strFunction       = "DeleteAirport";

                        MaintenanceViewBLL.RemoveAirportInSeaport(uoHiddenFieldUser.Value, AirportID, uoHiddenFieldPortID.Value,
                                                                  strLogDescription, strFunction, Path.GetFileName(Request.Path));
                    }
                }

                AirportItem = new Airport();
                AirportItem.AirportSeaportID = 0;
                AirportItem.AirportID        = GlobalCode.Field2TinyInt(AirportID);
                AirportItem.AirportCode      = AirportCode;
                AirportItem.AirportName      = AirportName;
                AirportItem.AirportCodeName  = AirportName + " :: " + AirportCode;

                AirportNotInList.Add(AirportItem);
                AirportList.RemoveAll(a => a.AirportID == GlobalCode.Field2TinyInt(AirportID));

                Airport.AirportList      = AirportList;
                Airport.AirportNotInList = AirportNotInList;

                uoGridViewAirport.DataSource         = AirportList;
                uoGridViewAirport.Columns[0].Visible = true;
                uoGridViewAirport.Columns[1].Visible = true;
                uoGridViewAirport.DataBind();
                uoGridViewAirport.Columns[0].Visible = false;
                uoGridViewAirport.Columns[1].Visible = false;

                LoadAirportDDL(false);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }
        }
Ejemplo n.º 10
0
        protected void btnSave_click(object sender, EventArgs e)
        {
            MaintenanceViewBLL        BLL            = new MaintenanceViewBLL();
            List <ImmigrationCompany> ImmigrationCom = new List <ImmigrationCompany>();
            var list = BLL.SaveImmigationCompany(GlobalCode.Field2Int(uoHiddenFieldImmigrationCompanyID.Value), GlobalCode.Field2Int(cboCountry.SelectedValue), GlobalCode.Field2Int(cboCity.SelectedValue), txtCompany.Text.ToString(), txtAddress.Text.ToString(), txtEmailAdd.Text.ToString(), txtPhoneNo.Text.ToString(), (Request.QueryString["uID"] != null) ? Request.QueryString["uID"] : "");

            uoListviewImmigrationCompany.DataSource = list;
            uoListviewImmigrationCompany.DataBind();
        }
Ejemplo n.º 11
0
        private void GetVehicleVendorList(string strVehicleName)
        {
            /// <summary>
            /// Date Created: 04/08/2011
            /// Created By: Marco Abejar
            /// (description) Get the list of vehicle vendors
            /// </summary>

            uoVehicleVendorList.DataSource = MaintenanceViewBLL.GetVehicleVendorList(strVehicleName, GlobalCode.Field2String(Session["UserName"]), uoDropDownListRegion.SelectedValue);
            uoVehicleVendorList.DataBind();
        }
        //protected void uoDropDownListRegion_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    GetPortList(uoTextBoxSearchParam.Text);
        //}
        #endregion


        #region Functions

        private void GetPortList(string strPortName)
        {
            /// <summary>
            /// Date Created: 04/08/2011
            /// Created By: Marco Abejar
            /// (description) Get the list of ports
            /// </summary>

            uoPortCompanyList.DataSource = MaintenanceViewBLL.GetPortCompanyList(strPortName, GlobalCode.Field2String(Session["UserName"]), Session["Region"].ToString());
            uoPortCompanyList.DataBind();
        }
        /// <summary>
        /// Date Created:   07/03/2012
        /// Created By:     Josephine Gad
        /// (description)   Remove Airport in Seaport
        /// </summary>
        /// <param name="sAirport"></param>
        /// <param name="sBranch"></param>
        private void DeleteHotelInAirport(string sAirport, string sBranch)
        {
            string strLogDescription;
            string strFunction;

            //Insert log audit trail (Gabriel Oquialda - 16/02/2012)
            strLogDescription = "Delete button from list clicked.";
            strFunction       = "DeleteHotelInAirport";

            MaintenanceViewBLL.RemoveHotelInAirport(uoHiddenFieldUser.Value, sAirport, sBranch, strLogDescription,
                                                    strFunction, Path.GetFileName(Request.Path));
        }
        private void SaveAirports()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("airportID", typeof(int));
            DataRow     rowAirport;
            HiddenField uoHiddenFieldAirport;

            DataTable dtBrand = null;

            dtBrand = new DataTable();
            DataColumn colBrandID = new DataColumn("colBrandID", typeof(Int32));

            dtBrand.Columns.Add(colBrandID);
            DataRow rowBrand;
            int     portAgent = GlobalCode.Field2Int(Request.QueryString["pid"]);

            try {
                foreach (ListViewItem item in uoListViewAirportSaved.Items)
                {
                    uoHiddenFieldAirport = (HiddenField)item.FindControl("uoHiddenFieldAirportSaved");
                    //uoCheckBoxListBrand = (CheckBoxList)item.FindControl("uoCheckBoxListBrand");
                    UserAirportList AirportItem = new UserAirportList();

                    int airport = GlobalCode.Field2Int(uoHiddenFieldAirport.Value);
                    //get brand and user id of user
                    string stringger = Request.RawUrl.ToString();

                    rowAirport = dt.NewRow();
                    rowAirport["airportID"] = airport;
                    dt.Rows.Add(rowAirport);
                }

                for (int i = 0; i < uoCheckBoxListBrand.Items.Count; i++)
                {
                    if (uoCheckBoxListBrand.Items[i].Selected)
                    {
                        rowBrand = dtBrand.NewRow();
                        rowBrand["colBrandID"] = GlobalCode.Field2Int(uoCheckBoxListBrand.Items[i].Value);
                        dtBrand.Rows.Add(rowBrand);
                    }
                }
                MaintenanceViewBLL.BrandAirportVehicleSave(portAgent, dt, dtBrand, uoHiddenFieldUser.Value);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally{
            }
        }
Ejemplo n.º 15
0
        protected void uoListviewImmigrationCompany_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (String.Equals(e.CommandName, "delete"))
            {
                MaintenanceViewBLL        BLL            = new MaintenanceViewBLL();
                List <ImmigrationCompany> ImmigrationCom = new List <ImmigrationCompany>();

                var list = BLL.DeleteImmigationCompany(GlobalCode.Field2Int(uoHiddenFieldImmigrationCompanyID.Value), (Request.QueryString["uID"] != null) ? Request.QueryString["uID"] : "");

                uoListviewImmigrationCompany.DataSource = list;
                uoListviewImmigrationCompany.DataBind();
            }
            else if (String.Equals(e.CommandName, "edit"))
            {
                Label lblCompanyName = (Label)e.Item.FindControl("lblCompanyName");
                Label lblEmailAdd    = (Label)e.Item.FindControl("lblEmailAdd");
                Label lblContact     = (Label)e.Item.FindControl("lblContact");
                Label lblAddress     = (Label)e.Item.FindControl("lblAddress");

                HiddenField HFImmigrationCompanyID = (HiddenField)e.Item.FindControl("HFImmigrationCompanyID");
                HiddenField HFCountryID            = (HiddenField)e.Item.FindControl("HFCountryID");
                HiddenField HFCityID = (HiddenField)e.Item.FindControl("HFCityID");


                txtCompany.Text  = lblCompanyName.Text;
                txtAddress.Text  = lblAddress.Text;
                txtEmailAdd.Text = lblEmailAdd.Text;
                lblAddress.Text  = lblAddress.Text;
                uoHiddenFieldImmigrationCompanyID.Value = HFImmigrationCompanyID.Value;



                cboCountry.SelectedIndex = GlobalCode.GetselectedIndexValue(cboCountry, HFCountryID.Value);


                List <Country> country = (List <Country>)Session["Country"];
                List <Country> City    = country.Where(n => n.CountryID == GlobalCode.Field2Int(HFCountryID.Value)).OrderBy(a => a.CountryName).ToList();


                cboCity.Items.Clear();
                cboCity.Items.Add(new ListItem("--Select City--", "0"));


                cboCity.DataSource     = City[0].City;
                cboCity.DataTextField  = "CityName";
                cboCity.DataValueField = "CityId";
                cboCity.DataBind();

                cboCity.SelectedIndex = GlobalCode.GetselectedIndexValue(cboCity, HFCityID.Value);
            }
        }
Ejemplo n.º 16
0
 //private void GetHotelVendorList(string strHotelName)
 //{
 //    /// <summary>
 //    /// Date Created: 04/08/2011
 //    /// Created By: Marco Abejar
 //    /// (description) Get the list of hotel vendors
 //    /// </summary>
 //    //GlobalCode.Field2String(Session["Region"]),
 //    // GlobalCode.Field2String(Session["Country"]),
 //    //GlobalCode.Field2String(Session["City"]),
 //    //GlobalCode.Field2String(Session["Port"]),
 //    //GlobalCode.Field2String(Session["Hotel"]);
 //    uoHotelVendorList.DataSource = MaintenanceViewBLL.GetHotelVendorList(strHotelName, GlobalCode.Field2String(Session["UserName"]), uoDropDownListRegion.SelectedValue);
 //    uoHotelVendorList.DataBind();
 //}
 /// <summary>
 /// Date Created:   04/08/2011
 /// Created By:     Marco Abejar
 /// (description)   Get the list of hotel vendors
 /// --------------------------------------------------
 /// Date Modified:  27/10/2011
 /// Modified By:    Josephine Gad
 /// (description)   Validate if user role is not empty
 /// </summary>
 private void GetHotelVendorListByUser(string strHotelName)
 {
     //GlobalCode.Field2String(Session["Region"]),
     // GlobalCode.Field2String(Session["Country"]),
     //GlobalCode.Field2String(Session["City"]),
     //GlobalCode.Field2String(Session["Port"]),
     //GlobalCode.Field2String(Session["Hotel"]);
     if (Session["UserRole"] == null)
     {
         Session["UserRole"] = UserAccountBLL.GetUserPrimaryRole(GlobalCode.Field2String(Session["UserName"]));
     }
     uoHotelVendorList.DataSource = MaintenanceViewBLL.GetHotelVendorListByUser(strHotelName, GlobalCode.Field2String(Session["UserName"]),
                                                                                GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["UserVendor"]), GlobalCode.Field2String(Session["UserRole"]));
     uoHotelVendorList.DataBind();
 }
Ejemplo n.º 17
0
        /// <summary>
        /// Date Created:   26/12/2011
        /// Created By:     Josephine Gad
        /// (description)   Delete stripes and room types
        /// -------------------------------------------
        /// </summary>
        /// <param name="StripeRoomID"></param>
        private void DeleteStripeRoom(string StripeRoomID)
        {
            MaintenanceViewBLL.DeleteStripeRoomType(StripeRoomID, GlobalCode.Field2String(Session["UserName"]));

            string strLogDescription;
            string strFunction;

            //Insert log audit trail (Gabriel Oquialda - 16/02/2012)
            strLogDescription = "Hotel stripe and room type deleted. (flagged as inactive)";
            strFunction       = "SaveStripeRoom";

            DateTime dateNow = CommonFunctions.GetCurrentDateTime();

            AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(StripeRoomID), "", strLogDescription, strFunction, Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                              CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Date Created:      07/03/2012
        /// Created By:        Josephine Gad
        /// (description)      Get Airport not in Seaport
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <Airport> AirportNotInSeaport(bool IsNew)
        {
            List <Airport> list = new List <Airport>();

            if (IsNew || Airport.AirportNotInList == null)
            {
                list = MaintenanceViewBLL.GetAirportList(uoHiddenFieldUser.Value,
                                                         uoHiddenFieldRole.Value, GlobalCode.Field2Int(uoHiddenFieldPortID.Value), 0, false);
                Airport.AirportNotInList = list;
            }
            else
            {
                if (Airport.AirportNotInList == null)
                {
                    List <Airport> AirportNotInList = new List <Airport>();
                    Airport        AirportItem      = new Airport();

                    string[] sAirportNameCode;
                    string   sCode;
                    string   sName;
                    for (int i = 1; i <= uoDropDownListAiport.Items.Count; i++)
                    {
                        sAirportNameCode = uoDropDownListAiport.Items[i].Text.Split("::".ToCharArray());
                        if (sAirportNameCode.Length > 0)
                        {
                            sCode = sAirportNameCode[2].Trim();
                            sName = sAirportNameCode[0].Trim();

                            AirportItem = new Airport();
                            AirportItem.AirportSeaportID = 0;
                            AirportItem.AirportID        = GlobalCode.Field2TinyInt(uoDropDownListAiport.Items[i].Value);
                            AirportItem.AirportCode      = sCode;
                            AirportItem.AirportName      = sName;

                            AirportNotInList.Add(AirportItem);
                        }
                    }
                    Airport.AirportNotInList = AirportNotInList;
                }
                else
                {
                    list = Airport.AirportNotInList;
                }
            }
            return(list);
        }
        private void GetHotelVendorBranchList(string strHotelName)
        {
            DataTable dt = null;

            try
            {
                if (Session["UserRole"] == null)
                {
                    Session["UserRole"] = UserAccountBLL.GetUserPrimaryRole(GlobalCode.Field2String(Session["UserName"]));
                }
                dt = MaintenanceViewBLL.GetHotelVendorBranchListByUser(strHotelName,
                                                                       GlobalCode.Field2String(Session["UserName"]),
                                                                       GlobalCode.Field2String(Session["Region"]),
                                                                       GlobalCode.Field2String(Session["Country"]),
                                                                       GlobalCode.Field2String(Session["Airport"]),
                                                                       GlobalCode.Field2String(Session["Port"]),
                                                                       "0",
                                                                       GlobalCode.Field2String(Session["UserRole"]),
                                                                       uoHiddenFieldSortByBranch.Value,
                                                                       uoHiddenFieldSortByPriority.Value
                                                                       );
                //var results = from myRow in dt.AsEnumerable()
                //              where myRow.Field<int>(uoHiddenFieldOrderBy.Value) == 1
                //              select myRow;
                //uoHotelVendorList.DataSource = results;
                DataView dtview = dt.DefaultView;
                uoHiddenFieldOrderBy.Value = (uoHiddenFieldOrderBy.Value == "SortByBranchName") ? "colVendorBranchNameVarchar" : uoHiddenFieldOrderBy.Value;
                dtview.Sort = uoHiddenFieldOrderBy.Value;
                uoHotelVendorList.DataSource = dtview.ToTable();
                uoHotelVendorList.DataSource = dt;
                uoHotelVendorList.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Ejemplo n.º 20
0
        //private void GetHotelVendorList(string strHotelName)
        //{
        //    /// <summary>
        //    /// Date Created: 04/08/2011
        //    /// Created By: Marco Abejar
        //    /// (description) Get the list of hotel vendors
        //    /// </summary>
        //    //GlobalCode.Field2String(Session["Region"]),
        //    // GlobalCode.Field2String(Session["Country"]),
        //    //GlobalCode.Field2String(Session["City"]),
        //    //GlobalCode.Field2String(Session["Port"]),
        //    //GlobalCode.Field2String(Session["Hotel"]);
        //    uoHotelVendorList.DataSource = MaintenanceViewBLL.GetHotelVendorList(strHotelName, GlobalCode.Field2String(Session["UserName"]), uoDropDownListRegion.SelectedValue);
        //    uoHotelVendorList.DataBind();
        //}
        /// <summary>
        /// Date Created:   04/08/2011
        /// Created By:     Marco Abejar
        /// (description)   Get the list of hotel vendors
        /// --------------------------------------------------
        /// Date Modified:  27/10/2011
        /// Modified By:    Josephine Gad
        /// (description)   Validate if user role is not empty
        /// /// --------------------------------------------------
        /// Date Modified:  18/03/2013
        /// Modified By:    Marco Abejar
        /// (description)   Add sorting
        /// </summary>
        private void GetHotelVendorListByUser(string strHotelName)
        {
            //GlobalCode.Field2String(Session["Region"]),
            // GlobalCode.Field2String(Session["Country"]),
            //GlobalCode.Field2String(Session["City"]),
            //GlobalCode.Field2String(Session["Port"]),
            //GlobalCode.Field2String(Session["Hotel"]);

            DataTable dt = MaintenanceViewBLL.GetHotelVendorListByUser(strHotelName, GlobalCode.Field2String(Session["UserName"]),
                                                                       GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["UserVendor"]), GlobalCode.Field2String(Session["UserRole"]));
            DataView dtView = dt.DefaultView;

            if (dt.Rows.Count > 0 && uoHiddenFieldOrderBy.Value != "0")
            {
                dtView.Sort = uoHiddenFieldOrderBy.Value;
            }
            uoHotelVendorList.DataSource = dtView.ToTable();
            uoHotelVendorList.DataBind();
        }
        /// <summary>
        /// Date Created:   02/Jul/2014
        /// Created By:     Josephine Gad
        /// (description)   Refresh Branch List based from filter
        /// </summary>
        public List <VendorHotelList> GetBranch(int iRegionID, int iAirportID, string sAirportName,
                                                Int16 iRoomTypeID, int iBrandID, string sBranchFilter, string sOrderBy,
                                                Int16 iLoadType, string sUserID, int iStartRow, int iMaxRow)
        {
            if (Session["HotelAirportBrand_Hotel"] == null)
            {
                sAirportName  = GlobalCode.Field2String(sAirportName);
                sBranchFilter = GlobalCode.Field2String(sBranchFilter);

                MaintenanceViewBLL BLL = new MaintenanceViewBLL();
                BLL.GetHotelVendorBranchListByBrand(iRegionID, iAirportID, sAirportName.Trim(),
                                                    iRoomTypeID, iBrandID, sBranchFilter.Trim(),
                                                    sOrderBy, iLoadType, sUserID, iStartRow, iMaxRow);
            }

            List <VendorHotelList> listHotel = new List <VendorHotelList>();

            listHotel = (List <VendorHotelList>)Session["HotelAirportBrand_Hotel"];
            return(listHotel);
        }
        /// <summary>
        /// Date Created:   01/Jul/2014
        /// Created By:     Josephine Gad
        /// (description)   Bind the details inside this page
        /// </summary>
        private void BindPage()
        {
            int   iRegionID   = GlobalCode.Field2Int(Session["Region"]);
            int   iAirportID  = GlobalCode.Field2Int(uoDropDownListAirport.SelectedValue);
            Int16 iRoomTypeID = GlobalCode.Field2TinyInt(uoDropDownListRoom.SelectedValue);
            int   iBrandID    = GlobalCode.Field2Int(uoDropDownListBrand.SelectedValue);


            MaintenanceViewBLL BLL = new MaintenanceViewBLL();

            BLL.GetHotelVendorBranchListByBrand(iRegionID, iAirportID, uoTextBoxAirport.Text.Trim(),
                                                iRoomTypeID, iBrandID, uoTextBoxSearchParam.Text.Trim(),
                                                uoHiddenFieldOrderBy.Value, 0, uoHiddenFieldUser.Value, 0, uoListViewHotelPager.PageSize);

            BindRegion();
            BindBrand();
            BindAirport(0);
            BindRoomType();

            //BindBranch();
            uoListViewHotel.DataSourceID = "uoObjectDataSourceHotel";
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Date Created:   26/12/2011
        /// Created By:     Josephine Gad
        /// (description)   Get list of stripes and room types
        /// -------------------------------------------
        /// </summary>
        private void BindStripesRoomTypes()
        {
            DataTable dt = null;

            try
            {
                dt = MaintenanceViewBLL.GetStripesRoomType();
                uoStripesRoomList.DataSource = dt;
                uoStripesRoomList.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Date Created:   28/May/2013
        /// Created By:     Josephine Gad
        /// (description)   Bind Airport by Seaport
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetAirport()
        {
            List <Airport> list = new List <Airport>();

            list = MaintenanceViewBLL.GetAirportListByRegionBySeaport(uoHiddenFieldUser.Value,
                                                                      "", GlobalCode.Field2Int(uoDropDownListPort.SelectedValue), GlobalCode.Field2Int(uoDropDownListRegion.SelectedValue));
            uoDropDownListAirport.Items.Clear();
            uoDropDownListAirport.Items.Insert(0, new ListItem("--Select Airport--", "0"));
            uoDropDownListAirport.DataSource     = list;
            uoDropDownListAirport.DataTextField  = "AirportCodeName";
            uoDropDownListAirport.DataValueField = "AirportID";

            uoDropDownListAirport.DataBind();
            if (list.Count == 1)
            {
                if (uoDropDownListAirport.Items.FindByValue(GlobalCode.Field2String(list[0].AirportID)) != null)
                {
                    uoDropDownListAirport.SelectedValue = GlobalCode.Field2String(list[0].AirportID);
                }
            }

            uoHiddenFieldAirPort.Value = uoDropDownListAirport.SelectedValue;
        }
Ejemplo n.º 25
0
        protected void uoListViewVehicle_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            string strLogDescription;
            string strFunction;

            int index = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Delete")
            {
                MaintenanceViewBLL.DeleteVehicleTypeBranch(index, GlobalCode.Field2String(Session["UserName"]));

                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "Vehicle vendor branch vehicle type deleted. (flagged as inactive)";
                strFunction       = "uoListViewVehicle_ItemCommand";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path),
                //                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));

                vehicleTypeBranchInfoLoad(Request.QueryString["vmId"]);
            }
        }
Ejemplo n.º 26
0
        protected void uoHotelVendorList_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            string strLogDescription;
            string strFunction;

            int index = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Delete")
            {
                MaintenanceViewBLL.DeleteHotelVendor(index, GlobalCode.Field2String(Session["UserName"]));

                //Insert log audit trail (Gabriel Oquialda - 14/02/2012)
                strLogDescription = "Hotel vendor deleted. (flagged as inactive)";
                strFunction       = "uoHotelVendorList_ItemCommand";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                BLL.AuditTrailBLL.InsertLogAuditTrail(index, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));

                GetHotelVendorList("");
            }
        }
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   03/Jul/2014
        /// Description:    Load value of selected hotel
        /// </summary>
        private void BindPage()
        {
            MaintenanceViewBLL.GetHotelDetails(GlobalCode.Field2Int(uoHiddenFieldHotelID.Value));

            List <VendorHotelList> listHotel = new List <VendorHotelList>();
            List <BrandList>       listBrand = new List <BrandList>();
            List <AirportDTO>      listAirportNotAssigned = new List <AirportDTO>();
            List <AirportDTO>      listAirportAssigned    = new List <AirportDTO>();

            listHotel = (List <VendorHotelList>)Session["HotelAirportBrandPop_Hotel"];
            if (listHotel.Count > 0)
            {
                uoTextBoxHotelName.Text = listHotel[0].HotelName;
            }

            listBrand = (List <BrandList>)Session["HotelAirportBrandPop_Brand"];
            if (listBrand.Count > 0)
            {
                uoCheckBoxListBrand.DataSource     = listBrand;
                uoCheckBoxListBrand.DataTextField  = "BrandName";
                uoCheckBoxListBrand.DataValueField = "BrandID";
                uoCheckBoxListBrand.DataBind();

                for (int i = 0; i < listBrand.Count; i++)
                {
                    uoCheckBoxListBrand.Items[i].Selected = listBrand[i].IsAssigned;
                }
            }

            listAirportNotAssigned = (List <AirportDTO>)Session["HotelAirportBrandPop_AirportNotAssigned"];
            uoListViewAirportNotAssigned.DataSource = listAirportNotAssigned;
            uoListViewAirportNotAssigned.DataBind();

            listAirportAssigned = (List <AirportDTO>)Session["HotelAirportBrandPop_AirportAssigned"];
            uoListViewAirportAssigned.DataSource = listAirportAssigned;
            uoListViewAirportAssigned.DataBind();
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Date Created:      07/03/2012
        /// Created By:        Josephine Gad
        /// (description)      Get Airport in Seaport
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <Airport> AirportInSeaport(bool IsNew)
        {
            List <Airport> list = new List <Airport>();

            if (IsNew || Airport.AirportList == null)
            {
                list = MaintenanceViewBLL.GetAirportList(uoHiddenFieldUser.Value,
                                                         uoHiddenFieldRole.Value, GlobalCode.Field2Int(uoHiddenFieldPortID.Value), 0, true);

                Airport.AirportList = list;
            }
            else
            {
                if (Airport.AirportList == null)
                {
                    List <Airport> AirportList = new List <Airport>();
                    Airport        AirportItem = new Airport();
                    for (int i = 0; i < uoGridViewAirport.Rows.Count; i++)
                    {
                        AirportItem = new Airport();

                        AirportItem.AirportSeaportID = GlobalCode.Field2Int(uoGridViewAirport.Rows[i].Cells[0].Text);
                        AirportItem.AirportID        = GlobalCode.Field2TinyInt(uoGridViewAirport.Rows[i].Cells[1].Text);
                        AirportItem.AirportCode      = uoGridViewAirport.Rows[i].Cells[2].Text;
                        AirportItem.AirportName      = uoGridViewAirport.Rows[i].Cells[3].Text;

                        AirportList.Add(AirportItem);
                    }
                    Airport.AirportList = AirportList;
                }
                else
                {
                    list = Airport.AirportList;
                }
            }
            return(list);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Date Created:   04/08/2011
        /// Created By:     Marco Abejar
        /// (description)   Get the list of hotel vendors branch
        /// --------------------------------------------------
        /// Date Modified:  27/10/2011
        /// Modified By:    Josephine Gad
        /// (description)   Validate if user role is not empty
        ///                 Add DatTable dt to close
        /// </summary>
        private void GetHotelVendorBranchList(string strHotelName)
        {
            DataTable dt = null;

            try
            {
                if (Session["UserRole"] == null)
                {
                    Session["UserRole"] = UserAccountBLL.GetUserPrimaryRole(GlobalCode.Field2String(Session["UserName"]));
                }
                dt = MaintenanceViewBLL.GetHotelVendorBranchListByUser(strHotelName,
                                                                       GlobalCode.Field2String(Session["UserName"]),
                                                                       GlobalCode.Field2String(Session["Region"]),
                                                                       GlobalCode.Field2String(Session["Country"]),
                                                                       GlobalCode.Field2String(Session["Airport"]),
                                                                       GlobalCode.Field2String(Session["Port"]),
                                                                       "0",
                                                                       GlobalCode.Field2String(Session["UserRole"]),
                                                                       uoHiddenFieldSortByBranch.Value,
                                                                       uoHiddenFieldSortByPriority.Value
                                                                       );
                uoHotelVendorList.DataSource = dt;
                uoHotelVendorList.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
        /// <summary>
        /// Date Created:   03/Jul/2014
        /// Created By:     Josephine Gad
        /// (description)   Save Priority
        /// </summary>
        private void SavePriority()
        {
            DataTable dt = null;

            try
            {
                DateTime dateNow = CommonFunctions.GetCurrentDateTime();
                dt = new DataTable();

                DataColumn col = new DataColumn("colBrandAirHotelIDInt", typeof(int));
                dt.Columns.Add(col);

                col = new DataColumn("colBranchIDInt", typeof(int));
                dt.Columns.Add(col);

                col = new DataColumn("colBrandIdInt", typeof(int));
                dt.Columns.Add(col);

                col = new DataColumn("colAirportIDInt", typeof(int));
                dt.Columns.Add(col);

                col = new DataColumn("colPriorityTinyint", typeof(Int16));
                dt.Columns.Add(col);

                col = new DataColumn("colRoomIDInt", typeof(Int16));
                dt.Columns.Add(col);

                DataRow r;
                int     iTotalRow = uoListViewHotel.Items.Count;

                HiddenField hBrandAirportHoteID;
                TextBox     tPriority;

                //for (int i = 0; i < iTotalRow; i++ )
                foreach (ListViewItem item in uoListViewHotel.Items)
                {
                    hBrandAirportHoteID = (HiddenField)item.FindControl("uoHiddenFieldBrandAirportHoteID");
                    tPriority           = (TextBox)item.FindControl("uoTextBoxPriority");

                    r = dt.NewRow();
                    r["colBrandAirHotelIDInt"] = GlobalCode.Field2Int(hBrandAirportHoteID.Value);
                    r["colPriorityTinyint"]    = GlobalCode.Field2TinyInt(tPriority.Text);

                    dt.Rows.Add(r);
                }

                MaintenanceViewBLL.BrandAirportHotelSavePriority(uoHiddenFieldUser.Value,
                                                                 "Save Brand Airport Hotel Priority", "SavePriority", Path.GetFileName(Request.Path),
                                                                 CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, dt);

                AlertMessage("Priority successfully saved!");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }