Example #1
0
 public ActionResult Send(MessageNew m)
 {
     m.sender = Authentication.CurrentUser.ID;
     DataBase.Messages.Send(m);
     return Index(m.recipient);
 }
Example #2
0
            public static bool Send(MessageNew m)
            {
                int dat = Time.UNIXNow();
                var mnew = new messages()
                {
                    body = m.body,
                    date = Time.UNIXNow(),
                    from = m.sender,
                    to = m.recipient
                };

                context.messages.InsertOnSubmit(mnew);
                try
                {
                    return Save();
                }
                catch (Exception exp)
                {
                    return false;
                }
            }