コード例 #1
0
        private void информацияОНедвижимостиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            property prty = new property();

            prty.Show();
            this.Close();
        }
コード例 #2
0
        private void ИнформацияОНедвижимости_Click(object sender, EventArgs e)
        {
            property prty = new property();

            prty.Show();
            this.Close();
        }
コード例 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            property property = new property();

            property.Show();
        }
コード例 #4
0
        public void loadDataGridView() //пользовательская функция для вывода dataGridView
        {
            property form2 = new property();

            form2.dataGridView1.DataSource = null;
            PublicClasses.sql = "select idProperty, concat(type.type, ' ', typeproperty.typeProperty) as 'Тип Недвижимости', cities.city as 'Город', areas.area as 'Область', district.district as 'Район', undergroundstations.undergroundStation as 'ст. Метро', if(property.buyRent=1,'Продажy','Арендy') as 'Выставлен на' " +
                                "from property " +
                                "left join type on property.type = type.idType " +
                                "left join typeproperty on type.idTypeProperty = typeproperty.idTypeProperty " +
                                "left join cities on property.idCity = cities.idCity " +
                                "left join areas on property.idArea = areas.idArea " +
                                "left join district on property.idDistrict = district.idDistrict " +
                                "left join undergroundstations on property.idUndergroundStation = undergroundstations.idUndergroundStation " +
                                "where isRemoveBuyRent<>1";
            form2.dataGridView1.DataSource            = PublicClasses.executeSqlRequest().Tables[0];
            form2.dataGridView1.Columns[0].Visible    = false;
            form2.dataGridView1.Columns[1].HeaderText = "Тип недвижимости";
            form2.dataGridView1.Columns[2].HeaderText = "Город";
            form2.dataGridView1.Columns[3].HeaderText = "Область";
            form2.dataGridView1.Columns[4].HeaderText = "Район";
            form2.dataGridView1.Columns[5].HeaderText = "Ст. метро";
            form2.dataGridView1.Columns[6].HeaderText = "Выставлен на";
            form2.Show();
        }
コード例 #5
0
        private void button2_Click(object sender, EventArgs e) //вход в ситему
        {
            bool     l = false, l1 = false;
            property form2 = new property();

            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                errorProvider1.SetError(textBox1, "Поле не должно быть пустым");
            }
            else
            {
                l = true;
            }
            if (string.IsNullOrWhiteSpace(textBox2.Text))
            {
                errorProvider1.SetError(textBox2, "Поле не должно быть пустым");
            }
            else
            {
                l = true;
            }
            //if (string.IsNullOrWhiteSpace(textBox3.Text)) { errorProvider1.SetError(textBox3, "Введите капчу"); } else { l = true; }
            if (l)
            {
                PublicClasses.sql = "call checkPassword('" + textBox1.Text + "','" + textBox2.Text + "')";
                try
                {
                    PublicClasses.executeSqlRequest();
                    l1 = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Окно предупреждения", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                if (l1)
                {
                    try
                    {
                        PublicClasses.sql       = "select * from autorization_datas where login='******' and password='******';";
                        PublicClasses.idUser    = PublicClasses.executeSqlRequest().Tables[0].Rows[0].ItemArray[0].ToString();
                        PublicClasses.UserLogin = PublicClasses.executeSqlRequest().Tables[0].Rows[0].ItemArray[1].ToString();
                        if (PublicClasses.executeSqlRequest().Tables[0].Rows.Count == 0 /*|| captcha!=textBox3.Text*/)
                        {
                            MessageBox.Show("Ой что-то пошло не так. Попробуйте заполнить поля снова.", "Окно предупреждения", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            PublicClasses.sql = "select * from persons where idUser="******"";
                            if (PublicClasses.executeSqlRequest().Tables[0].Rows.Count != 0)
                            {
                                PublicClasses.privelege = 2;
                            }
                            else
                            {
                                PublicClasses.privelege = 1;
                            }
                            if (textBox1.Text == "admin" && textBox2.Text == "admin")
                            {
                                PublicClasses.privelege = 3;
                            }
                            this.Hide();
                            form2.Show();
                        }
                        PublicClasses.writeToFileUser(checkBox1);
                    }
                    catch (Exception ex) { MessageBox.Show("Неправильные пароль или логин.", "Вход в систему", MessageBoxButtons.OK, MessageBoxIcon.Error); }
                }
            }
        }