Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("SendboxId,MailFrom,MailTo,Date,Tittle,Message,MessageHtml")] Sendbox sendbox)
        {
            if (id != sendbox.SendboxId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sendbox);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SendboxExists(sendbox.SendboxId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sendbox));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("SendboxId,MailFrom,MailTo,Date,Tittle,Message,MessageHtml")] Sendbox sendbox)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sendbox);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sendbox));
        }
Ejemplo n.º 3
0
        private void textBox8_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Chatbox.AppendText("[you] " + this.Sendbox.Text + Environment.NewLine);

                //send packet to the server
                PacketChat chat = new PacketChat(this.Sendbox.Text + Environment.NewLine, hostName, "monitor", id);
                this.serverConnection.WritePacket(chat);
                Console.WriteLine("Sent message");
                Sendbox.Clear();
            }
        }