Example #1
0
        public static MessagingConversationVM SetSubData(MessagingConversation data)
        {
            var model = MessagingConversationVM.MToVM(data);

            model.DateTime = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID));
            return(model);
        }
 public async Task <JsonResult> GetByID(string id)
 {
     try {
         var data = MessagingConversationService.GetByID(Guid.Parse(id));
         return(Success(MessagingConversationVM.MToVM(data)));
     } catch { return(Failed(MessageUtility.ServerError())); }
 }
 public async Task <JsonResult> GetByRoomID()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var data = MessagingConversationService.GetByRoomID(id);
         return(Success(MessagingConversationVM.MsToVMs(data)));
     } catch { return(Failed(MessageUtility.ServerError())); }
 }
Example #4
0
 public static bool Insert(Guid id, string text, Guid mtid, Guid sid, Guid rid, Guid dtid, bool ia)
 {
     try {
         using (var context = new CentralProcessContext()) {
             var data = MessagingConversationVM.set(id, text, mtid, sid, rid, dtid, ia);
             context.MessagingConversationDB.Add(data);
             context.SaveChanges();
             return(true);
         }
     } catch { return(false); }
 }
 public static bool Insert(Guid id, string text, Guid messageType, string senderID, Guid roomID, DateTime createdAt)
 {
     try
     {
         using (var context = new UploadersContext())
         {
             var model = MessagingConversationVM.set(id, text, messageType, senderID, roomID, createdAt);
             context.MessagingConversationDB.Add(model);
             context.SaveChanges();
             return(true);
         }
     }
     catch { return(false); }
 }