예제 #1
0
        /// <summary>
        /// Date Created:   25/09/2012
        /// Created By:     Josephine Gad
        /// (description)   Get Seaport in user's access
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <VehicleVendorDTO> GetVehicleVendorInUser(bool IsNew)
        {
            List <VehicleVendorDTO> list = new List <VehicleVendorDTO>();

            if (IsNew)
            {
                list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, "", false);
            }
            else
            {
                if (Session["VehicleListInUser"] == null)
                {
                    list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, "", false);
                }
                else
                {
                    list = (List <VehicleVendorDTO>)Session["VehicleListInUser"];
                }
            }
            list = list.OrderBy(a => a.VehicleName).ToList();
            Session["VehicleListInUser"] = list;
            return(list);
        }
예제 #2
0
        /// <summary>
        /// Date Created:   04/Mar/2014
        /// Created By:     Josephine Gad
        /// (description)   Get Vehicle Vendor not in user's access
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <VehicleVendorDTO> GetVehicleVendorNotInUser(bool IsNew, bool IsFromSearch)
        {
            List <VehicleVendorDTO> list      = new List <VehicleVendorDTO>();
            List <VehicleVendorDTO> listAdded = new List <VehicleVendorDTO>();


            if (IsNew)
            {
                list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, uoTextBoxSearch.Text.Trim(), true);
            }
            else
            {
                if (Session["VehicleListNotInUser"] == null)
                {
                    list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, uoTextBoxSearch.Text.Trim(), true);
                }
                else
                {
                    list = (List <VehicleVendorDTO>)Session["VehicleListNotInUser"];
                }
            }

            if (IsFromSearch)
            {
                listAdded = GetVehicleVendorInUser(false);
            }
            else
            {
                listAdded = GetVehicleVendorInUser(IsNew);
            }
            list.RemoveAll(a => listAdded.Exists(b => a.VehicleName == b.VehicleName));
            list = list.OrderBy(a => a.VehicleName).ToList();

            Session["VehicleListNotInUser"] = list;
            return(list);
        }