Пример #1
0
        public IHttpActionResult PutLOCATIONS(int id, LOCATIONS lOCATIONS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != lOCATIONS.LOCATION_ID)
            {
                return(BadRequest());
            }

            db.Entry(lOCATIONS).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LOCATIONSExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #2
0
        public IHttpActionResult PostLOCATIONS(LOCATIONS lOCATIONS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.LOCATIONS.Add(lOCATIONS);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (LOCATIONSExists(lOCATIONS.LOCATION_ID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = lOCATIONS.LOCATION_ID }, lOCATIONS));
        }
Пример #3
0
        public IHttpActionResult GetLOCATIONS(int id)
        {
            LOCATIONS lOCATIONS = db.LOCATIONS.Find(id);

            if (lOCATIONS == null)
            {
                return(NotFound());
            }

            return(Ok(lOCATIONS));
        }
Пример #4
0
 internal void updateList(LOCATION newLocation)
 {
     if (instance != null)
     {
         LOCATIONS.Add(newLocation);
         DisplayObjects();
         if (LOCATIONS.Count % Paging.RowsPerPage == 1)
         {
             CalculatePagingInfo(Paging.RowsPerPage, LOCATIONS.Count, SelectedIndex);
         }
     }
 }
Пример #5
0
        public IHttpActionResult DeleteLOCATIONS(int id)
        {
            LOCATIONS lOCATIONS = db.LOCATIONS.Find(id);

            if (lOCATIONS == null)
            {
                return(NotFound());
            }

            db.LOCATIONS.Remove(lOCATIONS);
            db.SaveChanges();

            return(Ok(lOCATIONS));
        }
        public Boolean MoveNext()
        {
            Boolean results = false;

            for (LOCATIONS location = ++position; location < LOCATIONS.END; location++)
            {
                int y = offsets[(byte)location][(int)XY.Y];
                int x = offsets[(byte)location][(int)XY.X];
                if ((row + y >= 0) && (row + y < numberOfRows) &&
                    (col + x > 0) && (col + x < numberOfCols))
                {
                    if (graph[row + y][col + x].value == 1)
                    {
                        position = (LOCATIONS)location;
                        return(true);
                    }
                }
            }
            return(results);
        }
Пример #7
0
        public void searchLocation_ByName()
        {
            string request = HomeScreen.GetHomeScreenInstance().SearchTextBox.Text;
            //MessageBox.Show("Chay duoc roi");
            List <LOCATION> locationList;

            if (request.Length <= 0)
            {
                locationList = (LOCATIONS).ToList();
                //this.ToShowItems = new ObservableCollection<TRIP>(all);
            }
            else
            {
                //search by TITLE
                var requestText = convertUnicode.convertToUnSign(request.Trim().ToLower());
                locationList = (LOCATIONS.AsEnumerable().Where(loca => convertUnicode.convertToUnSign(loca.NAME.Trim().ToLower()).Contains(requestText))).ToList();

                //MessageBox.Show(b[0].TITTLE);
                //this.ToShowItems = new ObservableCollection<TRIP>(tripList);
            }
            searchLOCATIONS = new ObservableCollection <LOCATION>(locationList);
            CalculatePagingInfo(Paging.RowsPerPage, searchLOCATIONS.Count);
            DisplayObjects();
        }
Пример #8
0
 private List <LOCATION> SetDefaultPosition()
 {
     return(LOCATIONS.OrderBy(c => c.LOCATION_ID).ToList());
 }
Пример #9
0
 private List <LOCATION> SetAscendingPositionAccordingToName()
 {
     return(LOCATIONS.OrderBy(c => c.NAME).ToList());
 }
Пример #10
0
 public int GetMaximum()
 {
     return(LOCATIONS.Count());
 }