Пример #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            if (my.KontrolSMR(Period, idpred, VidF3) == false)
            {
                return;
            }
            frmForF3 fr = null;


            my.sc.CommandText = "SELECT    dbo.Forma3.IdWhoF3,  dbo.Forma3.IdDog, Sprav.dbo.Dogovor.IdZak, Sprav.dbo.Dogovor.IdIsp FROM         dbo.Forma3 INNER JOIN                       Sprav.dbo.Dogovor ON dbo.Forma3.IdDog = Sprav.dbo.Dogovor.IdDog where idf3 = " + IdF3;
            my.cn.Open();
            SqlDataReader dr = my.sc.ExecuteReader();

            while (dr.Read())
            {
                fr           = new frmForF3();
                fr.MdiParent = my.MDIForm;
                if ((int)dr["IdWhoF3"] == 15)
                {
                    fr.rbZak.Checked = true;
                    fr.rbSub.Checked = false;
                }
                else
                {
                    fr.rbZak.Checked = false;
                    fr.rbSub.Checked = true;
                }
                fr.Show();
                fr.IdZak.SelectedValue = (int)dr["IdZak"];
                fr.IdIsp.SelectedValue = (int)dr["IdIsp"];
                fr.ObnDog();
                fr.IdDog.SelectedValue    = (int)dr["IdDog"];
                fr.IdIstFin.SelectedValue = this.idIstFin.SelectedValue;
                fr.bF3.Text = "Добавить в справку";

                fr.IdF3  = IdF3;
                my.Pform = this;
                fr.Text  = "Добавление актов в справку " + listBox1.SelectedValue;

                // fr.Focus()= true;
            }
            dr.Close();
        }
