예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (login.Text != "" && password.Text != "" && password_check.Text != "")
            {
                if (password.Text == password_check.Text)
                {
                    Work_Data data = new Work_Data();

                    if (!data.Check_Data(login.Text))
                    {
                        data.Set_Data(login.Text, password.Text);
                        Close();
                    }
                    else
                    {
                        MessageBox.Show("Такой логин уже зарегистрирован!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Поля для паролей должны быть одинаковыми!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Одно из полей пустое!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Work_Data       gl      = new Work_Data();
            InterpolContext context = new InterpolContext();

            if (Add_radio.Checked == true)
            {
                if (context.PSRelations.Any(c => c.person_id == GlobalTab.data_id))
                {
                    MessageBox.Show("Этот бандит уже прендалежит к синдикату!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    gl.Add_To_Syndicate(GlobalTab.data_id, context.Syndicates.Where(c => c.syn_name == comboBox1.SelectedItem.ToString()).Select(c => c.syn_id).FirstOrDefault(), maskedTextBox1.Text);
                    MessageBox.Show("Запись успешно создана!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                if (Delete_radio.Checked == true)
                {
                    if (context.PSRelations.Any(c => c.person_id == GlobalTab.data_id))
                    {
                        gl.Delete_From_Syndicate(GlobalTab.data_id);
                        MessageBox.Show("Запись успешно удаленна!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Этот бандит не прендалежит к выбраному синдикату!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
예제 #3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            data.OpenPermit(GlobalTab.data_id);
            Close();
        }
예제 #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            data.TextClear(login);
            data.TextClear(password);
            data.TextClear(password_check);
        }
예제 #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            data.TextClear(textBox1);
            data.TextClear(textBox2);
            data.TextClear(maskedTextBox1);
            data.TextClear(maskedTextBox2);
        }
예제 #6
0
        private void button3_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            data.Delete_Data(comboBox1.SelectedItem.ToString());
            comboBox1.Items.Clear();
            UsersContext context = new UsersContext();

            foreach (var r in context.Passwords.ToList())
            {
                comboBox1.Items.Add(r.login);
            }
        }
예제 #7
0
파일: Form1.cs 프로젝트: Khad515/InterpolIS
        private void delete_menustrip_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            if (data.CheckPermit(GlobalTab.data_id) == true)
            {
                data.Data_Delete(GlobalTab.data_id);
            }
            else
            {
                MessageBox.Show("Эта запись занята!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #8
0
        private void button2_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            data.TextClear(name_box);
            data.TextClear(bname_box);
            data.TextClear(coloreye_box);
            data.TextClear(haircolor_box);
            data.TextClear(birth_mbox);
            data.TextClear(citizen_box);
            data.TextClear(profession_box);
            data.TextClear(role_box);
        }
예제 #9
0
파일: Form1.cs 프로젝트: Khad515/InterpolIS
        private void AddDelete_menustrip_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            if (data.CheckPermit(GlobalTab.data_id) == true)
            {
                FPreson_Syndicate ps = new FPreson_Syndicate();
                ps.ShowDialog();
            }
            else
            {
                MessageBox.Show("Эта строка в данный момент занята!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #10
0
파일: Form1.cs 프로젝트: Khad515/InterpolIS
        private void update_menustrip_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            if (data.CheckPermit(GlobalTab.data_id) == true)
            {
                FData_Update form_update = new FData_Update();
                form_update.Show();
            }
            else
            {
                MessageBox.Show("Эта строка в данный момент занята!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #11
0
        private void FPreson_Syndicate_Shown(object sender, EventArgs e)
        {
            Work_Data       gl      = new Work_Data();
            InterpolContext context = new InterpolContext();

            gl.ClosePermit(GlobalTab.data_id);
            bandit_id_lbl.Text   = GlobalTab.data_id.ToString();
            bandit_name_lbl.Text = gl.Return_banditName(GlobalTab.data_id);

            foreach (var r in context.Syndicates.ToList())
            {
                comboBox1.Items.Add(r.syn_name);
            }
        }
예제 #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            if (data.Sign_Check(login.Text, password.Text))
            {
                GlobalTab.log_in = login.Text;
                Close();
            }
            else
            {
                MessageBox.Show("Неверный логин или пароль!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #13
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Work_Data wdata = new Work_Data();

            if (!wdata.Check_nickname(bname_box.Text))
            {
                wdata.CreateDataRow(name_box.Text, bname_box.Text, birth_mbox.Text, GlobalTab.path_photo, status_combobox.SelectedItem.ToString(), religion_combobox.SelectedItem.ToString(), language_combobox.SelectedItem.ToString(),
                                    profession_box.Text, role_box.Text, Convert.ToInt32(rise_numbox.Value), Convert.ToInt32(weight_numbox.Value),
                                    coloreye_box.Text, haircolor_box.Text, citizen_box.Text, national_combobox.SelectedItem.ToString());
                MessageBox.Show("Запись успешно создана!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Information);
                GlobalTab.count_datarows++;
            }
            else
            {
                MessageBox.Show("Такое прозвище уже существует, задайте другое!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            Work_Data wdata = new Work_Data();

            if (!wdata.Check_SyndicateName(syndicate_name_box.Text))
            {
                wdata.CreateSyndicate(syndicate_name_box.Text, syndicate_date_box.Text);
                MessageBox.Show("Запись успешно создана!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Такой синдикат уже существует, задайте другое!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            InterpolContext context = new InterpolContext();

            dataGridView1.Rows.Clear();
            foreach (var r in context.Syndicates.ToList())
            {
                dataGridView1.Rows.Add(r.syn_id, r.syn_name, r.syn_date);
            }
        }
예제 #15
0
        private void FData_View_Shown(object sender, EventArgs e)
        {
            Work_Data gl = new Work_Data();

            gl.ClosePermit(GlobalTab.data_id);
            name_lbl.Text        = gl.Return_banditName(GlobalTab.data_id);
            nickname_lbl.Text    = gl.Return_banditNickname(GlobalTab.data_id);
            rise_lbl.Text        = gl.Return_banditRise(GlobalTab.data_id).ToString();
            weight_lbl.Text      = gl.Return_banditWeight(GlobalTab.data_id).ToString();
            eyecolor_lbl.Text    = gl.Return_banditEyecolor(GlobalTab.data_id);
            haircolor_lbl.Text   = gl.Return_banditHaircolor(GlobalTab.data_id);
            birthday_lbl.Text    = gl.Return_banditBirthday(GlobalTab.data_id);
            citizenship_lbl.Text = gl.Return_banditCitizenship(GlobalTab.data_id);
            nationality_lbl.Text = gl.Return_banditNationality(GlobalTab.data_id);
            profession_lbl.Text  = gl.Return_banditProfession(GlobalTab.data_id);
            role_lbl.Text        = gl.Return_banditProfRole(GlobalTab.data_id);
            religion_lbl.Text    = gl.Return_banditReligion(GlobalTab.data_id);
            language_lbl.Text    = gl.Return_banditLanguage(GlobalTab.data_id);
            status_lbl.Text      = gl.Return_banditStatus(GlobalTab.data_id);
            pictureBox1.Load(gl.Return_banditPhoto(GlobalTab.data_id));
            Id_lbl.Text = GlobalTab.data_id.ToString();
        }
예제 #16
0
        private void button2_Click(object sender, EventArgs e)
        {
            Work_Data       work    = new Work_Data();
            InterpolContext context = new InterpolContext();

            if (context.Syndicates.Any(c => c.syn_id == id_num.Value))
            {
                work.Syndicate_Delete(Convert.ToInt32(id_num.Value));
                if (context.Syndicates.Count() != 0)
                {
                    dataGridView1.Rows.Clear();
                    foreach (var r in context.Syndicates.ToList())
                    {
                        dataGridView1.Rows.Add(r.syn_id, r.syn_name, r.syn_date);
                    }
                }
                MessageBox.Show("Запись успешно удаленна!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Не существует записи с таким id!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #17
0
        private void FData_View_FormClosing(object sender, FormClosingEventArgs e)
        {
            Work_Data data = new Work_Data();

            data.OpenPermit(GlobalTab.data_id);
        }
예제 #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            if (name_box.Text != bandit_name_lbl.Text)
            {
                data.UpdatePerson_Name(GlobalTab.data_id, name_box.Text);
            }
            if (nickname_box.Text != bandit_nickname_lbl.Text)
            {
                data.UpdatePerson_Nickname(GlobalTab.data_id, nickname_box.Text);
            }
            if (rise_numbox.Value != int.Parse(bandit_rise_lbl.Text))
            {
                data.UpdatePerson_Rise(GlobalTab.data_id, Convert.ToInt32(rise_numbox.Value));
            }
            if (weight_numbox.Value != int.Parse(bandit_weight_lbl.Text))
            {
                data.UpdatePerson_Weight(GlobalTab.data_id, Convert.ToInt32(weight_numbox.Value));
            }
            if (coloreye_box.Text != bandit_coloreye_lbl.Text)
            {
                data.UpdatePerson_Eyecolor(GlobalTab.data_id, coloreye_box.Text);
            }
            if (colorhair_box.Text != bandit_colorhair_lbl.Text)
            {
                data.UpdatePerson_Haircolor(GlobalTab.data_id, colorhair_box.Text);
            }
            if (birthdate_mbox.Text != bandit_birthday_lbl.Text)
            {
                data.UpdatePerson_Birthday(GlobalTab.data_id, birthdate_mbox.Text);
            }
            if (citizen_box.Text != bandit_citizen_lbl.Text)
            {
                data.UpdatePerson_Citizenship(GlobalTab.data_id, citizen_box.Text);
            }
            if (nationality_box.Text != bandit_nationality_lbl.Text)
            {
                data.UpdatePerson_Nationality(GlobalTab.data_id, nationality_box.Text);
            }
            if (profession_box.Text != bandit_profession_lbl.Text)
            {
                data.UpdatePerson_Profession(GlobalTab.data_id, profession_box.Text);
            }
            if (role_box.Text != bandit_role_lbl.Text)
            {
                data.UpdatePerson_Role(GlobalTab.data_id, role_box.Text);
            }
            if (religion_box.Text != bandit_religion_lbl.Text)
            {
                data.UpdatePerson_Religion(GlobalTab.data_id, religion_box.Text);
            }
            if (language_box.Text != bandit_language_lbl.Text)
            {
                data.UpdatePerson_Language(GlobalTab.data_id, language_box.Text);
            }
            if (status_box.Text != bandit_status_lbl.Text)
            {
                data.UpdatePerson_Status(GlobalTab.data_id, status_box.Text);
            }
            MessageBox.Show("Данные успешно измененны!", "База данных", MessageBoxButtons.OK, MessageBoxIcon.Information);
            GlobalTab.count_datarows++;
            if (data.Check_nickname(nickname_box.Text))
            {
            }
        }
예제 #19
0
        private void FPreson_Syndicate_FormClosing(object sender, FormClosingEventArgs e)
        {
            Work_Data gl = new Work_Data();

            gl.OpenPermit(GlobalTab.data_id);
        }
예제 #20
0
        private void button1_Click(object sender, EventArgs e)
        {
            Work_Data data = new Work_Data();

            data.FormTerminate(this);
        }