示例#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();
        }
示例#2
0
        private void cutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Blank frm = (Blank)this.ActiveMdiChild;

            if (frm != null)
            {
                frm.Cut();
            }
            else
            {
                MessageBox.Show("Нет активных форм");
            }
        }
示例#3
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();
     }
 }
示例#4
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();
        }
示例#5
0
 private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     saveWorkshopsDialog1.Filter = "Text Files (*.txt)|*.txt|All Files(*.*)|*.*";
     if (saveWorkshopsDialog1.ShowDialog() == DialogResult.OK)
     {
         Blank frm = (Blank)this.ActiveMdiChild;
         if (frm != null)
         {
             frm.Save(saveWorkshopsDialog1.FileName);
             frm.MdiParent = this;
             frm.DocName   = saveWorkshopsDialog1.FileName;
             frm.Text      = frm.DocName;
         }
         else
         {
             MessageBox.Show("Нет активных форм");
         }
     }
 }
示例#6
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("Введены неверные данные");
            }
        }