/// <summary>
        /// Author: Charlene Remotigue
        /// Date Created: 04/05/2012
        /// Description: initialize session values
        /// </summary>
        protected void InitializeValues()
        {
            if (GlobalCode.Field2String(Session["UserName"]) == "")
            {
                Session["UserName"] = User.Identity.Name;
            }
            MembershipUser mUser = Membership.GetUser(GlobalCode.Field2String(Session["UserName"]));

            if (mUser == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            else
            {
                if (!mUser.IsOnline)
                {
                    Response.Redirect("~/Login.aspx");
                }
            }

            if (GlobalCode.Field2String(Session["DateFrom"]) == "")
            {
                Session["DateFrom"] = GlobalCode.Field2DateTime(Request.QueryString["dt"]).ToString("MM/dd/yyyy");
            }
            Session["strPrevPage"] = Request.RawUrl;


            uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy");
            uoHiddenFieldDate.Value = uoHiddenFieldDate.Value.Replace("_", "/");
        }
        /// <summary>
        /// Date Created:   22/02/2011
        /// Created By:     Josephine Gad
        /// (description)   disable lock button if past dates and if there is no data
        /// -------------------------------------------------------
        /// Date Modified:  23/03/2012
        /// Modified By:    Josephine Gad
        /// (description)   disable lock button  if already locked
        /// -------------------------------------------------------
        /// Date Modified:  02/10/2012
        /// Modified By:    Josephine Gad
        /// (description)   disable lock button  if "ALL Hotel" is selected
        /// -------------------------------------------------------
        /// </summary>
        private void ButtonLockSettings()
        {
            if (uolistviewHotelInfo.Items.Count > 0)
            {
                //uoBtnExportList.Enabled = true;
                if (uoDropDownListHotel.SelectedValue == "-1")
                {
                    //uoButtonLock.Enabled = false;
                }
            }
            else
            {
                //uoBtnExportList.Enabled = false;
            }

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

            if (GlobalCode.Field2DateTime((sDate)) < DateTime.Parse(DateTime.Now.ToString("MM/dd/yyyy")))
            {
                //uoButtonLock.Enabled = false;
            }
            //bool IsAlreadyLocked = HotelManifestBLL.IsHotelHasLockedManifest(sDate, uoDropDownListHotel.SelectedValue, uoDropDownListHours.SelectedValue);
            //if (IsAlreadyLocked)
            //{
            //    uoButtonLock.Enabled = false;
            //}
        }
Beispiel #3
0
        /// <summary>
        /// Author:         Muhallidin G Wali
        /// Date Created:   23/Dec/2013
        /// Description:    create the file to be exported
        /// ---------------------------------------------
        /// </summary>
        /// <param name="dt"></param>
        //protected void CreateFile(DataTable dt, DataTable dtConfirmed, DataTable dtCancelled)
        protected void CreateFile(DataTable dt)
        {
            try
            {
                string strFileName   = "";
                string FilePath      = Server.MapPath("~/Extract/VehicleManifest/");
                string sDate         = DateTime.Now.ToString(TravelMartVariable.DateTimeFormatFileExtension);
                string sDateManifest = GlobalCode.Field2DateTime(uoHiddenFieldDate.Value).ToString("MMMddyyy");

                string FileName = "VehicleManifest_" + sDateManifest + '_' + sDate + ".xls";
                strFileName = FilePath + FileName;
                if (File.Exists(strFileName))
                {
                    File.Delete(strFileName);
                }
                CreateExcel(dt, strFileName, uoHiddenFieldVendor.Value);
                OpenExcelFile(FileName, strFileName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Beispiel #4
0
        protected void uoObjectDataSourceHotel_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            e.InputParameters["DateFrom"]       = GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString();
            e.InputParameters["DateTo"]         = uoHiddenFieldDateTo.Value;
            e.InputParameters["UserID"]         = uoHiddenFieldUser.Value;
            e.InputParameters["FilterByDate"]   = Session["strPendingFilter"];
            e.InputParameters["RegionID"]       = GlobalCode.Field2String(Session["Region"]);
            e.InputParameters["CountryID"]      = GlobalCode.Field2String(Session["Country"]);
            e.InputParameters["CityID"]         = GlobalCode.Field2String(Session["City"]);
            e.InputParameters["Status"]         = uoDropDownListStatus.SelectedValue;
            e.InputParameters["FilterByNameID"] = uoDropDownListFilterBy.SelectedValue;
            e.InputParameters["FilterNameID"]   = uoTextBoxFilter.Text.Trim();
            e.InputParameters["PortID"]         = GlobalCode.Field2String(Session["Port"]);
            e.InputParameters["VesselID"]       = uoDropDownListVessel.SelectedValue;
            e.InputParameters["Nationality"]    = uoDropDownListNationality.SelectedValue;
            e.InputParameters["Gender"]         = uoDropDownListGender.SelectedValue;
            e.InputParameters["Rank"]           = uoDropDownListRank.SelectedValue;
            e.InputParameters["Role"]           = uoHiddenFieldRole.Value;

            e.InputParameters["ByVessel"]    = Int16.Parse(uoHiddenFieldByVessel.Value);
            e.InputParameters["ByName"]      = Int16.Parse(uoHiddenFieldByName.Value);
            e.InputParameters["ByE1ID"]      = Int16.Parse(uoHiddenFieldByE1ID.Value);
            e.InputParameters["ByDateOnOff"] = Int16.Parse(uoHiddenFieldByDateOnOff.Value);
            e.InputParameters["ByStatus"]    = Int16.Parse(uoHiddenFieldByStatus.Value);
            e.InputParameters["ByPort"]      = Int16.Parse(uoHiddenFieldByPort.Value);
            e.InputParameters["ByRank"]      = Int16.Parse(uoHiddenFieldByRank.Value);
            e.InputParameters["BranchId"]    = GlobalCode.Field2Int(Session["Hotel"]).ToString();
        }
        /// <summary>
        /// Date Created:   08/Nov/2012
        /// Created By:     Josephine Gad
        /// (description)   Page for calendar of room count needed daily
        /// -------------------------------------------
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            uoHiddenFieldBranchID.Value = GlobalCode.Field2String(Request.QueryString["bID"]);
            if (!IsPostBack)
            {
                DateTime sDateFrom = new DateTime();

                if (GlobalCode.Field2String(Request.QueryString["dt"]) == "")
                {
                    sDateFrom = GlobalCode.Field2DateTime(Session["DateFrom"]);
                }
                else
                {
                    sDateFrom = GlobalCode.Field2DateTime(Request.QueryString["dt"]);
                }

                Session["DateFrom"] = sDateFrom.ToShortDateString();
                Session.Remove("CalendarRoomNeeded");
                uoCalendarDashboard.SelectedDate = sDateFrom;
                uoCalendarDashboard.VisibleDate  = sDateFrom;

                GetCaption();
            }

            uoCalendarDashboard.Visible = true;
        }
Beispiel #6
0
        /// <summary>
        /// Date Created:   12/10/2011
        /// Created By:     Charlene Remotigue
        /// -------------------------------------------
        /// Date Modified:  16/03/2012
        /// Modified By:    Josephine Gad
        /// (description)   Replace Global Variable with Session
        /// -------------------------------------------
        /// </summary>
        /// <summary>
        /// Author: Charlene Remotigue
        /// Date Created: 07/05/2012
        /// Description: initialize 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");
                }
            }

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

            if (GlobalCode.Field2String(Session["DateFrom"]) == "")
            {
                Session["DateFrom"] = GlobalCode.Field2DateTime(Request.QueryString["dt"]).ToString("mm/dd/yyyy");
            }

            Session["strPrevPage"] = Request.RawUrl;
        }
