示例#1
0
 static void Go()
 {
     f1 = new FirstForm();
     f2 = new SecondForm();
     f1.DateSelected += (o, e) => f2.SelectedDate = e.Date.AddMonths(6);
     f1.Show();
     f2.Show();
 }
 static void Go()
 {
     f1 = new FirstForm();
     f2 = new SecondForm();
     f1.DateSelected += new EventHandler <DateEventArgs>(f1_DateSelected);
     f1.Show();
     f2.Show();
 }
示例#3
0
        private void Load_User()
        {
            if (this.ComboBox_Reg_Login.SelectedIndex != -1)
            {
                string stLogin = this.ComboBox_Reg_Login.SelectedValue.ToString().ToLower();

                string stPassword = this.Reg_Textbox_Password.Text;

                if (!string.IsNullOrEmpty(stLogin))
                {
                    if (!string.IsNullOrEmpty(stPassword))
                    {
                        double d = 0;

                        string stPass = null;

                        d = Class_SQL.SelectFloat("select count(*) from bi.dbo.ABS_USER_PROFILE where active= 'Y' and DOSTUP_ABS = N'Y' and USER_NAME = N'" + stLogin + "'");

                        stPass = Class_SQL.SelectString("select PASSWORD from bi.dbo.ABS_USER_PROFILE where active= 'Y' and DOSTUP_ABS = N'Y' and USER_NAME = N'" + stLogin + "'");

                        if (stPass == Class_SQL.SelectString("select SNT.dbo.svc_md5_ngen(N'" + stPassword + "')"))

                        {
                            this.Hide();
                            FirstForm f2 = new FirstForm(stLogin);
                            f2.Show();
                        }
                        else
                        {
                            MessageBox.Show("Не верно указан логин или пароль.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            this.Reg_Textbox_Password.Focus();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Поле Пароль не заполнено.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.Reg_Textbox_Password.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("Поле Логин не заполнено.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.Reg_Textbox_Password.Focus();
                }
            }
            else
            {
                MessageBox.Show("Поле Логин не заполнено.", "АБС", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.ComboBox_Reg_Login.Focus();
            }
        }
示例#4
0
    static void Main(string[] args)
    {
        string title = "";
        string name  = "";

        for (int i = 0; i < args.Length; i++)
        {
            title = args[0];
            name  = args[1];
        }

        Form form = new FirstForm(title, name);

        Application.Run(form);
    }
示例#5
0
    static void Main(string[] args)
    {
        // get title and name from command lines
        string title = "";
        string name  = "";

        for (int i = 0; i < args.Length; i++)
        {
            title = args[0];               // get first argument and store it title
            name  = args[1];               // get second argument and store it in name
        }

        // instanciate the form class with the two arguments title and name.
        Form form = new FirstForm(title, name);

        // run application
        Application.Run(form);
    }
 public SecondaryForm(FirstForm form) : this()
 {
   this.firstForm = form; 
   firstForm.Timer.Tick += new EventHandler(Timer_Tick);
 }
示例#7
0
 public SecondForm(FirstForm form1)
     : this()
 {
     this.form1 = form1;
 }
 public SecondaryForm(FirstForm form) : this()
 {
     this.firstForm       = form; // optional
     firstForm.SomeEvent += new EventHandler(SecondForm_SomeMethod);
 }
示例#9
0
 private void btnShowFirst_Click(object sender, EventArgs e)
 {
     firstForm = new FirstForm(_semantic.GetFirstList());
     firstForm.ShowDialog();
 }
示例#10
0
 public SecondForm(FirstForm firstForm)
 {
     // do something with firstForm.MyListBox
 }
示例#11
0
文件: Form1.cs 项目: dimashmundiak/DB
        private void button8_Click(object sender, EventArgs e)
        {
            var firstQuery = new FirstForm();

            firstQuery.ShowDialog();
        }
示例#12
0
        public static Shapes chooseFormToGenerateElements()
        {
            while (true)
            {
                Console.WriteLine("Please, choose form to generate elements(from 1 to 14) or \"500\" to finish program: ");
                int numberOfForm = Int32.Parse(Console.ReadLine());
                UserInterfaceHelpers.checkIfWantToExitTheProgram(numberOfForm);
                if (UserInterfaceHelpers.checkTheCorrectInputNumberOfForm(numberOfForm, Config.NumberOfForms))
                {
                    switch (numberOfForm)
                    {
                    case (int)NumberOfForms.FirstForm:
                    {
                        FirstForm form = new FirstForm();
                        return(form);
                    }

                    case (int)NumberOfForms.SecondForm:
                    {
                        SecondForm form = new SecondForm();
                        return(form);
                    }

                    case (int)NumberOfForms.ThirdForm:
                    {
                        ThirdForm form = new ThirdForm();
                        return(form);
                    }

                    case (int)NumberOfForms.FourthForm:
                    {
                        FourthForm form = new FourthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.FifthForm:
                    {
                        FifthForm form = new FifthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.SixthForm:
                    {
                        SixthForm form = new SixthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.SeventhForm:
                    {
                        SeventhForm form = new SeventhForm();
                        return(form);
                    }

                    case (int)NumberOfForms.EighthForm:
                    {
                        EighthForm form = new EighthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.NinthForm:
                    {
                        NinthForm form = new NinthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.TenthForm:
                    {
                        TenthForm form = new TenthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.EleventhForm:
                    {
                        EleventhForm form = new EleventhForm();
                        return(form);
                    }

                    case (int)NumberOfForms.TwelfthForm:
                    {
                        TwelfthForm form = new TwelfthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.ThirteenthForm:
                    {
                        ThirteenthForm form = new ThirteenthForm();
                        return(form);
                    }

                    case (int)NumberOfForms.FourteenthForm:
                    {
                        FourteenthForm form = new FourteenthForm();
                        return(form);
                    }
                    }
                }
                else
                {
                    continue;;
                }
            }
        }