public static void CreateInvitation(BigDB bigDb, InvitationType type, string sender, string recipient, Callback <DatabaseObject> callback) { var newInvite = new DatabaseObject() .Set("Type", (int)type) .Set("Sender", sender) .Set("Recipient", recipient) .Set("Status", (int)InvitationStatus.Pending); bigDb.CreateObject(InvitationsTable, null, newInvite, callback); }
public static void PublishNotification(BigDB bigDb, EENotification eeNotification, Callback <DatabaseObject> callback) { var obj = new DatabaseObject() .Set("Channel", eeNotification.Channel) .Set("PublishDate", eeNotification.PublishDate) .Set("Title", eeNotification.Title) .Set("RoomId", eeNotification.RoomId) .Set("ImageUrl", eeNotification.ImageUrl) .Set("Body", eeNotification.Body); bigDb.CreateObject("Notifications", null, obj, callback ?? (db => { })); }
private static void SendMail(BigDB bigDb, EEMail mail, Callback <DatabaseObject> callback) { var obj = new DatabaseObject() .Set("From", mail.From) .Set("To", mail.To) .Set("Date", mail.Date) .Set("Subject", mail.Subject) .Set("Body", mail.Body); bigDb.CreateObject("Mails", null, obj, callback ?? (db => { })); // Delete mail if the inbox got too full GetMail(bigDb, mail.To, m => { }); }