Beispiel #7
0
        protected void uoLinkExport_Click(object sender, EventArgs e)
        {
            DataSet ds       = ManifestBLL.getAllDataFiles(GlobalCode.Field2DateTime(Session["DateFrom"]), GlobalCode.Field2String(Session["UserName"]));
            string  FilePath = Server.MapPath("~/Extract/Manifest/");
            string  mDate    = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString(TravelMartVariable.DateTimeFormatFileExtension);
            string  sDate    = DateTime.Now.ToString(TravelMartVariable.DateTimeFormatFileExtension);
            string  FileName = "Manifest_" + mDate + "_" + sDate + ".xls";

            ds.Tables[0].TableName = "Same day Arrival Departure";
            ds.Tables[1].TableName = "No Travel request";
            int count = 2;

            while (count < ds.Tables.Count)
            {
                ds.Tables[count].TableName = ds.Tables[count].Rows[0]["HotelName"].ToString();
                count += 1;
            }
            string strFileName = FilePath + FileName;

            if (File.Exists(strFileName))
            {
                File.Delete(strFileName);
            }
            Convert(ds, strFileName);
            OpenExcelFile(FileName);
        }
        /// <summary>
        /// Date Created:   08/Nov/2012
        /// Created By:     Josephine Gad
        /// (description)   Get Calendar Room Count using session
        /// -------------------------------------------
        /// </summary>
        /// <returns></returns>
        protected List <CalendarRoomNeeded> GetCalendarRoomCount()
        {
            List <CalendarRoomNeeded> list = new List <CalendarRoomNeeded>();

            try
            {
                if (Session["CalendarRoomNeeded"] == null)
                {
                    list = calendar.GetCalendarRoomNeeded(GlobalCode.Field2String(Session["UserName"]),
                                                          GlobalCode.Field2DateTime(GlobalCode.Field2String(Session["DateFrom"])), "",
                                                          GlobalCode.Field2Int(Session["Region"]), GlobalCode.Field2Int(Session["Port"]), GlobalCode.Field2Int(uoHiddenFieldBranchID.Value)
                                                          );
                    Session.Remove("CalendarRoomNeeded");
                    Session["CalendarRoomNeeded"] = list;
                    return(list);
                }
                else
                {
                    list = (List <CalendarRoomNeeded>)Session["CalendarRoomNeeded"];
                    return(list);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #9
0
        /// <summary>
        /// Date Created: 08/07/2011
        /// Created By: Marco Abejar
        /// (description) Get seafarer air travel info
        /// ----------------------------------------------------------------
        /// Date Created: 22/07/2011
        /// Modifed By: Josephine Gad
        /// (description) uogridviewAirTravelInfo to uoListViewAirTravelInfo
        /// ----------------------------------------------------------------
        /// Date Created: 02/08/2011
        /// Modifed By: Josephine Gad
        /// (description) Add parameter seafarer name
        /// ----------------------------------------------------------------
        /// Date Modified: 05/08/2011
        /// Modifed By: Josephine Gad
        /// (description) Add Date Range parameter
        /// </summary>
        private void GetSFAirTravelDetails()
        {
            DataTable AirDataTable = null;

            try
            {
                //string DateFromString = (uoHiddenFieldDateFrom.Value == "" ? DateTime.Now.ToShortDateString() : uoHiddenFieldDateFrom.Value);
                //string DateToString = (uoHiddenFieldDateTo.Value == "" ? DateTime.Now.ToShortDateString() : uoHiddenFieldDateTo.Value);

                //AirDataTable = SeafarerTravelBLL.GetSFAirTravelDetails(strSFStatus, strFlightDateRange, strAirStatusFilter, uoTextBoxName.Text,
                //    DateFromString, DateToString, GlobalCode.Field2String(Session["UserName"]), GlobalCode.Field2String(Session["Region"]), uoHiddenFieldFilterBy.Value);
                AirDataTable = SeafarerTravelBLL.GetSFAirTravelDetails(GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString(), uoHiddenFieldDateTo.Value,
                                                                       GlobalCode.Field2String(Session["strAirStatusFilter"]), GlobalCode.Field2String(Session["UserName"]), GlobalCode.Field2String(Session["strPendingFilter"]),
                                                                       GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]), GlobalCode.Field2String(Session["City"]),
                                                                       uoDropDownListStatus.SelectedValue, uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(),
                                                                       GlobalCode.Field2String(Session["Port"]), uoDropDownListVessel.SelectedValue, uoDropDownListNationality.SelectedValue,
                                                                       uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue);

                uoListViewAirTravelInfo.DataSource = AirDataTable;
                uoListViewAirTravelInfo.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (AirDataTable != null)
                {
                    AirDataTable.Dispose();
                }
            }
        }
Beispiel #10
0
        /// <summary>
        /// Date Created:   30/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get vessel list
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetVessel()
        {
            DataTable VesselDataTable = null;

            try
            {
                string UserName = GlobalCode.Field2String(Session["UserName"]);
                string UserRole = GlobalCode.Field2String(Session["UserRole"]);
                if (UserRole == "")
                {
                    UserRole = UserAccountBLL.GetUserPrimaryRole(UserName);
                }
                VesselDataTable = VesselBLL.GetVessel(UserName, GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString(),
                                                      uoHiddenFieldDateTo.Value, GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]),
                                                      GlobalCode.Field2String(Session["City"]), GlobalCode.Field2String(Session["Port"]), UserRole);
                uoDropDownListVessel.Items.Clear();
                ListItem item = new ListItem("--Select Vessel--", "0");
                uoDropDownListVessel.Items.Add(item);
                uoDropDownListVessel.DataSource     = VesselDataTable;
                uoDropDownListVessel.DataTextField  = "VesselName";
                uoDropDownListVessel.DataValueField = "VesselID";
                uoDropDownListVessel.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (VesselDataTable != null)
                {
                    VesselDataTable.Dispose();
                }
            }
        }
