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)); }
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)); }
public IHttpActionResult GetLOCATIONS(int id) { LOCATIONS lOCATIONS = db.LOCATIONS.Find(id); if (lOCATIONS == null) { return(NotFound()); } return(Ok(lOCATIONS)); }
internal void updateList(LOCATION newLocation) { if (instance != null) { LOCATIONS.Add(newLocation); DisplayObjects(); if (LOCATIONS.Count % Paging.RowsPerPage == 1) { CalculatePagingInfo(Paging.RowsPerPage, LOCATIONS.Count, SelectedIndex); } } }
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); }
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(); }
private List <LOCATION> SetDefaultPosition() { return(LOCATIONS.OrderBy(c => c.LOCATION_ID).ToList()); }
private List <LOCATION> SetAscendingPositionAccordingToName() { return(LOCATIONS.OrderBy(c => c.NAME).ToList()); }
public int GetMaximum() { return(LOCATIONS.Count()); }