Beispiel #1
0
        public SourceFileSymbol(PhpCompilation compilation, GlobalCode syntax)
        {
            Contract.ThrowIfNull(compilation);
            Contract.ThrowIfNull(syntax);

            _compilation = compilation;
            _syntax = syntax;
            _mainMethod = new SourceGlobalMethodSymbol(this);
        }
        /// <summary>
        /// Date Created:   08/Aug/2013
        /// Created By:     Josephine gad
        /// (description)   Get ListView of Vendor Vehicle Type
        /// </summary>
        private List <VendorVehicleType> GetVehicleVendorTypeList(int iLoadType)
        {
            List <VendorVehicleType> list = new List <VendorVehicleType>();

            if (iLoadType == 0)
            {
                if (Session["MeetAndGreetAirport"] != null)
                {
                    list = (List <VendorVehicleType>)Session["MeetAndGreetAirport"];
                }
            }
            else
            {
                VendorMaintenanceBLL.VehicleVendorsTypeGet(GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value));
                list = (List <VendorVehicleType>)Session["MeetAndGreetAirport"];
            }
            return(list);
        }
Beispiel #3
0
        protected void lstHotel_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.ListBox obj = (System.Web.UI.WebControls.ListBox)sender;
            ClearHotelObject(0);

            if (obj.SelectedItem.Text.Substring(0, 4) == "PA -")
            {
                GetCrewAssistPAHotelInformation(GlobalCode.Field2Long(obj.SelectedValue));
            }
            else if (obj.SelectedItem.Text.Substring(0, 4) == "HT -")
            {
                GetCrewAssistHotelInformation(obj);
            }
            else
            {
                //ClearHotelObject(0);
            }
        }
 /// <summary>
 /// Date Created:   24/01/2012
 /// Created By:     Josephine Gad
 /// (description)   Get list of hotel vendor branch by UserID and role with count
 /// ---------------------------------------------------------------
 /// Date Modified:  15/03/2013
 /// Modified By:    Marco Abejar
 /// (description)   Add orderby parameter
 /// </summary>
 public static DataTable GetHotelVendorBranchListByUserWithCount(string strHotelName,
                                                                 string strUser, string Region, string Country,
                                                                 string Airport, string Port, string Hotel, string UserRole,
                                                                 string LoadType, Int32 StartRow, Int32 MaxRow, string SortBy, string OrderBy, Int16 iRoomType)
 {
     try
     {
         return(MaintenanceViewDAL.GetHotelVendorBranchListByUserWithCount(strHotelName,
                                                                           strUser, GlobalCode.Field2Int(Region), GlobalCode.Field2Int(Country),
                                                                           GlobalCode.Field2Int(Airport), GlobalCode.Field2Int(Port),
                                                                           GlobalCode.Field2Int(Hotel), UserRole, GlobalCode.Field2TinyInt(LoadType),
                                                                           StartRow, MaxRow, SortBy, OrderBy, iRoomType));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #5
0
        /// <summary>
        // Author:          Josephine Gad
        /// Date Created:   05/07/2012
        /// Descrption:     Delete Travel Request Remarks
        /// -------------------------------------------------------
        /// </summary>
        /// <param name="RemarksID"></param>
        private void DeleteRemarks(int RemarksID)
        {
            try
            { 
                DateTime currentDate = CommonFunctions.GetCurrentDateTime();
                DateTime GMTDate = CommonFunctions.GetDateTimeGMT(currentDate);
                string sPageName = Path.GetFileName(Request.Path);

                BLL.DeleteTravelRequestRemarks(0, RemarksID, GlobalCode.Field2String(Request.QueryString["trID"]),
                    GlobalCode.Field2String(Session["UserName"]), "DeleteRemarks", sPageName, GMTDate, currentDate);
                BindRemarksList();
                AlertMessage("Record successfully deleted.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Date Created:   12/Nov/2013
        /// Created By:     Josephine gad
        /// (description)   Get ListView of PortAgent Vehicle Type
        /// </summary>
        private List <PortAgentVehicleType> GetPortAgentVehicleTypeList(int iLoadType)
        {
            List <PortAgentVehicleType> list = new List <PortAgentVehicleType>();

            if (iLoadType == 0)
            {
                if (Session["PortAgentVehicleType"] != null)
                {
                    list = (List <PortAgentVehicleType>)Session["PortAgentVehicleType"];
                }
            }
            else
            {
                VendorMaintenanceBLL.GetPortAgentVehicleType(GlobalCode.Field2Int(uoHiddenFieldPortAgentIdInt.Value));
                list = (List <PortAgentVehicleType>)Session["PortAgentVehicleType"];
            }
            return(list);
        }
Beispiel #7
0
 /// <summary>
 /// Date Created:   03/10/2011
 /// Created By:     Charlene Remotigue
 /// ------------------------------------------
 /// Date Modified:  16/03/2012
 /// Modified By:    Josephine Gad
 /// (description)   Replace Global Variable with Session
 /// -------------------------------------------
 /// </summary>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserName"] == null)
     {
         Response.Redirect("~/Login.aspx");
     }
     if (!IsPostBack)
     {
         if (GlobalCode.Field2String(Session["UserRole"]) == "")
         {
             string UserRolePrimary = UserAccountBLL.GetUserPrimaryRole(GlobalCode.Field2String(Session["UserName"]));
             Session["UserRole"] = UserRolePrimary;
         }
         uoHyperLinkCountryAdd.HRef = "CountryAdd.aspx?vrId=0&vcId=0&vcName=";
         //uoTextBoxSearchParam.Text = "";
         Session["strPrevPage"] = Request.RawUrl;
     }
 }
        //protected void uoVehicleContractList_ItemDeleting(object sender, ListViewDeleteEventArgs e)
        //{

        //}
        #endregion

        #region Functions
        /// <summary>
        /// Date Created: 18/08/2011
        /// Created By: Gabriel Oquialda
        /// (description) Get vendor vehicle contract List<ContractVehicle>
        /// ---------------------------------------------------
        /// Date Modified:  16/Aug/2013
        /// Modified By:    Josephine Gad
        /// (description)   Change DataTable to void and put it in Session
        /// </summary>
        /// </summary>
        public void GetVendorMeetGreetContractList()
        {
            List <ContractMeetAndGreet> list = new List <ContractMeetAndGreet>();

            list = MeetAndGreetBLL.GetVendorMeetAndGreetBranchContractByBranchID(GlobalCode.Field2String(Request.QueryString["vmId"]));

            if (list.Count > 0)
            {
                ucLabelVehicle.Text = list[0].VendorName + " Contract List";
            }
            else
            {
                ucLabelVehicle.Text = "Contract List";
            }

            uoVehicleContractList.DataSource = list;
            uoVehicleContractList.DataBind();
        }
Beispiel #9
0
        /// <summary>
        /// Date Created:   13/Jan/2014
        /// Created By:     Josephine Gad
        /// (description)   Bind Dashboard
        /// </summary>
        private void BindDashboard()
        {
            List <ExceptionsByMonth> list = new List <ExceptionsByMonth>();

            int   iYear;
            Int16 iMonth;
            int   iRegion;
            int   iPort;

            iYear   = GlobalCode.Field2Int(uoDropDownListYear.SelectedValue);
            iMonth  = GlobalCode.Field2TinyInt(uoDropDownListMonth.SelectedValue);
            iRegion = GlobalCode.Field2Int(uoDropDownListRegion.SelectedValue);
            iPort   = GlobalCode.Field2Int(uoDropDownListPortPerRegion.SelectedValue);

            list = BLL.GetExceptionByMonth(iYear, iMonth, iRegion, iPort, uoHiddenFieldUser.Value);
            uoListViewDashboard.DataSource = list;
            uoListViewDashboard.DataBind();
        }
        /// <summary>
        /// Modified by: Charlene Remotigue
        /// Date MOdified: 16/03/2012
        /// Description: Change TravelMartVariable to Session
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (GlobalCode.Field2String(Session["UserName"]) == "")
            {
                Response.Redirect("~/Login.aspx");
            }
            Session["strPrevPage"] = Request.RawUrl;

            if (!IsPostBack)
            {
                uoHiddenFieldUser.Value = GlobalCode.Field2String(Session["UserName"]);
                Session["VehiclePath"]  = Path.GetFileName(Request.Path);
                uoTextBoxVehicle.Text   = Request.QueryString["vbName"];
                VehicleContractListViewLogAuditTrail();
                GetVendorMeetGreetContractList();
                //uoHyperLinkVehicleAdd.HRef = "~/ContractManagement/VehicleContractAdd.aspx";
            }
        }
        /// <summary>
        /// Date Created:   07/Nov/2013
        /// Created By:     Josephine  Gad
        /// (description)   Remove Plate No in ListView
        /// </summary>
        protected void uoListViewPlateNo_ItemDeleting(object sender, ListViewDeleteEventArgs e)
        {
            HiddenField uoListHiddenFieldVehicleTypeID = (HiddenField)uoListViewPlateNo.Items[e.ItemIndex].FindControl("uoHiddenFieldVehicleTypeID");
            Label       uoListLabelPlateNo             = (Label)uoListViewPlateNo.Items[e.ItemIndex].FindControl("uoLabelPlateNo");

            List <VehiclePlate> list = new List <VehiclePlate>();

            list = GetVehicleVendorPlateNo(0);

            list.RemoveAll(a => list.Exists(b => a.VehicleTypeID == GlobalCode.Field2Int(uoListHiddenFieldVehicleTypeID.Value) &&
                                            a.VehiclePlateName.Trim() == uoListLabelPlateNo.Text.Trim()
                                            ));

            list = list.OrderBy(a => a.VehicleTypeName).ThenBy(a => a.VehiclePlateName).ToList();

            Session["VendorVehiclePlate"] = list;
            BindVehiclePlateNo(0);
        }
Beispiel #12
0
        protected void uoButtonSave_Click(object sender, EventArgs e)
        {
            string strLogDescription;
            string strFunction;

            Int32 MenuID = UserRightsBLL.InsertMenu(GlobalCode.Field2String(Session["SelectedRoleKey"]), uoDropDownListMenu.SelectedValue, GlobalCode.Field2String(Session["UserName"]));

            //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
            strLogDescription = "User menu added.";
            strFunction       = "uoButtonSave_Click";

            DateTime dateNow = CommonFunctions.GetCurrentDateTime();

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

            OpenParentPage();
        }
Beispiel #13
0
        protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
        {
            //MembershipUser mUser = Membership.GetUser(GlobalCode.Field2String(Session["UserName"]));
            //mUser.LastActivityDate = DateTime.Now.AddMinutes(-15);
            //Membership.UpdateUser(mUser);

            //FormsAuthentication.SignOut();
            //Response.Redirect("~/Login.aspx");
            MembershipUser mUser = Membership.GetUser(GlobalCode.Field2String(Session["UserName"]));

            if (mUser != null)
            {
                mUser.LastActivityDate = DateTime.Now.AddMinutes(-Membership.UserIsOnlineTimeWindow);
                Membership.UpdateUser(mUser);
            }
            FormsAuthentication.SignOut();
            Response.Redirect("~/Login.aspx");
        }
Beispiel #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = ConfigurationSettings.AppSettings["UnderMaintenance"].ToString();

            if (GlobalCode.Field2String(Request.QueryString["IsTest"]) == "1")
            {
                Response.Redirect("Login.aspx");
            }

            if (str == "0")
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                Response.Redirect("UnderMaintenance.html");
            }
        }
Beispiel #15
0
        /// <summary>
        /// Date Created: 03/10/2011
        /// Created By: Charlene Remotigue
        /// Descrition: binds country to listview
        /// </summary>

        private void BindCountry()
        {
            try
            {
                //uoHiddenFieldRegionId.Value = GlobalCode.Field2String(Session["Region"]);
                uoHiddenFieldRole.Value = GlobalCode.Field2String(Session["UserRole"]);;

                uoCountryList.Items.Clear();
                uoCountryList.DataSource   = null;
                uoCountryList.DataSourceID = "ObjectDataSource1";
                UpdatePanel2.Update();
                //uoTextBoxSearchParam.Text = "";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Date Created:   07/Nov/2013
        /// Created By:     Josephine Gad
        /// (description)   Get ListView of Plate No.
        /// </summary>
        private List <VehiclePlate> GetVehicleVendorPlateNo(int iLoadType)
        {
            List <VehiclePlate> list = new List <VehiclePlate>();

            if (iLoadType == 0)
            {
                if (Session["VendorVehiclePlate"] != null)
                {
                    list = (List <VehiclePlate>)Session["VendorVehiclePlate"];
                }
            }
            else
            {
                list = VendorMaintenanceBLL.VehicleVendorsPlateNoGet(GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value));
                Session["VendorVehiclePlate"] = list;
            }
            return(list);
        }
        /// <summary>
        /// Date Created:   22/02/2011
        /// Created By:     Josephine Gad
        /// (description)   disable lock button if past dates and if there is no data
        /// </summary>
        private void ButtonLockSettings()
        {
            if (uolistviewHotelInfo.Items.Count > 0)
            {
                uoButtonLock.Enabled = true;
            }
            else
            {
                uoButtonLock.Enabled = false;
            }

            string sDate = GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString();

            if (GlobalCode.Field2DateTime((sDate)) < DateTime.Parse(DateTime.Now.ToString("MM/dd/yyyy")))
            {
                uoButtonLock.Enabled = false;
            }
        }
        /// Date Created:   05/Jan/2015
        /// Created By:     Josephine Monteza
        /// (description)   tag record to TblTag_Hotel
        /// -------------------------------------------
        private void TagSeafarer(string sIdBigint, string sTRId, string sVendorID, string sRecLoc, string sE1Id, string sStatusOnOff)
        {
            string sUser = uoHiddenFieldUser.Value;
            string sRole = uoHiddenFieldRole.Value;

            string   strLogDescription = "Tag Seafarer To Vehicle Service Provider";
            string   strFunction       = "TagSeafarer";
            DateTime dateNow           = CommonFunctions.GetCurrentDateTime();

            VehicleBLL.TagtoVehicle(GlobalCode.Field2Long(sIdBigint), GlobalCode.Field2Long(sTRId), sRecLoc,
                                    GlobalCode.Field2Long(sE1Id), sStatusOnOff, 0, GlobalCode.Field2Int(sVendorID), "1",
                                    uoHiddenFieldUser.Value, strLogDescription, strFunction, Path.GetFileName(Request.Path));

            if (sVendorID != "0")
            {
                BindVehicleManifest(1);
            }
        }
        private void BindPortAgentDetails()
        {
            VendorMaintenanceBLL.GetPortAgentAirportBrand(GlobalCode.Field2Int(uoHiddenFieldPortAgentIDInt.Value), 0);

            List <VendorPortAgentDetails> list        = new List <VendorPortAgentDetails>();
            List <AirportDTO>             listAirport = new List <AirportDTO>();

            uoTextBoxAirport.Text       = "";
            uoTextBoxPortAgentName.Text = "";
            string[] sAirportArr = null;

            if (uoHiddenFieldAirportID.Value != "" && uoHiddenFieldAirportID.Value != "0")
            {
                sAirportArr = uoHiddenFieldAirportID.Value.Split("-".ToCharArray());
            }

            if (Session["PortAgentVendorDetails"] != null)
            {
                list = (List <VendorPortAgentDetails>)Session["PortAgentVendorDetails"];
                if (list.Count > 0)
                {
                    uoTextBoxPortAgentName.Text = list[0].PortAgentName;

                    if (Session["PortAgentAirport"] != null)
                    {
                        listAirport = (List <AirportDTO>)Session["PortAgentAirport"];
                        if (listAirport.Count > 0)
                        {
                            foreach (AirportDTO item in listAirport)
                            {
                                if (uoTextBoxAirport.Text != "")
                                {
                                    uoTextBoxAirport.Text += ", ";
                                }
                                if (sAirportArr.Contains(item.AirportIDString))
                                {
                                    //uoTextBoxAirport.Text += item.AirportCodeString;
                                }
                            }
                        }
                    }
                }
            }
        }
        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();
                }
            }
        }