Beispiel #11
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   01/10/2012
        /// Description:    Get records removed from Exception List
        /// </summary>
        /// <returns></returns>
        private List <OverflowBooking2> GetHotelOverflowList()
        {
            try
            {
                List <OverflowBooking2> list = new List <OverflowBooking2>();
                int iRegionID = GlobalCode.Field2Int(Session["Region"]);
                int iPortID   = GlobalCode.Field2Int(Session["Port"]);

                if (Session["HotelOverflowBookingsRemovedList"] != null)
                {
                    list = (List <OverflowBooking2>)Session["HotelOverflowBookingsRemovedList"];
                }
                else
                {
                    list = OverFlowBookingBLL.OverflowGetRemovedList(GlobalCode.Field2DateTime(Session["DateFrom"]),
                                                                     GlobalCode.Field2String(Session["UserName"]), 0, iRegionID, iPortID);
                    Session["HotelOverflowBookingsRemovedList"] = list;
                }
                return(list);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void LoadTravelDetails()
        {
            Session["Hotel"]             = uoDropDownListHotel.SelectedValue;
            Session["HotelNameToSearch"] = uoDropDownListHotel.SelectedItem.Text;
            //if (uoDropDownListHotel.SelectedValue == "0")
            //{
            //    uoBtnExportList.Enabled = false;
            //}
            //else
            //{
            //    uoBtnExportList.Enabled = true;
            //}

            if (uoDropDownListHotel.SelectedValue == "-1")
            {
                uoDropDownListPortPerRegion.SelectedValue = "0";
                Session["Port"] = "0";
                uoDropDownListPortPerRegion.Enabled = false;
            }
            else
            {
                uoDropDownListPortPerRegion.Enabled = true;
            }

            uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy");
            DateTime dDateCurrent = DateTime.Parse(DateTime.Now.ToString("MM/dd/yyyy"));
            DateTime dDateFrom    = GlobalCode.Field2DateTime((uoHiddenFieldDate.Value));

            //TimeSpan timeDiff = dDateFrom - dDateCurrent;
            //int dDays = timeDiff.Days;

            GetSFHotelTravelDetails();
            //Session.Remove("TentativeManifestCalendarDashboard");
        }
Beispiel #13
0
 /// <summary>
 /// Author:         Josephine Gad
 /// Created Date:   09/Jan/2013
 /// Description:    Create File for Export
 /// ============================================
 /// Author:         Marco Abejar Gad
 /// Created Date:   26/April/2013
 /// Description:    Added columns and include aie legs
 /// ============================================
 /// Modified By:    Josephine  Gad
 /// CModified Date: 02/Sep/2013
 /// Description:    Change filename to Crew Admin Manifest + date of manifest + date extracted
 /// </summary>
 /// <param name="dt"></param>
 protected void CreateFile(DataTable dt)
 {
     try
     {
         string strFileName = "";
         string FilePath    = Server.MapPath("~/Extract/CrewAdmin/");
         string sDateNow    = DateTime.Now.ToString(TravelMartVariable.DateTimeFormatFileExtension);
         string sDate       = GlobalCode.Field2DateTime(uoHiddenFieldDate.Value).ToString("MMMddyyy");
         string FileName    = "CrewAdminManifest_" + sDate + "_" + sDateNow + ".xls";
         strFileName = FilePath + FileName;
         if (File.Exists(strFileName))
         {
             File.Delete(strFileName);
         }
         string[] sVesselArr = uoDropDownListVessel.SelectedItem.Text.Split("-".ToCharArray());
         CreateExcel(dt, strFileName, sVesselArr[0].ToString().TrimEnd());
         OpenExcelFile(FileName, strFileName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         if (dt != null)
         {
             dt.Dispose();
         }
     }
 }
Beispiel #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null || GlobalCode.Field2String(Session["UserName"]) == "")
            {
                Response.Redirect("Login.aspx");
            }
            Session["strPrevPage"] = Request.RawUrl;
            if (!IsPostBack)
            {
                uoHiddenFieldUser.Value = GlobalCode.Field2String(Session["UserName"]);
                uoHiddenFieldRole.Value = GlobalCode.Field2String(Session["UserRole"]);

                uoHiddenFieldDate.Value = Request.QueryString["dt"].ToString();
                uoHiddenFieldDate.Value = uoHiddenFieldDate.Value.Replace("_", "/");

                string sChangeDate = "";
                if (Request.QueryString["chDate"] != null)
                {
                    sChangeDate = Request.QueryString["chDate"];
                }
                if (sChangeDate == "1")
                {
                    uoHiddenFieldPortAgentID.Value = GlobalCode.Field2Int(Session["PortAgentID"]).ToString();
                }
                else
                {
                    uoHiddenFieldPortAgentID.Value = GlobalCode.Field2Int(Request.QueryString["pid"]).ToString();
                    Session["PortAgentID"]         = uoHiddenFieldPortAgentID.Value;
                }
                BindPortAgent();
                BindNoOfDays();
                BindVehicleManifest(0);
                BindStatus();
            }
            else
            {
                string sChangeDate = "";
                if (Request.QueryString["chDate"] != null)
                {
                    sChangeDate = Request.QueryString["chDate"];
                }

                HiddenField uoHiddenFieldPopupCalendar = (HiddenField)Master.FindControl("uoHiddenFieldPopupCalendar");

                if (uoHiddenFieldPopupCalendar.Value == "1" || (sChangeDate == "1"))
                {
                    uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy");
                    BindVehicleManifest(0);
                }
            }

            uoListViewVehicleHeader.DataSource = null;
            uoListViewVehicleHeader.DataBind();
            if (uoHiddenFieldVehicleConfirm.Value == "1")
            {
                BindVehicleManifest(1);
                uoHiddenFieldVehicleConfirm.Value = "0";
            }
        }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //uoTextNites.Text = uoHiddenFieldNoOfNites.Value;
            if (!IsPostBack)
            {
                uoHiddenFieldHotelRequestID.Value  = Request.QueryString["hrID"].ToString();
                uoHiddenFieldTravelRequestID.Value = Request.QueryString["trID"].ToString();
                uoHiddenFieldHotelRequestApp.Value = Request.QueryString["App"].ToString();
                uoHiddenFieldUser.Value            = GlobalCode.Field2String(Session["UserName"]);
                if (GlobalCode.Field2String(Request.QueryString["dt"]) != "")
                {
                    uoHiddenFieldDate.Value = Request.QueryString["dt"].ToString();
                    uoHiddenFieldDate.Value = uoHiddenFieldDate.Value.Replace("_", "/");
                }
                else
                {
                    uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToShortDateString();
                }
                //LoadDefaults(0);
                GetGender();
                GetVessel();
                GetRank();
                GetCurrency();
                GetSFInfo();

                if (uoHiddenFieldHotelRequestID.Value != "0" && uoHiddenFieldHotelRequestID.Value != "")
                {
                    GetSFCompanion();
                }
                if (uoDropDownListHotel.SelectedIndex > 0)
                {
                    GetHotelRoomAmount();
                }

                tblConfirm.Visible = (uoHiddenFieldHotelRequestApp.Value == "2") ? true : false;
            }

            //fire room availability check
            //if (Request["__EVENTARGUMENT"] == "uoTextBoxCheckinDate_TextChanged")
            //{
            //    BindRoom();
            //}
            uoCheckBoxAddCompanion.Enabled = (uoHiddenFieldHotelRequestID.Value != "0" && uoHiddenFieldHotelRequestID.Value != "");
            //only show to authorized approver

            uoListViewCompanion.DataSource = null;
            uoListViewCompanion.DataBind();
            //if crew exist
            if (uoTextBoxRequestNo.Text.Length > 0)
            {
                divSFNotExist.Visible = false;
                divSFExist.Visible    = true;
            }
            else
            {
                divSFNotExist.Visible = true;
                divSFExist.Visible    = false;
            }
        }
 void GetPortAgentHotelVehicle()
 {
     GetPortAgentHotelVehicle(0, uoHiddenFieldPortCode.Value
                              , GlobalCode.Field2Int(uoDropDownListSeaport.SelectedValue)
                              , GlobalCode.Field2Int(uoDropDownListPortAgent.SelectedValue)
                              , GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value)
                              , GlobalCode.Field2Int(uoDropDownListDays.SelectedValue));
 }
