コード例 #1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (!ban)
     {
         if (!sql.isBlackList(ID, TO) && !sql.isBlackList(TO, ID))//!!! как вариант можно дать возможность тому кто дал БЛ писать человеку, который не сможет ему ответить( но это беспреел, но как фишка может зайти)
         {
             if (YourMessage.Text != "" && YourMessage.Text != " ")
             {
                 sql = new SqlAction();
                 if (FullTextOfDialog != "")
                 {
                     sql.SendMess(FullTextOfDialog + "\n" + ID + "&" + YourMessage.Text + "&" + (DateTime.Now), ID, TO);
                 }
                 else
                 {
                     sql.SendMess(ID + "&" + YourMessage.Text + "&" + (DateTime.Now), ID, TO);
                 }
                 YourMessage.Clear();
                 Refresh(sender, e);
             }
         }
         else
         {
             System.Windows.MessageBox.Show("You can't write to this user because he added you in a black list", "Warning", MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
         }
     }
 }
コード例 #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            ban = true;

            /*System.Windows.MessageBox.Show("4to-to poslo ne tak: ili razrab ne dopisal etu function or u vas o4en bad computer, scoree vsego 2 variant but you can send message on number 0990867398 and uznat 4to je na samom dele proizishlo", ":c");
             * System.Windows.MessageBox.Show("No ti ne univay- lovi frostmourne", ":3");
             *
             * StreamResourceInfo sriCurs = System.Windows.Application.GetResourceStream(
             * new Uri("Frostmourne.cur", UriKind.Relative));
             * this.Cursor = new System.Windows.Input.Cursor(sriCurs.Stream);
             */
            //int GCP = System.Diagnostics.Process.GetCurrentProcess().Threads.Count;


            OpenFileDialog dowbloadFile = new OpenFileDialog();

            dowbloadFile.Filter = "All files (*.*)|*.*";
            dowbloadFile.ShowDialog();
            string filename = dowbloadFile.FileName;

            Thread FileThread = new Thread(delegate() { sql.SaveFileToDatabase(filename); });

            FileThread.Priority = ThreadPriority.Normal;
            FileThread.Start();

            /*
             *
             * FolderBrowserDialog Op = new FolderBrowserDialog();
             * Op.ShowDialog();
             * Thread FileThread = new Thread(delegate () { sql.ReadFileFromDatabase(Op.SelectedPath); });
             * FileThread.Priority = ThreadPriority.Normal;
             * FileThread.Start();
             */

            //while(GCP!= System.Diagnostics.Process.GetCurrentProcess().Threads.Count)
            FileThread.Join();//ожидать завершение потока(Остановка всеъ тредов до завершения этого)
            if (!FileThread.IsAlive)
            {
                ban = false;
            }


            string FileName = filename.Substring(filename.LastIndexOf('\\') + 1);
            Guid   FID      = sql.GetStreamID(FileName);


            if (FullTextOfDialog != "")
            {
                sql.SendMess(FullTextOfDialog + "\n" + FID.ToString() + "|" + ID + "&" + FileName + "&" + (DateTime.Now), ID, TO);
            }
            else
            {
                sql.SendMess(FID.ToString() + "|" + ID + "&" + FileName + "&" + (DateTime.Now), ID, TO);
            }

            YourMessage.Clear();
            Refresh(sender, e);
        }
コード例 #3
0
        public IActionResult YourOrder()
        {
            YourMessage yourMessage = new YourMessage()

                                      //var asd = new YourMessage
            {
                Date = DateTime.Today
            };

            return(View(yourMessage));
        }
コード例 #4
0
ファイル: LineUpController.cs プロジェクト: Tayyib-A60/LineUp
        public async Task <IActionResult> SendUsAMessage([FromBody] YourMessage yourMessage)
        {
            var user = await _userRepository.GetUser(yourMessage.SpaceOwnerId);

            Message message = new Message();

            message.Subject      = "Enquiry";
            message.FromEmail    = "*****@*****.**";
            message.FromName     = "234Spaces Enquiry";
            message.ToName       = user.Name;
            message.ToEmail      = user.Email;
            message.PlainContent = null;
            message.HtmlContent  = FormattedEmailBody("Space Enquiry", $"An enquiry was logged on your space, the details are as follows. Enquiry made by {yourMessage.Name}. Message is {yourMessage.Message}. Phone number is {yourMessage.Phone}. Email is {yourMessage.Email}, and registered email on 234Spaces is {yourMessage.User234SpacesEmail}", "", "", false);
            _userRepository.EmailSender(message);
            return(Ok());
        }
コード例 #5
0
        public async Task <IActionResult> YourOrder(YourMessage mss)
        {
            if (ModelState.IsValid)
            {
                _doublet.yourMessages.Add(mss);
                await _doublet.SaveChangesAsync();

                ModelState.Clear();
                RedirectToAction("Index", "Home");
            }
            else
            {
                ModelState.AddModelError(string.Empty, "");
                return(View());
            }

            return(View());
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: gimmi/randomhacking
 private static void OnHandleYourMessage(YourMessage msg)
 {
     Console.WriteLine("{0}: Received '{1}'", Thread.CurrentThread.ManagedThreadId, msg.Text);
 }