Пример #2
0
        private void HelpMenu_Click(object sender, System.EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            my.Szap = "";
            Console.Write(item.Name);
            if (item.Name != "SootvA0" & item.Name != "Spr")
            {
                if (item.Name != "Reestr")
                {
//Console.Write( item.Name);
                    switch (item.Name)
                    {
                    //case "Prog1":
                    //    {
                    //        About fr = new About();
                    //        fr.ShowDialog();
                    //    }
                    //    break;
                    case "frmSogl":
                        try
                        {
                            //string s = "exec sRInFileNZP '','','','test','" + DateTime.Today.Year.ToString() + "','nz'";
                            my.Nbut = 1;
                            if (!my.isFormInMdi("frmSogl", my.Nbut, this))
                            {
                                frmSogl fr = new frmSogl();
                                fr.Tag       = my.Nbut;
                                fr.MdiParent = my.MDIForm;
                                fr.Dock      = DockStyle.Fill;
                                //  fr.GrafikUni(s);
                                fr.Show();
                            }

                            //  MessageBox.Show("Готово");
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                        break;

                    case "frmVibList":
                        try
                        {
                            string s = "exec sRInFileNZP '','','','test','" + DateTime.Today.Year.ToString() + "','nz'";
                            my.Nbut = 1;
                            if (!my.isFormInMdi("frmVibList", my.Nbut, this))
                            {
                                frmVibList fr = new frmVibList();
                                fr.Tag       = my.Nbut;
                                fr.MdiParent = my.MDIForm;
                                fr.GrafikUni(s);
                                fr.Show();
                            }

                            //  MessageBox.Show("Готово");
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                        break;

                    case "Upload":
                        try
                        {
                            System.Diagnostics.Process proc = new System.Diagnostics.Process();
                            proc.EnableRaisingEvents = false;
                            proc.StartInfo.FileName  = "C:\\cis\\Сервис\\Web1SSvod.exe";
                            proc.Start();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }

                        break;

                    case "Dostup":
                        if (!my.isFormInMdi("frmDostup", (int)item.Tag, this))
                        {
                            frmDostup fr = new frmDostup();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "SpUgSh":
                        if (!my.isFormInMdi("frmOSR", (int)item.Tag, this))
                        {
                            frmOSR fr = new frmOSR();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            string withupstr = my.ExeScalar("select 1 from dostup.dbo.v_Dostup where Login = '******'  and id_ac=217");
                            fr.WithUp = (withupstr == "" ? false : true);
                            fr.Show();
                        }
                        break;

                    case "MSProject":
                        if (!my.isFormInMdi("frmMSProject", (int)item.Tag, this))
                        {
                            //frmMSProject fr = new frmMSProject();
                            //fr.Tag = (int)item.Tag;
                            //my.Nbut = (int)item.Tag; ;
                            //fr.MdiParent = my.MDIForm;
                            //fr.Show();
                        }
                        break;

                    case "DogOpyt":
                        my.Szap = "exec sDogOpyt";
                        frmReps fr1 = new frmReps();
                        my.Pform      = this;
                        fr1.MdiParent = my.MDIForm;
                        fr1.Tag       = (int)item.Tag;
                        my.Nbut       = (int)item.Tag;

                        fr1.Show();
                        break;

                    case "frmTP":
                        if (!my.isFormInMdi("frmTP", (int)item.Tag, this))
                        {
                            frmTP fr = new frmTP();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "LinkWrk":
                        if (!my.isFormInMdi("frmLinkWRK", (int)item.Tag, this))
                        {
                            frmLinkWRK fr = new frmLinkWRK();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "Struc":
                        if (!my.isFormInMdi("frmStrucProg", (int)item.Tag, this))
                        {
                            frmStrucProg fr = new frmStrucProg();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "GrafikMatch":
                        if (!my.isFormInMdi("frmGrafikMatch", (int)item.Tag, this))
                        {
                            frmGrafikMatch fr = new frmGrafikMatch();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "ScanSm":
                        if (!my.isFormInMdi("frmScanSm", (int)item.Tag, this))
                        {
                            frmScanSm fr = new frmScanSm();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "PlanSmA0":
                        if (!my.isFormInMdi("frmPlanSmA0", (int)item.Tag, this))
                        {
                            frmPlanSmA0 fr = new frmPlanSmA0();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "Hierar":
                        if (!my.isFormInMdi("frmVibComplex", (int)item.Tag, this))
                        {
                            frmVibComplex fr = new frmVibComplex();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "PerechSm":
                        if (!my.isFormInMdi("frmVibIspSm", (int)item.Tag, this))
                        {
                            frmVibIspSm fr = new frmVibIspSm();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "RPredNZ":
                        if (!my.isFormInMdi("frmVibPred", (int)item.Tag, this))
                        {
                            frmVibPred fr = new frmVibPred();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "frmVibTest":
                        if (!my.isFormInMdi("frmVibTest", (int)item.Tag, this))
                        {
                            frmVibTest fr = new frmVibTest();
                            fr.Tag       = (int)item.Tag;
                            fr.Text      = item.Text;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Dock      = DockStyle.Fill;
                            fr.Show();
                        }
                        break;

                    case "RPredGP":
                        if (!my.isFormInMdi("frmVibGP", (int)item.Tag, this))
                        {
                            frmVibGP fr = new frmVibGP();
                            fr.Tag       = (int)item.Tag;
                            fr.Text      = item.Text;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "RInv":
                        if (!my.isFormInMdi("frmVibInv", (int)item.Tag, this))
                        {
                            frmVibInv fr = new frmVibInv();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "RPred":
                    case "RSmet":
                    case "RSmetF2F3":
                        //fr;
                        if (!my.isFormInMdi("frmVibSmet", (int)item.Tag, this))
                        {
                            frmVibSmet fr = new frmVibSmet();
                            fr.Tag       = (int)2001;
                            fr.Text      = item.Text;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            if (item.Name == "RPred")
                            {
                                fr.Height = 111;
                            }
                            fr.Show();
                            if (my.Nbut == 2001 | my.Nbut == 170 | my.Nbut == 2020)
                            {
                                fr.Text = "Сметное разложение";
                            }
                            else
                            {
                                if (my.Nbut == 2002)
                                {
                                    fr.Text = "Сводные";
                                }
                            };
                        }
                        break;

                    case "RPeriod":
                        if (!my.isFormInMdi("frmVibPeriod", (int)item.Tag, this))
                        {
                            frmVibPeriod fr = new frmVibPeriod();
                            fr.Text      = item.Text;
                            fr.Tag       = (int)item.Tag;
                            fr.Nbut      = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "RPer":
                        if (!my.isFormInMdi("frmVibPer", (int)item.Tag, this))
                        {
                            frmVibPer fr = new frmVibPer();
                            fr.Text = item.Text;
                            fr.Tag  = (int)item.Tag;
                            // fr.Nbut = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "A0":
                        if (!my.isFormInMdi("frmSootvA0", (int)item.Tag, this))
                        {
                            frmSootvA0 fr = new frmSootvA0();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "PlanGen":
                        if (!my.isFormInMdi("frmPlanGen", (int)item.Tag, this))
                        {
                            frmPlanGen fr = new frmPlanGen();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "Pr":
                        if (!my.isFormInMdi("frmSootvPr", (int)item.Tag, this))
                        {
                            frmSootvPr fr = new frmSootvPr();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "A0LKV":
                        if (!my.isFormInMdi("frmA0LKV", (int)item.Tag, this))
                        {
                            frmA0LKV fr = new frmA0LKV();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "TM":
                        if (!my.isFormInMdi("frmPlans", (int)item.Tag, this))
                        {
                            frmTemPlans fr = new frmTemPlans();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "wf3":
                    {
                        frmForF3 fr = new frmForF3();
                        fr.MdiParent = my.MDIForm;
                        fr.Show();
                    }
                    break;

                    case "GP":
                        if (!my.isFormInMdi("frmDog", (int)item.Tag, this))
                        {
                            frmDog fr = new frmDog();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag - 1000;;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "Sub":
                        if (!my.isFormInMdi("frmActsSub", (int)item.Tag, this))
                        {
                            frmActsSub fr = new frmActsSub();
                            fr.Tag       = (int)item.Tag;
                            my.Nbut      = (int)item.Tag - 3000;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "SSR1":
                        if (!my.isFormInMdi("frmSSRSm", 0, this))
                        {
                            frmSSRSm fr = new frmSSRSm();
                            fr.Tag       = (int)0;
                            fr.nbut1     = 0;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "Koef":
                        if (!my.isFormInMdi("frmDN", 0, this))
                        {
                            frmDN fr = new frmDN();
                            fr.Tag       = (int)0;
                            fr.nbut1     = 0;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "frmInvDog":
                        if (!my.isFormInMdi("frmInvDog", 0, this))
                        {
                            frmInvDog fr = new frmInvDog();
                            fr.Tag       = (int)0;
                            fr.MdiParent = my.MDIForm;
                            fr.Show();
                        }
                        break;

                    case "SpUgPr":
                        my.Szap = "";
                        my.Nbut = (int)item.Tag;
                        //my.Nbut = 8;
                        bool withup = true;
                        if (my.Nbut == 8 || my.Nbut == 721 || my.Nbut == 724)
                        {
                            withup = false;
                        }
                        //if (my.Nbut == 704) { if (my.UserInGroup(my.Id_us,234)) ; }
                        if (!my.isFormInMdi("frmSprDGV", my.Nbut, this))
                        {
                            my.showSprDGV(my.Nbut, withup, true);
                        }
                        break;

                    case "frmReasons":
                        my.Szap = "";
                        my.Nbut = (int)item.Tag;
                        //my.Nbut = 8;
                        withup = true;
                        //if (my.Nbut == 704) { if (my.UserInGroup(my.Id_us,234)) ; }
                        if (!my.isFormInMdi("frmReasons", my.Nbut, this))
                        {
                            frmReasons fr = new frmReasons();
                            fr.Tag       = (int)0;
                            fr.MdiParent = my.MDIForm;
                            fr.Dock      = DockStyle.Fill;
                            fr.Show();
                        }
                        break;

                    case "PreviewAkt":
                        if (!my.isFormInMdi("frmActs", my.Nbut, this))
                        {
                            Form fr = new frmActs();
                            fr.Tag       = 0;
                            fr.MdiParent = my.MDIForm;
                            fr.Dock      = DockStyle.Fill;
                            fr.Show();
                            int w = fr.Width;
                            int h = fr.Height;
                            fr.Dock   = DockStyle.None;
                            fr.Width  = w;
                            fr.Height = h;
                        }
                        break;

                    case "WindH":
                        LayoutMdi(MdiLayout.TileHorizontal); break;

                    case "WindV":
                        LayoutMdi(MdiLayout.TileVertical); break;

                    case "WindC":
                        LayoutMdi(MdiLayout.Cascade); break;

                    case "Prog":
                    {
                        About fr = new About(); fr.ShowDialog();
                        //frmReasons fr = new frmReasons(); fr.Show();
                    }
                        //if (!my.isFormInMdi("frmDiagram", 0, this))
                        //{
                        //    frmDiagram fr = new frmDiagram();
                        //    fr.Tag = (int)0;
                        //    fr.MdiParent = my.MDIForm;
                        //    fr.Show();
                        //}
                        //if (my.MDIFormCont.Visible)
                        //{
                        //    while (my.MDIFormCont.Controls.Count != 0)
                        //    {

                        //        foreach (Control fr in my.MDIFormCont.Controls)
                        //        {
                        //            //MessageBox.Show(fr.Name);
                        //            if (fr.GetType().ToString().Contains("frm"))
                        //            {
                        //                //  my.MDIFormCont.Controls.Remove(fr);
                        //                //((Form)  fr).TopLevel = true;
                        //                ((Form)fr).MdiParent = my.MDIForm;
                        //                ((Form)fr).FormBorderStyle = FormBorderStyle.Sizable;
                        //                ((Form)fr).Show();
                        //            }
                        //            else { my.MDIFormCont.Controls.Remove(fr); }

                        //        }
                        //    }
                        //    my.MDIFormCont.Hide();
                        //}
                        //else
                        //{
                        //    System.Windows.Forms.Splitter splitter1;
                        //    foreach (Form fr in my.MDIForm.MdiChildren)
                        //    {
                        //        if (!fr.Equals(my.MDIFormCont))
                        //        {
                        //            fr.MdiParent = null; fr.TopLevel = false;
                        //            my.MDIFormCont.Controls.Add(fr);
                        //            fr.Dock = DockStyle.Left;
                        //            fr.FormBorderStyle = FormBorderStyle.FixedToolWindow;
                        //            fr.Show();
                        //            splitter1 = new System.Windows.Forms.Splitter();
                        //            splitter1.Dock = System.Windows.Forms.DockStyle.Left;
                        //            //splitter1.BackColor = System.Drawing.Color.Azure;
                        //            splitter1.Size = new System.Drawing.Size(10, 562);
                        //            splitter1.BorderStyle = BorderStyle.FixedSingle;
                        //            my.MDIFormCont.Controls.Add(splitter1);
                        //        }
                        //    }
                        //    my.MDIFormCont.MdiParent = my.MDIForm;
                        //    my.MDIFormCont.Dock = DockStyle.Fill;
                        //    //my.MDIFormCont.BackColor = System.Drawing.Color.Lavender;
                        //    my.MDIFormCont.FormBorderStyle = FormBorderStyle.None;
                        //    my.MDIFormCont.Show();
                        //}
                        break;

                    case "Exit1":
                        Application.Exit();
                        return;

                    default:
                        //   LayoutMdi(MdiLayout.Cascade);
                        break;
                    }
                }
            }
        }