Beispiel #17
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   07/Dec/2012
        /// Descrption:     Get Active Exception List (active in PNR but X in Travel Routing) and store in session
        /// </summary>
        public static void GetActiveExceptionList(Int16 iFilterBy, string sFilter,
                                                  string sRecordLocator, int iSequenceNo,
                                                  int StartRow, int MaxRow)
        {
            Database  db   = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase();
            DbCommand comm = null;
            DataSet   ds   = null;
            List <ActiveExceptionList> list = new List <ActiveExceptionList>();

            try
            {
                HttpContext.Current.Session["ActiveExceptionList"]  = list;
                HttpContext.Current.Session["ActiveExceptionCount"] = 0;

                comm = db.GetStoredProcCommand("uspSelectExceptionTravelRouting");
                db.AddInParameter(comm, "@pFilterBy", DbType.Int16, iFilterBy);
                db.AddInParameter(comm, "@pFilterVarchar", DbType.String, sFilter);

                db.AddInParameter(comm, "@pRecordLocator", DbType.String, sRecordLocator);
                db.AddInParameter(comm, "@pItinerarySequence", DbType.Int32, iSequenceNo);

                db.AddInParameter(comm, "@pStartRow", DbType.Int32, StartRow);
                db.AddInParameter(comm, "@pMaxRow", DbType.Int32, MaxRow);

                ds = db.ExecuteDataSet(comm);
                int iCount = GlobalCode.Field2Int(ds.Tables[0].Rows[0][0]);

                list = (from a in ds.Tables[1].AsEnumerable()
                        select new ActiveExceptionList
                {
                    RecordLocator = a["colRecordLocatorVarchar"].ToString(),
                    SequenceNo = GlobalCode.Field2Int(a["colItinerarySeqNoSmallint"]),
                    Name = a["Name"].ToString(),
                    E1No = GlobalCode.Field2Int(a["colSeafarerIdInt"]),
                    E1TRNo = GlobalCode.Field2Int(a["colE1TravelReqIdInt"]),
                    Status = a["colStatusVarchar"].ToString(),
                    OnOffDate = GlobalCode.Field2DateTime(a["DateOnOff"])
                }).ToList();

                HttpContext.Current.Session["ActiveExceptionList"]  = list;
                HttpContext.Current.Session["ActiveExceptionCount"] = iCount;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (comm != null)
                {
                    comm.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
            }
        }
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get Manifest List
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetRequest()
        {
            DataTable dt = null;
            DataView  dv = null;

            try
            {
                string sDateTo = GlobalCode.Field2String(Session["DateTo"]);
                if (sDateTo == "")
                {
                    sDateTo = GlobalCode.Field2DateTime(uoHiddenFieldDate.Value).AddDays(double.Parse(uoHiddenFieldDateRange.Value)).ToString("MM/dd/yyyy");
                }
                dt = RequestBLL.GetRequest(uoHiddenFieldDate.Value, sDateTo,
                                           uoHiddenFieldUser.Value, GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]),
                                           GlobalCode.Field2String(Session["City"]), uoDropDownListStatus.SelectedValue,
                                           uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(),
                                           GlobalCode.Field2String(Session["Port"]), GlobalCode.Field2String(Session["Hotel"]), GlobalCode.Field2String(Session["Vehicle"]),
                                           uoDropDownListVessel.SelectedValue, uoDropDownListNationality.SelectedValue,
                                           uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue, "", uoHiddenFieldRole.Value);
                dv = dt.DefaultView;

                dv.Sort = uoDropDownListGroupBy.SelectedValue + ", Name ";

                uoListViewRequest.DataSource = dv;
                uoListViewRequest.DataBind();

                HtmlControl VesselHeader = (HtmlControl)uoListViewRequest.FindControl("ucTHVessel");
                HtmlControl HotelHeader  = (HtmlControl)uoListViewRequest.FindControl("ucTHHotel");
                if (VesselHeader != null)
                {
                    if (uoDropDownListGroupBy.SelectedValue == "VesselName")
                    {
                        VesselHeader.Visible = false;
                        HotelHeader.Visible  = true;
                    }
                    else if (uoDropDownListGroupBy.SelectedValue == "HotelName")
                    {
                        VesselHeader.Visible = true;
                        HotelHeader.Visible  = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dv != null)
                {
                    dv.Dispose();
                }
            }
        }
