public int Create(Meeting instance) { if (instance.Id == 0) { context.Meetings.InsertOnSubmit(instance); SubmitChanges(); Service.Notify.NewMeeting(instance); return instance.Id; } return -1; }
public static MeetingApiModel Map(Meeting model) { return new MeetingApiModel() { id = model.Id.ToString(), description = model.description, latitude = model.latitude, longitude = model.longitude, time = model.time, owner = Map(model.Owner), accept = model.IsAccepter? Map(model.CurrentUserAccept): null, acceptsCount = model.MeetingAccepts.Count, confirmer = model.confirmer == null ? null : Map(model.Confirmer) }; }
partial void DeleteMeeting(Meeting instance);
partial void UpdateMeeting(Meeting instance);
partial void InsertMeeting(Meeting instance);
private void detach_Meetings1(Meeting entity) { this.SendPropertyChanging(); entity.AspNetUser1 = null; }
private void attach_Meetings(Meeting entity) { this.SendPropertyChanging(); entity.AspNetUser = this; }
public Response Create(float latitude, float longitude, int time, string description) { var meeting = new Meeting() { latitude = latitude.ToString(), longitude = longitude.ToString(), time = time, description = description }; if (ModelState.IsValid) { int id = -1; var userId = GetUserId(); meeting.creator = userId; var meetingRep = new MeetingRepository(); id = meetingRep.Create(meeting); if (id > -1) { Notify.NewMeeting(meeting); return Response(new { id = id }); } } else { return new BadRequestError(); } return new InternalError(); }