// POST: api/Checkin public void Post([FromBody]Models.CheckinJson checkin) { Mappers.MapSpot2Json mapper = new Mappers.MapSpot2Json(); var service = new CheckinService(_checkinrepository, _spotSearchRepository); service.CreateNewCheckIn(new Checkin() { CheckinTime = checkin.CheckinTime, Description = checkin.Description, Location = mapper.MapJson2Location(checkin.Location), } ); }
public async Task <TableLayoutPanel> GetLayoutPanelAsync(User i_LoggedInUser) { ICheckinService checkinService = new CheckinService(); List <Checkin> userCheckins = await checkinService.GetUserCheckinsAsync(i_LoggedInUser); m_Panel = new TableLayoutPanel { ColumnCount = 1, AutoScroll = true, AutoSize = true, CellBorderStyle = TableLayoutPanelCellBorderStyle.Single, Padding = new Padding(10, 0, 10, 0) }; foreach (Checkin checkinItem in userCheckins) { m_Panel.Controls.Add(new Label { Font = new Font(AppUtil.sr_FontFamily, AppConfigService.GetInstance().LabelFontSize, FontStyle.Bold), Text = checkinItem.Place.Name }); } return(m_Panel); }
public IEnumerable<Models.CheckinJson> Get() { Mappers.MapSpot2Json mapper = new Mappers.MapSpot2Json(); List<Models.CheckinJson> checkinListJson = new List<Models.CheckinJson>(); var service = new CheckinService(_checkinrepository, _spotSearchRepository); List<Checkin> checkinList = service.GetAllCheckIn(); foreach (var item in checkinList) { Models.CheckinJson checkinJson = new Models.CheckinJson() { Uid = item.Uid, CheckinTime = DateTime.Now, Location = mapper.MapLocation2Json(item.Location), Description = item.Description, }; checkinListJson.Add(checkinJson); } return checkinListJson; }
public CheckinController(ProyectoContext context) { _checkinservice = new CheckinService(context); }