Beispiel #19
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   04/Dec/2012
        /// Descrption:     Get XML Exception and store in session
        /// </summary>
        /// <param name="sUserName"></param>
        /// <param name="sRole"></param>
        /// <param name="DateFrom"></param>
        /// <param name="DateTo"></param>
        /// <param name="sRecordLocator"></param>
        /// <param name="iSequenceNo"></param>
        /// <param name="StartRow"></param>
        /// <param name="MaxRow"></param>
        public static void GetXMLExceptionList(string sUserName, string sRole,
                                               string DateFrom, string DateTo, string sRecordLocator, int iSequenceNo,
                                               int StartRow, int MaxRow)
        {
            Database  db   = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase();
            DbCommand comm = null;
            DataSet   ds   = null;
            List <XMLExceptionList> list = new List <XMLExceptionList>();

            try
            {
                HttpContext.Current.Session["XMLExceptionList"]  = list;
                HttpContext.Current.Session["XMLExceptionCount"] = 0;

                comm = db.GetStoredProcCommand("uspSelectExceptionXML");
                db.AddInParameter(comm, "@pUserIDVarchar", DbType.String, sUserName);
                db.AddInParameter(comm, "@pUserRoleVarchar", DbType.String, sRole);
                db.AddInParameter(comm, "@pDateFrom", DbType.DateTime, GlobalCode.Field2DateTime(DateFrom));
                if (DateTo.Trim() != "")
                {
                    db.AddInParameter(comm, "@pDateTo", DbType.DateTime, GlobalCode.Field2DateTime(DateTo));
                }
                db.AddInParameter(comm, "@pRecordLocator", DbType.String, sRecordLocator);
                db.AddInParameter(comm, "@pItinerarySequence", DbType.Int32, iSequenceNo);
                db.AddInParameter(comm, "@pStartRow", DbType.Int32, StartRow);
                db.AddInParameter(comm, "@pMaxRow", DbType.Int32, MaxRow);

                ds = db.ExecuteDataSet(comm);
                int iCount = GlobalCode.Field2Int(ds.Tables[0].Rows[0][0]);

                list = (from a in ds.Tables[1].AsEnumerable()
                        select new XMLExceptionList {
                    ExceptionID = GlobalCode.Field2Int(a["ExceptionIDBigint"]),
                    RecordLocator = a["FK_ItineraryRefID"].ToString(),
                    SequenceNo = GlobalCode.Field2Int(a["FK_ItinerarySeqNmbr"]),
                    Description = a["Description"].ToString(),
                    DateCreated = GlobalCode.Field2DateTime(a["DateCreatedDatetime"])
                }).ToList();

                HttpContext.Current.Session["XMLExceptionList"]  = list;
                HttpContext.Current.Session["XMLExceptionCount"] = iCount;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (comm != null)
                {
                    comm.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
            }
        }
Beispiel #20
0
        protected void uoObjectDataSourceAuditTrail_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            CultureInfo enCulture = new CultureInfo(TravelMartVariable.UserCultureInfo);

            //e.InputParameters["DateFrom"] = DateTime.ParseExact(GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString(), TravelMartVariable.DateFormat, enCulture);
            e.InputParameters["DateFrom"] = GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString();
            //e.InputParameters["DateTo"] = DateTime.ParseExact(GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString(), TravelMartVariable.DateFormat, enCulture);
            e.InputParameters["DateTo"] = GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString();
        }
 public void OnEndExceptions(IAsyncResult ar)
 {
     _PortAgentDeligate.EndInvoke(ar);
     GetPortAgentHotelVehicle(0, uoHiddenFieldPortCode.Value
                              , GlobalCode.Field2Int(uoDropDownListSeaport.SelectedValue)
                              , GlobalCode.Field2Int(uoDropDownListPortAgent.SelectedValue)
                              , GlobalCode.Field2DateTime(uoHiddenFieldRequestDate.Value)
                              , GlobalCode.Field2Int(uoDropDownListDays.SelectedValue));
 }
 /// <summary>
 /// Author:         Josephine Monteza
 /// Date Created:   8/May/2015
 /// Description:    Bind Days
 /// </summary>
 private void BindDayTo()
 {
     if (Session["NoOfDays_Forecast"] != null)
     {
         int i = GlobalCode.Field2Int(Session["NoOfDays_Forecast"]);
         uoHiddenFieldTo.Value = GlobalCode.Field2DateTime(
             uoHiddenFieldFrom.Value).AddDays(i).ToString();
     }
 }
        protected void uoCheckBoxShowAll_CheckedChanged(object sender, EventArgs e)
        {
            Session["NoOfDays_Forecast_Vendor"] = uoDropDownListDays.SelectedValue;
            uoHiddenFieldNoOfDays.Value         = uoDropDownListDays.SelectedValue;

            uoHiddenFieldTo.Value = GlobalCode.Field2DateTime(
                uoHiddenFieldFrom.Value).AddDays(GlobalCode.Field2Int(uoDropDownListDays.SelectedValue)).ToString();
            uoHiddenFieldLoadType.Value = "1";
            GetSFHotelTravelDetails();
        }
