Esempio n. 1
0
        /// <summary>
        /// Get the Locations
        /// </summary>
        /// <param name="locationCode">Code of the Location </param>
        /// <returns>Returns All location if location code is not specified. otherwise return only specified location</returns>
        public List <DDLOC_MAST> GetLocationDetails(DDLOC_MAST paramEntity = null)
        {
            List <DDLOC_MAST> lstResult = null;

            try
            {
                if (!DB.IsNotNullOrEmpty())
                {
                    return(lstResult);
                }
                if (paramEntity.IsNotNullOrEmpty())
                {
                    lstResult = (from row in DB.DDLOC_MAST
                                 where (Convert.ToBoolean(Convert.ToInt16(row.DELETE_FLAG)) == false || row.DELETE_FLAG == null) && row.LOC_CODE == paramEntity.LOC_CODE
                                 orderby row.LOCATION ascending
                                 select row).ToList <DDLOC_MAST>();
                }
                else
                {
                    lstResult = (from row in DB.DDLOC_MAST
                                 where (Convert.ToBoolean(Convert.ToInt16(row.DELETE_FLAG)) == false || row.DELETE_FLAG == null)
                                 orderby row.LOCATION ascending
                                 select row).ToList <DDLOC_MAST>();
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }

            return(lstResult);
        }
        /// <summary>
        /// Get the Locations
        /// </summary>
        /// <param name="locationCode">Code of the Location </param>
        /// <returns>Returns All location if location code is not specified. otherwise return only specified location</returns>
        public List <DDLOC_MAST> GetLocationsByCode(DDLOC_MAST locationEntity = null)
        {
            List <DDLOC_MAST> lstLocations = null;

            try
            {
                if (!DB.IsNotNullOrEmpty())
                {
                    return(lstLocations);
                }
                if (locationEntity.IsNotNullOrEmpty() && locationEntity.LOC_CODE.IsNotNullOrEmpty())
                {
                    lstLocations = (from row in DB.DDLOC_MAST
                                    where Convert.ToBoolean(Convert.ToInt16(row.DELETE_FLAG)) == false && row.LOC_CODE == locationEntity.LOC_CODE
                                    select row).ToList <DDLOC_MAST>();
                }
                else
                {
                    lstLocations = (from row in DB.DDLOC_MAST
                                    where Convert.ToBoolean(Convert.ToInt16(row.DELETE_FLAG)) == false
                                    select row).ToList <DDLOC_MAST>();
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }

            return(lstLocations);
        }