Beispiel #1
0
        private void NewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Blank frm = new Blank();

            frm.DocName   = "Документ" + ++openDoc;
            frm.Text      = frm.DocName;
            frm.MdiParent = this;
            frm.Show();
        }
Beispiel #2
0
 private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     openWorkshopsDialog1.Filter = "Text Files (*.txt)|*.txt|All Files(*.*)|*.*";
     if (openWorkshopsDialog1.ShowDialog() == DialogResult.OK)
     {
         Blank frm = new Blank();
         frm.Open(openWorkshopsDialog1.FileName);
         frm.MdiParent = this;
         frm.DocName   = openWorkshopsDialog1.FileName;
         frm.Text      = frm.DocName;
         frm.Show();
     }
 }
Beispiel #3
0
        private void поИмениНачальникаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Blank         frm = (Blank)this.ActiveMdiChild;
            SearshDialog1 sd  = new SearshDialog1();

            sd.ShowDialog();
            MyWorkshop[]             works             = frm.Workshops;
            IEnumerable <MyWorkshop> filteredWorkshops = works.Where(n => n.Chief.FullName == sd.ChiefName);

            works = filteredWorkshops.ToArray();
            Blank blank = new Blank();

            blank.Workshops = works;
            blank.MdiParent = this;
            blank.DocName   = "Выборка по имени начальника";
            blank.Text      = blank.DocName;
            blank.Show();
        }
Beispiel #4
0
        private void WorkshopQwery(Func <MyWorkshop, bool> predicate, string docName, SearshDialog2 sd)
        {
            Blank frm = (Blank)this.ActiveMdiChild;

            sd.ShowDialog();
            MyWorkshop[] works = frm.Workshops;
            if (sd.NumberOfWorkers != -1)
            {
                IEnumerable <MyWorkshop> filteredWorkshops = works.Where(predicate);
                works = filteredWorkshops.ToArray();
                Blank blank = new Blank();
                blank.Workshops = works;
                blank.MdiParent = this;
                blank.DocName   = docName;
                blank.Text      = blank.DocName;
                blank.Show();
            }
            else
            {
                MessageBox.Show("Введены неверные данные");
            }
        }