Beispiel #24
0
        private void GetDashboardDetails()
        {
            DataView  dv = null;
            DataTable dt = DashboardBLL.GetDashboardDetails(GlobalCode.Field2DateTime((GlobalCode.Field2String(Session["DateFrom"]))).ToString(), GlobalCode.Field2String(Session["DateTo"]),
                                                            GlobalCode.Field2String(Session["Port"]));

            dv      = dt.DefaultView;
            dv.Sort = uoDropDownListGroup.SelectedValue;
            uoListViewDashboard.DataSource = dv;
            uoListViewDashboard.DataBind();
        }
Beispiel #25
0
        public void OnEnd(IAsyncResult ar)
        {
            DriverGreeterVehHotelServProv lst = new DriverGreeterVehHotelServProv();

            _dlgtAssign.EndInvoke(ar);
            lst = DriverGreeterVehHotelServProv(GlobalCode.Field2Int(uoHiddenFieldVendorID.Value), GlobalCode.Field2String(uoHiddenFieldcmfid.Value));


            uoDropDownListDriver.Items.Clear();
            uoDropDownListDriver.Items.Add(new ListItem("--Select Driver--", "0"));
            uoDropDownListDriver.DataSource     = lst.Driver;
            uoDropDownListDriver.DataValueField = "ID";
            uoDropDownListDriver.DataTextField  = "FullName";
            uoDropDownListDriver.DataBind();

            uoDropDownListGreeter.Items.Clear();
            uoDropDownListGreeter.Items.Add(new ListItem("--Select Greeter--", "0"));
            uoDropDownListGreeter.DataSource     = lst.Greeter;
            uoDropDownListGreeter.DataValueField = "ID";
            uoDropDownListGreeter.DataTextField  = "FullName";
            uoDropDownListGreeter.DataBind();

            uoListviewVehicle.DataSource = null;
            uoListviewVehicle.DataBind();

            uoListviewVehicle.DataSource = lst.VehHotelSerProv;
            uoListviewVehicle.DataBind();

            uoListViewManifestConfirm.DataSource = null;
            uoListViewManifestConfirm.DataBind();

            uoListViewManifestConfirm.DataSource = lst.VehicleManifestList;
            uoListViewManifestConfirm.DataBind();

            if (lst.VehicleManifestList.Count > 0)
            {
                var l = lst.VehicleManifestList[0];

                uoTextBoxPickupDate.Text = GlobalCode.Field2String(l.PickupDate);
                uoTextBoxPickupTime.Text = GlobalCode.Field2DateTime(l.PickupTime.ToString()).Hour.ToString() + ":" + GlobalCode.Field2Time(l.PickupTime.ToString()).Minute.ToString();

                uoTextBoxPickupLocation.Text = GlobalCode.Field2String(l.PickupLocation);
                uoTextBoxDropupLocation.Text = GlobalCode.Field2String(l.DropOffLocation);



                uoTextBoxGreeterPickupDate.Text = GlobalCode.Field2String(l.PickupDate);
                uoTextBoxGreeterPickupTime.Text = GlobalCode.Field2DateTime(l.PickupTime.ToString()).Hour.ToString() + ":" + GlobalCode.Field2Time(l.PickupTime.ToString()).Minute.ToString();

                uoTextBoxGreeterLocation.Text     = GlobalCode.Field2String(l.PickupLocation);
                uoTextBoxGreeterDropLocation.Text = GlobalCode.Field2String(l.DropOffLocation);
            }
        }