Beispiel #21
0
        /// <summary>
        /// Modified By:    Josephine Gad
        /// Modified Date:  27/08/2012
        /// Description:    Call function to get the page's default values if Load Type = 0
        /// ------------------------------------------------------------------------
        /// Modified By:    Josephine Gad
        /// Modified Date:  20/Dec/2013
        /// Description:    Add uoCheckBoxNeedTransportALL
        /// </summary>
        private void GetTravelCrewTravelWithCount()
        {
            try
            {
                CrewAdminBLL bll = new CrewAdminBLL();
                List <CrewAdminGenericClass> list = new List <CrewAdminGenericClass>();
                //if (uoHiddenFieldLoadType.Value == "0")
                //{
                list = bll.LoadCrewListPage(GlobalCode.Field2TinyInt(uoHiddenFieldLoadType.Value),
                                            GlobalCode.Field2DateTime(uoHiddenFieldDate.Value), GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                            uoHiddenFieldUser.Value, uoHiddenFieldUserRole.Value, uoHiddenFieldOrderBy.Value, GlobalCode.Field2Int(Session["VesselID"]),
                                            uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(), uoDropDownListNationality.SelectedValue,
                                            uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue, uoRadioButtonListStatus.SelectedValue,
                                            GlobalCode.Field2TinyInt(uoDropDownListAirLeg.SelectedValue),
                                            GlobalCode.Field2TinyInt(uoDropDownListRouteFrom.SelectedValue),
                                            GlobalCode.Field2TinyInt(uoDropDownListRouteTo.SelectedValue),
                                            0, uoListViewManifestPager.PageSize);
                //}
                //if (uoHiddenFieldLoadType.Value == "0")
                //{
                BindControls(list);
                //}
                uoHiddenFieldLoadType.Value = "0";

                uoListViewCrewAdmin.DataSource   = null;
                uoListViewCrewAdmin.DataSourceID = "uoObjectDataSourceCrewAdmin";
                uoListViewCrewAdmin.DataBind();

                CheckBox chk = (CheckBox)uoListViewCrewAdminHeader.Controls[0].FindControl("uoCheckBoxNeedTransportALL");
                if (uoRadioButtonListStatus.SelectedValue == "0" || uoRadioButtonListStatus.SelectedValue == "ON")
                {
                    chk.Visible = false;
                }
                else
                {
                    chk.Visible = true;
                }
                //ListView1.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// Date Modified:  05/Nov/2013
        /// Modified By:    Josephine Gad
        /// (description)
        /// -------------------------------------------
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            Session["strPrevPage"] = Request.RawUrl;
            if (!IsPostBack)
            {
                uoHiddenFieldUser.Value = GlobalCode.Field2String(Session["UserName"]);

                GetPortAgentList();

                if (User.IsInRole(TravelMartVariable.RolePortSpecialist))
                {
                    uoHiddenFieldRole.Value = TravelMartVariable.RolePortSpecialist;
                }

                if (User.IsInRole(TravelMartVariable.RoleAdministrator))
                {
                    uoBtnPortAgentAdd.Visible = true;
                    //uoTableSearch.Visible = true;
                }
                else
                {
                    uoBtnPortAgentAdd.Visible = false;
                    uoHiddenFieldVendor.Value = "false";
                    if (User.IsInRole(TravelMartVariable.RoleHotelSpecialist))
                    {
                        uoHiddenFieldContractList.Value = "true";
                    }
                }
                BindRegionList();
                BindPortList();
            }
            else
            {
                if (uoHiddenFieldPopupPortAgent.Value == "1")
                {
                    GetPortAgentList();
                }
                uoHiddenFieldPopupPortAgent.Value = "0";
            }
        }
Beispiel #23
0
        /// <summary>
        /// Date Created:   27/12/2011
        /// Created By:     Josephine Gad
        /// (description)   Bind Country
        /// </summary>
        //private void BindCountry()
        //{
        //    DataTable dt = null;
        //    try
        //    {
        //        dt = CountryBLL.CountryListByRegion(uoDropDownListRegion.SelectedValue, "");
        //        uoDropDownListCountry.Items.Clear();
        //        uoDropDownListCountry.DataSource = dt;
        //        uoDropDownListCountry.DataTextField = "colCountryNameVarchar";
        //        uoDropDownListCountry.DataValueField = "colCountryIDInt";
        //        uoDropDownListCountry.DataBind();
        //        uoDropDownListCountry.Items.Insert(0, new ListItem("--SELECT COUNTRY--", "0"));
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //        if (dt != null)
        //        {
        //            dt.Dispose();
        //        }
        //    }
        //}
        /// <summary>
        /// Date Created:   19/01/2012
        /// Created By:     Gelo Oquialda
        /// (description)   Bind Airport
        /// -----------------------------------
        /// Date Modified:   07/Feb/2014
        /// Modified By:     Josephine Gad
        /// (description)    Change DataSource from dt to loop to add airport code
        /// </summary>
        private void BindAirport()
        {
            DataTable dt = null;

            try
            {
                dt = AirBLL.GetAirportByCountry("0", uoDropDownListRegion.SelectedValue, uoTextBoxSearchAirport.Text, "0");
                uoDropDownListAirport.Items.Clear();
                //uoDropDownListAirport.DataSource = dt;
                //uoDropDownListAirport.DataTextField = "colAirportNameVarchar";
                //uoDropDownListAirport.DataValueField = "colAirportIDInt";
                //uoDropDownListAirport.DataBind();
                ListItem item;
                string   sValue;
                string   sText;
                uoDropDownListAirport.Items.Insert(0, new ListItem("--SELECT AIRPORT--", "0"));

                int iTotal = dt.Rows.Count;
                for (int i = 0; i < iTotal; i++)
                {
                    sText = GlobalCode.Field2String(dt.Rows[i]["colAirportCodeVarchar"]).Trim() + "-" +
                            GlobalCode.Field2String(dt.Rows[i]["colAirportNameVarchar"]).Trim();
                    sValue = GlobalCode.Field2String(dt.Rows[i]["colAirportIDInt"]);
                    item   = new ListItem(sText, sValue);
                    uoDropDownListAirport.Items.Add(item);
                }

                if (uoDropDownListAirport.Items.FindByValue(uoHiddenFieldAirport.Value) != null)
                {
                    uoDropDownListAirport.SelectedValue = uoHiddenFieldAirport.Value;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Beispiel #24
0
        /// <summary>
        /// Date Created:   05/10/2011
        /// Created By:     Josephine gad
        /// (description)   Get list of Service Provider by port id
        /// ------------------------------------
        /// Date Modified:  11/11/2011
        /// Modified By:    Josephine gad
        /// (description)   Add Service Provider ID parameter
        /// ------------------------------------
        /// Date Modified:  14/02/2012
        /// Modified By:    Josephine gad
        /// (description)   Change return value from DataTable to List
        /// ------------------------------------
        /// </summary>
        /// <param name="PortID"></param>
        /// <returns></returns>
        //public static DataTable GetPortAgentByPortID(string PortID, string PortAgentID)
        public static List <PortAgentDTO> GetPortAgentByPortID(string PortID, string PortAgentID)
        {
            DataTable           dt            = null;
            DbCommand           command       = null;
            List <PortAgentDTO> portAgentList = null;

            try
            {
                Database db = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
                command = db.GetStoredProcCommand("uspGetPortAgentByPortID");
                db.AddInParameter(command, "@pPortIDInt", DbType.String, PortID);
                db.AddInParameter(command, "@pPortAgentID", DbType.String, PortAgentID);
                dt = db.ExecuteDataSet(command).Tables[0];

                portAgentList = (from a in dt.AsEnumerable()
                                 select new PortAgentDTO
                {
                    PortAgentID = GlobalCode.Field2Int(a["PortAgentID"]).ToString(),
                    PortAgentName = a["PortAgenName"].ToString()
                }).ToList();


                return(portAgentList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (command != null)
                {
                    command.Dispose();
                }
                if (portAgentList != null)
                {
                    portAgentList = null;
                }
            }
        }
Beispiel #25
0
        /// <summary>
        /// Author: Charlene Remotigue
        /// Date Created: 27/04/2012
        /// Description: set session values
        /// </summary>
        protected void InitializeValues()
        {
            if (GlobalCode.Field2String(Session["UserName"]) == "")
            {
                Session["UserName"] = User.Identity.Name;
            }

            MembershipUser sUser = Membership.GetUser(GlobalCode.Field2String(Session["UserName"]));

            if (sUser == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            else
            {
                if (!sUser.IsOnline)
                {
                    Response.Redirect("~/Login.aspx");
                }
            }
            Session["strPrevPage"] = Request.RawUrl;
            Session["HotelPath"]   = Path.GetFileName(Request.Path);

            if (GlobalCode.Field2String(Session["UserRole"]) == "")
            {
                Session["UserRole"] = UserAccountBLL.GetUserPrimaryRole(GlobalCode.Field2String(Session["UserName"]));
            }

            ShowHideAmendInactiveContractControls();

            //ListView1.DataSource = null;
            //ListView1.DataBind();

            //if (User.IsInRole(TravelMartVariable.RoleAdministrator) || User.IsInRole(TravelMartVariable.RoleContractManager))
            //{
            //    ListView1.DataSource = null;
            //    ListView1.DataBind();
            //}
            //else
            //{
            //    ListView2.DataSource = null;
            //    ListView2.DataBind();
            //}
        }
 /// <summary>
 /// Date Created: 03/10/2011
 /// Created By: Charlene Remotigue
 /// ------------------------------------------
 /// Date Modified:  16/03/2012
 /// Modified By:    Josephine Gad
 /// (description)   Replace Global Variable with Session
 /// -------------------------------------------
 /// </summary>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserName"] == null)
     {
         Response.Redirect("~/Login.aspx");
     }
     if (!IsPostBack)
     {
         if (GlobalCode.Field2String(Session["UserRole"]) == "")
         {
             string UserRolePrimary = UserAccountBLL.GetUserPrimaryRole(GlobalCode.Field2String(Session["UserName"]));
             Session["UserRole"] = UserRolePrimary;
         }
         uoHyperLinkCityAdd.HRef = "CityAdd.aspx?vcid=0";
         Session["strPrevPage"]  = Request.RawUrl;
         //uoCityList.DataSource = null;
         //uoCityList.DataBind();
     }
 }
Beispiel #27
0
        /// <summary>
        /// Date Created:   30/09/2011
        /// Created By:     Charlene Remotigue
        /// ------------------------------------------
        /// Date Modified:  16/03/2012
        /// Modified By:    Josephine Gad
        /// (description)   Replace Global Variable with Session
        /// -------------------------------------------
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            if (!IsPostBack)
            {
                Session["strPrevPage"]    = Request.RawUrl;
                uoHyperLinkRegionAdd.HRef = "RegionAdd.aspx?vmId=0&vmName=";

                uoHiddenFieldUser.Value = GlobalCode.Field2String(Session["UserName"]);
            }
            if (uoHiddenFieldIsDelete.Value == "1")
            {
                DeleteRegion();
            }
            uoHiddenFieldIsDelete.Value = "0";
        }
Beispiel #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["strPrevPage"]  = Request.RawUrl;
                uoHiddenFieldUser.Value = GlobalCode.Field2String(Session["UserName"]);

                HtmlTable uoTblDate = (HtmlTable)Master.FindControl("uoTblDate");
                uoTblDate.Style.Add("display", "none");

                BindRegionList();
                BindPortList();
                BindYear();
                BindMonth();
                BindDashboard();
            }
            ListView1.DataSource = null;
            ListView1.DataBind();
        }
Beispiel #29
0
        /// <summary>
        /// Date Created:   14/11/2011
        /// Created By:     Josephine Gad
        /// (description)   Create excel file of manifest and email
        /// ---------------------------------------------------------------------------
        /// ========================================================
        /// Date Modified:  15/03/2012
        /// Modified By:    Muhallidin G Wali
        /// (description)   Replace Global Variable with Session
        /// ========================================================
        /// </summary>
        //private void BindManifestExcel()
        //{
        //    DataTable dt = null;
        //    try
        //    {
        //        SeafarerTravelBLL bll = new SeafarerTravelBLL();
        //        dt = bll.GetTravelManifestWithCount(GlobalCode.Field2String(Session["DateFrom"]), Session["DateTo"],
        //            uoHiddenFieldUser.Value, Session["strPendingFilter"], Session["Region"],
        //            Session["Country"] Session["City"] , uoDropDownListStatus.SelectedValue,
        //            uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(), Session["Port"],
        //            GlobalCode.Field2String(Session["Hotel"]), Session["Vehicle"], uoDropDownListVessel.SelectedValue,
        //            uoDropDownListNationality.SelectedValue, uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue,
        //            Int16.Parse(uoHiddenFieldByVessel.Value), Int16.Parse(uoHiddenFieldByName.Value), Int16.Parse(uoHiddenFieldByRecLoc.Value),
        //            Int16.Parse(uoHiddenFieldByE1ID.Value), Int16.Parse(uoHiddenFieldByDateOnOff.Value), Int16.Parse(uoHiddenFieldByDateArrDep.Value),
        //            Int16.Parse(uoHiddenFieldByStatus.Value), Int16.Parse(uoHiddenFieldByBrand.Value), Int16.Parse(uoHiddenFieldByPort.Value),
        //            Int16.Parse(uoHiddenFieldByRank.Value), Int16.Parse(uoHiddenFieldByAirStatus.Value),
        //            Int16.Parse(uoHiddenFieldByHotelStatus.Value), Int16.Parse(uoHiddenFieldByVehicleStatus.Value),
        //            0, uoListViewManifestPager.TotalRowCount);
        //        uoGridViewManifest.Visible = true;
        //        if (dt.Rows.Count > 0)
        //        {
        //            uoGridViewManifest.DataSource = dt;
        //        }
        //        else
        //        {
        //            uoGridViewManifest.EmptyDataText = "No Record.";
        //        }
        //        uoGridViewManifest.DataBind();
        //        //uoGridViewManifest.ro.Cells.Add(ManifestCell);


        //        //popup
        //        //Response.ClearContent();
        //        //Response.AddHeader("content-disposition", "attachment; filename=" + "ExcelTest.xls");
        //        ////to open the file without saving it
        //        ////Response.Cache.SetCacheability(HttpCacheability.NoCache);
        //        ////Response.AddHeader("Content-Disposition", "inline; filename=" + "ExcelTest.xls");
        //        ////string filePath = MapPath("Manifest.xls");
        //        //Response.ContentType = "application/ms-excel";
        //        //StringWriter sw = new StringWriter();
        //        //HtmlTextWriter htw = new HtmlTextWriter(sw);
        //        //uoGridViewManifest.RenderControl(htw);
        //        //Response.Write(sw.ToString());
        //        //Response.End();


        //        //popup2
        //        //Response.Clear();
        //        //Response.AddHeader("content-disposition", "inline;filename=FileName.xls");
        //        //Response.Charset = "";
        //        //Response.Cache.SetCacheability(HttpCacheability.NoCache);
        //        //Response.ContentType = "application/vnd.xls";
        //        //System.IO.StringWriter stringWrite = new System.IO.StringWriter();
        //        //System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
        //        //uoGridViewManifest.RenderControl(htmlWrite);
        //        //Response.Write(stringWrite.ToString());
        //        //Response.End();

        //         //non popup
        //        //string FilePath = MapPath("Extract/Manifest/");
        //        //FileInfo FileName = new FileInfo(FilePath + "Manifest.xls");
        //        //Response.Clear();
        //        //Response.AddHeader("Content-Disposition", "attachment; filename=" + FilePath + FileName.Name);
        //        ////Response.AddHeader("Content-Length", FileName.Length.ToString());
        //        //System.IO.StringWriter sw = new System.IO.StringWriter();
        //        //HtmlTextWriter htw = new HtmlTextWriter(sw);
        //        //uoGridViewManifest.RenderControl(htw);
        //        //Response.WriteFile(FileName.FullName);

        //        ////auto save
        //        string FilePath = MapPath("Extract/Manifest/");
        //        string sDate = DateTime.Now.ToString(TravelMartVariable.DateTimeFormatFileExtension);
        //        FileInfo FileName = new FileInfo(FilePath + "Manifest_" + sDate + ".xls");
        //        Response.Clear();
        //        Response.ClearContent();
        //        StringWriter stringWrite = new StringWriter();
        //        HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
        //        uoGridViewManifest.RenderControl(htmlWrite);
        //        FileStream fs = new FileStream(FileName.FullName, FileMode.Create);
        //        StreamWriter sWriter = new StreamWriter(fs, Encoding.GetEncoding("UTF-8"));
        //        sWriter.Write(stringWrite.ToString().Trim());
        //        sWriter.Close();
        //        fs.Close();
        //        //Use below line instead of Response.End() to avoid Error: Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.;
        //        HttpContext.Current.ApplicationInstance.CompleteRequest();
        //        ManifestSendEmail("Travelmart: Manifest","This is a sample Manifest", FileName.FullName);
        //        AlertMessage("Email sent.");
        //    }
        //    catch (Exception ex)
        //    {
        //        DateTime currentDate = CommonFunctions.GetCurrentDateTime();
        //        ErrorBLL.InsertError(ex.Message, ex.StackTrace.ToString(), Request.Url.AbsolutePath,
        //            currentDate, CommonFunctions.GetDateTimeGMT(currentDate), Session["UserName"].ToString());
        //        AlertMessage(ex.Message);
        //    }
        //    finally
        //    {
        //        if (dt != null)
        //        {
        //            dt.Dispose();
        //        }
        //        uoGridViewManifest.Visible = false;
        //    }
        //}
        /// <summary>
        /// Date Created:   30/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Set default values of global variables
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void SetDefaultValues()
        {
            //string currentDate = DateTime.Now.ToString("MM/dd/yyyy");
            //if (GlobalCode.Field2String(Session["DateFrom"]) == "")
            //{
            //GlobalCode.Field2String(Session["DateFrom"]) = currentDate;
            //Session["DateTo"] = currentDate;
            if (GlobalCode.Field2String(Session["Region"]) == "" || Session["Region"] == null)
            {
                Session["strPendingFilter"] = "0";
                Session["Region"]           = "0";
                Session["Country"]          = "0";
                Session["City"]             = "0";
                Session["Port"]             = "0";
                Session["Hotel"]            = "0";
                Session["Vehicle"]          = "0";
            }
            //}
        }
Beispiel #30
0
        /// <summary>
        /// Date Created:   09/01/2012
        /// Created By:     Muhallidin G Wali
        /// (description)
        protected short getDefualtLoadType()
        {
            //Get the data field value of interest for this row
            short LoadType;

            switch (GlobalCode.Field2String(Session["UserName"]))
            {
            case "Vehicle Vendor":
            case "Hotel Vendor":
                LoadType = 0;
                break;

            default:
                LoadType = 1;
                break;
            }

            return(LoadType);
        }
Beispiel #31
0
        /// <summary>
        /// ========================================================
        /// Date Modified:  15/03/2012
        /// Modified By:    Muhallidin G Wali
        /// (description)   Replace Global Variable with Session
        /// ========================================================
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            string userName = GlobalCode.Field2String(Session["UserName"]);

            if (userName == "")
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["dt"] != null)
                {
                    if (Request.QueryString["dt"].ToString() != "")
                    {
                        uoHiddenFieldDate.Value = Request.QueryString["dt"].ToString();
                        uoHiddenFieldDate.Value = uoHiddenFieldDate.Value.Replace("_", "/");
                    }
                }
                Session["strPrevPage"] = Request.RawUrl;
                string UserRolePrimary = UserAccountBLL.GetUserPrimaryRole(userName);
                string userRole        = UserRolePrimary;

                uoHiddenFieldUserRole.Value = userRole; //MUser.GetUserRole();
                uoHiddenFieldUser.Value     = userName; //Session["UserName"].ToString();

                //SetDefaultValues();
                GetVessel();
                GetNationality();
                GetGender();
                GetRank();

                if (userRole == TravelMartVariable.RoleHotelVendor || userRole == TravelMartVariable.RoleVehicleVendor)
                {
                    uoTRVessel.Visible = false;
                }
                else
                {
                    uoTRVessel.Visible = true;
                }
                HtmlControl uoRowDateTo = (HtmlControl)Master.FindControl("uoRowDateTo");
                uoRowDateTo.Visible = false;
            }
        }