/// <summary>
        /// Date Created:   30/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get vessel list
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetVessel()
        {
            DataTable VesselDataTable = null;

            try
            {
                VesselDataTable = VesselBLL.GetVessel(uoHiddenFieldUser.Value, uoHiddenFieldDate.Value,
                                                      uoHiddenFieldDate.Value, GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]),
                                                      GlobalCode.Field2String(Session["City"]), GlobalCode.Field2String(Session["Port"]), uoHiddenFieldUserRole.Value);
                uoDropDownListVessel.Items.Clear();
                ListItem item = new ListItem("--Select Ship--", "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();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Date Created:   05/10/2011
        /// Created By:     Josephine Gad
        /// (description)   Get vessel details by Vessel ID
        /// ---------------------------------------------
        /// Date Modified: 28/11/2011
        /// Modified By:   Charlene Remotigue
        /// (description)  optimization (use datareader instead of datatable
        /// </summary>
        public void GetVesselDetails()
        {
            IDataReader dr = null;

            try
            {
                dr = VesselBLL.GetVesselPortDetails(uoDropDownListVessel.SelectedValue,
                                                    uoTextBoxDate.Text, uoTextBoxDate.Text);
                if (dr.Read())
                {
                    uoTextBoxPort.Text = dr["PortName"].ToString();
                    //uoTextBoxCity.Text = dr["CityName"].ToString();
                    uoTextBoxCountry.Text = dr["CountryName"].ToString();

                    uoHiddenFieldPortID.Value = dr["PortID"].ToString();
                    // uoHiddenFieldCityID.Value = dr["CityID"].ToString();
                    uoHiddenFieldCountryID.Value = dr["CountryID"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Dispose();
                }
            }
        }
Пример #3
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();
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Date Created:    04/10/2011
        /// Created By:      Josephine Gad
        /// (description)    Get Vessel list
        /// ---------------------------------------------
        /// Date Modified:   14/02/2011
        /// Modified By:     Josephine Gad
        /// (description)    Use class VesselDTOList.VesselList instead of calling function VesselBLL.GetVessel again
        /// ---------------------------------------------
        /// </summary>
        /// <param name="vesselID"></param>
        private void GetVessel(string vesselID)
        {
            List <VesselDTO> vesselList = null;

            try
            {
                //VesselDTOList.VesselList
                uoDropDownListVessel.Items.Clear();
                uoDropDownListVessel.Items.Add(new ListItem("--SELECT SHIP--", "0"));

                if (VesselDTOList.VesselList != null)
                {
                    vesselList = VesselDTOList.VesselList;
                }
                else
                {
                    vesselList = VesselBLL.GetVesselList(GlobalCode.Field2String(Session["UserName"]), uoTextBoxDate.Text,
                                                         uoTextBoxDate.Text, "0", "0", "0", "0", uoHiddenFieldRole.Value, false);
                }

                var listVessel = (from a in vesselList
                                  select new
                {
                    VesselName = a.VesselNameString,
                    VesselID = a.VesselIDString
                }
                                  ).ToList();
                uoDropDownListVessel.DataSource     = listVessel;
                uoDropDownListVessel.DataTextField  = "VesselName";
                uoDropDownListVessel.DataValueField = "VesselID";
                uoDropDownListVessel.DataBind();

                uoDropDownListVessel.SelectedValue = vesselID;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (vesselList != null)
                {
                    vesselList = null;
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Date Created:   30/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get vessel list
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetVessel()
        {
            //DataTable VesselDataTable = null;
            List <VesselDTO> vesselList = null;

            try
            {
                string sDateTo = GlobalCode.Field2String(Session["DateTo"]);
                if (sDateTo == "")
                {
                    sDateTo = GlobalCode.Field2DateTime(uoHiddenFieldDate.Value).AddDays(double.Parse(uoHiddenFieldDateRange.Value)).ToString("MM/dd/yyyy");
                }
                vesselList = VesselBLL.GetVesselList(uoHiddenFieldUser.Value, uoHiddenFieldDate.Value,
                                                     sDateTo, GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]),
                                                     GlobalCode.Field2String(Session["City"]), GlobalCode.Field2String(Session["Port"]), uoHiddenFieldRole.Value, false);
                uoDropDownListVessel.Items.Clear();
                ListItem item = new ListItem("--Select Ship--", "0");
                uoDropDownListVessel.Items.Add(item);

                var listVessel = (from a in vesselList
                                  select new
                {
                    VesselName = a.VesselNameString,
                    VesselID = a.VesselIDString
                }).ToList();
                uoDropDownListVessel.DataSource     = listVessel;
                uoDropDownListVessel.DataTextField  = "VesselName";
                uoDropDownListVessel.DataValueField = "VesselID";
                uoDropDownListVessel.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (vesselList != null)
                {
                    vesselList = null;
                }
            }
        }