Beispiel #26
0
        /// <summary>
        /// Date Modified:  19/03/2012
        /// Modified By:    Josephine Gad
        /// (description)   Change DataTable to List
        /// -------------------------------------------
        /// Date Modified:  15/09/2012
        /// Modified By:    Josephine Gad
        /// (description)   Add parameter RegionID, PortID, sPage
        /// -------------------------------------------
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="Date"></param>
        /// <returns></returns>
        public List <ManifestOnOffCalendar> LoadOnOffCalendar(string UserId, DateTime Date,
                                                              Int32 RegionID, Int32 PortID, Int32 VesselID, Int32 HotelID, string sPage, Int16 TypeView)
        {
            Database  db        = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = null;
            DataTable Calendar  = null;

            try
            {
                dbCommand = db.GetStoredProcCommand("uspGetOnOffCalendar");
                db.AddInParameter(dbCommand, "@pUserId", DbType.String, UserId);
                db.AddInParameter(dbCommand, "@pDate", DbType.DateTime, Date);

                db.AddInParameter(dbCommand, "@pRegionID", DbType.Int32, RegionID);
                db.AddInParameter(dbCommand, "@pPortID", DbType.Int32, PortID);

                db.AddInParameter(dbCommand, "@pVesselID", DbType.Int32, VesselID);
                db.AddInParameter(dbCommand, "@pHotelID", DbType.Int32, HotelID);

                db.AddInParameter(dbCommand, "@pPage", DbType.String, sPage);

                db.AddInParameter(dbCommand, "@pTypeView", DbType.Int16, TypeView);

                Calendar = db.ExecuteDataSet(dbCommand).Tables[0];
                List <ManifestOnOffCalendar> list = new List <ManifestOnOffCalendar>();
                list = (from a in Calendar.AsEnumerable()
                        select new ManifestOnOffCalendar
                {
                    colDate = GlobalCode.Field2DateTime(a["colDate"]),
                    ONCount = GlobalCode.Field2Int(a["ONCount"]),
                    OffCount = GlobalCode.Field2Int(a["OffCount"]),
                    sDate = GlobalCode.Field2String(a["sDate"])
                }).ToList();

                return(list);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbCommand != null)
                {
                    dbCommand.Dispose();
                }

                if (Calendar != null)
                {
                    Calendar.Dispose();
                }
            }
        }
        private void GetPortNotInTM()
        {
            List <NonTurnPortsList> list = new List <NonTurnPortsList>();

            AnalystExceptionBLL.GetNonTurnPortNotInTM(GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                                      uoHiddenFieldUser.Value, GlobalCode.Field2String(Session["Port"]), uoHiddenFieldSortBy.Value);

            list = (List <NonTurnPortsList>)Session["PortNotExistExceptionList"];

            uoListViewNonTurnPort.DataSource = list;
            uoListViewNonTurnPort.DataBind();
        }
        protected void uolistviewHotelInfo_DataBound(object sender, EventArgs e)
        {
            ButtonLockSettings();

            if (uoHiddenFieldLoadType.Value == "0")
            {
                DateTime dDateFrom = GlobalCode.Field2DateTime((uoHiddenFieldDate.Value));

                uoTextBoxFrom.Text = dDateFrom.ToString(TravelMartVariable.DateFormat);
                uoTextBoxTo.Text   = dDateFrom.AddDays(TMSettings.NoOfDaysForecast).ToString(TravelMartVariable.DateFormat);
            }
        }
        protected void uoVendorDropDownType_Click(object sender, EventArgs e)
        {
            DataTable dt = null;

            try
            {
                DropDownList dd = (DropDownList)sender;
                if (dd.ID == "uoDropDownListRequestSource")
                {
                    return;
                }

                uoTextBoxHotelname.Text              = "";
                uoTextBoxEmailAdd.Text               = "";
                uoTextBoxRateContract.Text           = "";
                uoTextBoxRateConfirmed.Text          = "";
                uoTextBoxCheckInDate.Text            = "";
                uoDropDownListCurrency.SelectedIndex = 0;
                uoHiddenFieldContractID.Value        = "";
                uoHiddenFieldVoucher.Value           = "";

                DropDownList ddl = (DropDownList)sender;
                if (ViewState["PortAgenRequestVendor"] != null)
                {
                    List <PortAgenRequestVendor> ls = (List <PortAgenRequestVendor>)ViewState["PortAgenRequestVendor"];
                    var lst = ls.Where(n => n.VendorID == GlobalCode.Field2Int(ddl.SelectedItem.Value)).ToList();
                    if (lst.Count > 0)
                    {
                        DropDownList cbo = (DropDownList)sender;
                        uoTextBoxHotelname.Text              = cbo.SelectedItem.Text;
                        uoTextBoxEmailAdd.Text               = lst[0].EmailTo;
                        uoTextBoxRateContract.Text           = lst[0].DoubleRate.ToString();
                        uoTextBoxRateConfirmed.Text          = lst[0].DoubleRate.ToString();
                        uoTextBoxCheckInDate.Text            = GlobalCode.Field2DateTime(Request.QueryString["dt"]).ToString();
                        uoDropDownListCurrency.SelectedIndex = GlobalCode.GetselectedIndex(uoDropDownListCurrency, lst[0].CurrentID);
                        uoHiddenFieldContractID.Value        = lst[0].VendorContractID.ToString();
                        uoHiddenFieldVoucher.Value           = lst[0].Voucher.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
 /// <summary>
 /// Author: Charlene Remotigue
 /// Date Created: 15/11/2011
 /// ========================================================
 /// Date Modified:  16/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)
 {
     if (!IsPostBack)
     {
         Session["strPrevPage"]         = Request.RawUrl;
         uoHiddenFieldEndDate.Value     = GlobalCode.Field2String(Session["DateTo"]);
         uoHiddenFieldStartDate.Value   = GlobalCode.Field2DateTime(GlobalCode.Field2String(Session["DateFrom"])).ToString();
         uoHiddenFieldPortAgentId.Value = Session["UserBranchID"].ToString();
         LoadVehicleBrand();
         LoadDashboardDetails();
         //UpdatePanelVehicle.Update();
     }
 }