use of com.eventyay.organizer.data.event.Event in project open-event-orga-app by fossasia.
the class UpdateTrackViewModel method updateTrack.
public void updateTrack() {
nullifyEmptyFields(track);
long eventId = ContextManager.getSelectedEvent().getId();
Event event = new Event();
event.setId(eventId);
track.setEvent(event);
compositeDisposable.add(trackRepository.updateTrack(track).doOnSubscribe(disposable -> progress.setValue(true)).doFinally(() -> progress.setValue(false)).subscribe(updatedTrack -> {
success.setValue("Track Updated");
dismiss.call();
}, throwable -> error.setValue(ErrorUtils.getMessage(throwable).toString())));
}
use of com.eventyay.organizer.data.event.Event in project open-event-orga-app by fossasia.
the class CreateSessionViewModel method updateSession.
// Method called for updating an session
public void updateSession(long trackId, long eventId) {
Track track = new Track();
Event event = new Event();
track.setId(trackId);
event.setId(eventId);
session.setTrack(track);
session.setEvent(event);
nullifyEmptyFields(session);
compositeDisposable.add(sessionRepository.updateSession(session).doOnSubscribe(disposable -> progress.setValue(true)).doFinally(() -> progress.setValue(false)).subscribe(updatedSession -> {
success.setValue("Session Updated Successfully");
dismiss.call();
}, throwable -> error.setValue(ErrorUtils.getMessage(throwable).toString())));
}
use of com.eventyay.organizer.data.event.Event in project open-event-orga-app by fossasia.
the class CreateSessionViewModel method createSession.
public void createSession(long trackId, long eventId) {
if (!verify())
return;
Track track = new Track();
Event event = new Event();
track.setId(trackId);
event.setId(eventId);
session.setTrack(track);
session.setEvent(event);
nullifyEmptyFields(session);
compositeDisposable.add(sessionRepository.createSession(session).doOnSubscribe(disposable -> progress.setValue(true)).doFinally(() -> progress.setValue(false)).subscribe(createdSession -> {
success.setValue("Session Created");
dismiss.call();
}, throwable -> error.setValue(ErrorUtils.getMessage(throwable).toString())));
}
use of com.eventyay.organizer.data.event.Event in project open-event-orga-app by fossasia.
the class CreateOrderViewModel method createOnSiteOrder.
public void createOnSiteOrder(long eventId) {
Order order = new Order();
Event event = new Event();
event.setId(eventId);
order.setEvent(event);
order.setAmount(orderAmount.getValue());
for (Long ticketId : onSiteTicketsMap.keySet()) {
OnSiteTicket onSiteTicket = new OnSiteTicket();
onSiteTicket.setId(ticketId);
onSiteTicket.setQuantity(onSiteTicketsMap.get(ticketId).get());
onSiteTicketsList.add(onSiteTicket);
}
order.setOnSiteTickets(onSiteTicketsList);
compositeDisposable.add(orderRepository.createOrder(order).compose(dispose(compositeDisposable)).doOnSubscribe(disposable -> progress.setValue(true)).doFinally(() -> {
clearSelectedTickets();
progress.setValue(false);
}).subscribe(createdOrder -> success.setValue("Order created successfully"), throwable -> error.setValue(ErrorUtils.getMessage(throwable).toString())));
}
use of com.eventyay.organizer.data.event.Event in project open-event-orga-app by fossasia.
the class RoleInviteViewModel method createRoleInvite.
public void createRoleInvite(long roleId) {
long eventId = ContextManager.getSelectedEvent().getId();
Event event = new Event();
event.setId(eventId);
roleInvite.setEvent(event);
role.setId(roleId);
roleInvite.setRole(role);
compositeDisposable.add(roleRepository.sendRoleInvite(roleInvite).doOnSubscribe(disposable -> progress.setValue(true)).doFinally(() -> progress.setValue(false)).subscribe(sentRoleInvite -> {
success.setValue("Role Invite Sent");
dismiss.call();
}, throwable -> error.setValue(ErrorUtils.getMessage(throwable).toString())));
}
Aggregations