Exemple #1
0
        public void InsertMessages(Models.Messages msg)

        {
            DBcontext.Messages.Add(msg);

            DBcontext.SaveChanges();
        }
Exemple #2
0
        public Models.Messages Post([FromBody]  Models.Messages message)
        {
            var dbMessage = context.Messages.Add(message).Entity;

            context.SaveChanges();
            return(dbMessage);
        }
 public Conversation(ManagerVazoo managerVazoo, Models.Messages messages, InitMesage initMesage, string mesageID = null)
 {
     conversationMV            = new ConversationAndPurchasesMV(managerVazoo, initMesage, messages, mesageID);
     conversationMV.Navigation = Navigation;
     InitializeComponent();
     BindingContext = conversationMV;
 }
        public ActionResult GetMessages()
        {
            using (blogEntities ct = new blogEntities()) {
                var lists = ct.Messages.Where(m => m.Owner.Equals(Passport.AccountID)).ToList();

                Models.Messages model = new Models.Messages();

                model.Store = lists;

                return View(model);
            }
        }
Exemple #5
0
        public ActionResult GetMessages()
        {
            using (blogEntities ct = new blogEntities()) {
                var lists = ct.Messages.Where(m => m.Owner.Equals(Passport.AccountID)).ToList();

                Models.Messages model = new Models.Messages();

                model.Store = lists;

                return(View(model));
            }
        }
Exemple #6
0
 private async void OrderList_ItemSelected(object sender, SelectedItemChangedEventArgs e)
 {
     if (e.SelectedItem != null)
     {
         Models.Messages messages = (Models.Messages)e.SelectedItem;
         if (messages.Sender == "eBay")
         {
             await Navigation.PushAsync(new PageForeBay(messages.EBayURL, messages.Subject, mesagesFolderMV.managerVazoo, messages.ID.ToString()));
         }
         else
         {
             await Navigation.PushAsync(new Conversation(mesagesFolderMV.managerVazoo, messages, mesagesFolderMV.initMesage));
         }
         messageList.SelectedItem = null;
     }
 }
Exemple #7
0
        /// <summary>
        /// Returns the last message that has been posted in the specified channel.
        /// </summary>
        /// <param name="channelId">This is not the Discord Channel ID, it is the unique ID for the channel in the MednaNetAPI.</param>
        /// <returns></returns>
        public async Task <Models.Messages> GetChannelLastMessage(int channelId)
        {
            HttpResponseMessage response = await client.GetAsync("api/v1/discord/channels/" + channelId.ToString() + "/messages/last");

            Models.Messages message = null;

            if (response.IsSuccessStatusCode)
            {
                message = await response.Content.ReadAsAsync <Models.Messages>();
            }
            else
            {
                throw new System.Exception(response.StatusCode.ToString() + ": " + response.Content.ToString());
            }

            return(message);
        }
Exemple #8
0
 public MainPageViewModel(IDemoService demoService)
 {
     this.demoService = demoService;
     IsActive         = true;
     if (Application.Current.MainWindow == null)
     {
         Message  = "...*";
         Messages = new Models.Messages();
         Messages.Add(new Message()
         {
             MessageId = Guid.NewGuid(), CreateAt = DateTime.Now, Text = "test"
         });
     }
     else
     {
         Message  = "...";
         Messages = demoService.Read();
     }
 }
Exemple #9
0
        /// <summary>
        /// Submits a new message for the specified channel. Specifying a value for "name" in the message object will do nothing. The name value is taken from the Install details linked to the intstallKey specified when the api client object was created.
        /// </summary>
        /// <param name="channelId">This is not the Discord Channel ID, it is the unique ID for the channel in the MednaNetAPI.</param>
        /// <param name="message">A message object containing the message details</param>
        /// <returns></returns>
        public async Task <Models.Messages> CreateMessage(int channelId, Models.Messages message)
        {
            HttpResponseMessage response = await client.PostAsJsonAsync("api/v1/discord/channels/" + channelId.ToString() + "/messages", message);

            response.EnsureSuccessStatusCode();

            Models.Messages newMessage = null;

            if (response.IsSuccessStatusCode)
            {
                newMessage = await response.Content.ReadAsAsync <Models.Messages>();
            }
            else
            {
                throw new System.Exception(response.StatusCode.ToString() + ": " + response.Content.ToString());
            }

            return(newMessage);
        }
 public ConversationAndPurchasesMV(ManagerVazoo managerVazoo, InitMesage initMesage = null, Models.Messages messages = null, string mesageID = null, bool iseBay = false)
 {
     this.managerVazoo     = managerVazoo;
     ToPurchasesCommand    = new DelegateCommand(ToPurchases);
     ToSettingsCommand     = new DelegateCommand(ToSettings);
     SendOrRaplyCommand    = new DelegateCommand(SendOrRaply);
     DeletedMsgCommand     = new DelegateCommand(Confirm);
     RefreshMessageCommand = new DelegateCommand(InitConversation);
     this.initMesage       = initMesage;
     if (messages != null)
     {
         MessagesID = messages.ID.ToString();
     }
     else
     {
         MessagesID = mesageID;
     }
     if (!iseBay)
     {
         InitConversation();
         InitPurchases();
     }
     else
     {
         IsEnambleSend = true;
     }
 }