示例#1
0
        public LocationResult Search(JQueryDataTableParamModel param, string location, bool?activeList)
        {
            try
            {
                int totalRecord;

                BSL.LocationService ls = new BSL.LocationService();
                var listLocationInfos  = ls.Search(param, location, activeList, out totalRecord);

                var sr = new LocationResult
                {
                    IsSuccess         = true,
                    ListLocationInfos = listLocationInfos,
                    TotalRecords      = totalRecord
                };
                return(sr);
            }
            catch (Exception ex)
            {
                new RMSWebException(this, "0500", "Search failed. " + ex.Message, ex, true);

                var sr = new LocationResult
                {
                    IsSuccess    = false,
                    ErrorMessage = "Search errors. " + ex.Message
                };
                return(sr);
            }
        }
示例#2
0
        public LocationResult ListLocation()
        {
            try
            {
                BSL.LocationService ls = new BSL.LocationService();
                var listLocation       = ls.List();

                var sr = new LocationResult
                {
                    IsSuccess     = true,
                    ListLocations = listLocation,
                };
                return(sr);
            }
            catch (Exception ex)
            {
                new RMSWebException(this, "0500", "ListLocation failed. " + ex.Message, ex, true);

                var sr = new LocationResult
                {
                    IsSuccess    = false,
                    ErrorMessage = "ListLocation errors. " + ex.Message
                };
                return(sr);
            }
        }
示例#3
0
        public LocationResult Get(int locationID)
        {
            try
            {
                BSL.LocationService ls = new BSL.LocationService();
                var location           = ls.Get(locationID);

                var sr = new LocationResult
                {
                    IsSuccess = true,
                    Location  = location,
                };
                return(sr);
            }
            catch (Exception ex)
            {
                new RMSWebException(this, "0500", "Get failed. " + ex.Message, ex, true);

                var sr = new LocationResult
                {
                    IsSuccess    = false,
                    ErrorMessage = "Get errors. " + ex.Message
                };
                return(sr);
            }
        }