Esempio n. 1
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))
            {
            }
        }