コード例 #1
0
ファイル: SecondForm.cs プロジェクト: Chistogov/classSharp
        private void начатьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (QueryMap.symptoms == null)
            {
                QueriesForm form = new QueriesForm();
                form.Show();
                return;
            }
            fileName_old = new List <String>();
            filesNames   = new List <String>();
            List <Picture> pics = db.Pictures.ToList();
            List <User>    user = db.Users.ToList();

            setRootFolder();
            var groups = db.Recognized_.ToList().Where(p => QueryMap.symptoms.Contains(p.Symptom.Symptom_name));

            if (QueryMap.use_date)
            {
                groups = groups.Where(p => p.Date == QueryMap.date);
            }
            if (QueryMap.user != null)
            {
                groups = groups.Where(p => p.User.User_name == QueryMap.user.User_name);
            }
            var groupz = groups.GroupBy(p => p.Picture);

            foreach (var group in groupz)
            {
                foreach (var item in group)
                {
                    if (!filesNames.Contains(item.Picture.Pic_name))
                    {
                        filesNames.Add(item.Picture.Pic_name);
                    }
                }
            }
            if (groupz.Count() == 0)
            {
                MessageBox.Show("В результате поиска не было найдено ни одного снимка по заданному условию");
                return;
            }
            statusLabel.Text = fileName_old.Count() + "/" + filesNames.Count();
            getNextPic();
        }
コード例 #2
0
ファイル: SecondForm.cs プロジェクト: Chistogov/classSharp
        private void запросToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QueriesForm form = new QueriesForm();

            form.Show();
        }