示例#1
0
        /// <summary>
        /// Регистраця зрителя.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnRegZritel_Click(object sender, EventArgs e)
        {
            if (!Password.IsPasswordCorrect(passwordTextBox.Text))
            {
                MessageBox.Show("Пароль не соответсвует требованиям.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (passwordTextBox.Text != TbxReplPass.Text)
            {
                MessageBox.Show("Пароли не совпадают", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (!IsMailCorect())
            {
                MessageBox.Show("Адрес E-mail некорректный", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                BsZritel.EndEdit();
                zritelsTableAdapter.Update(this.u37_1DataSet1.Zritels);
            }
            catch
            {
                MessageBox.Show("Пользователь с таким логином уже существует", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            MessageBox.Show("Пользователь зарегистрирован", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (CurrentPass != TbxOldPass.Text)
            {
                MessageBox.Show("Не верный пароль", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (!Password.IsPasswordCorrect(PassTextBox.Text))
            {
                MessageBox.Show("Пароль не соответствует требованиям.", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (!IsMailCorect())
            {
                MessageBox.Show("Не корректный адрес E-mail.", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            BsZritel.EndEdit();
            this.zritelsTableAdapter.Update(this.u37_1DataSet1.Zritels);

            this.Close();
        }
示例#3
0
        private void FormRegestry_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'u37_1DataSet1.Begun' table. You can move, or remove it, as needed.
            this.begunTableAdapter.Fill(this.u37_1DataSet1.Begun);
            // TODO: This line of code loads data into the 'u37_1DataSet1.Sponsor' table. You can move, or remove it, as needed.
            this.sponsorTableAdapter.Fill(this.u37_1DataSet1.Sponsor);
            // TODO: This line of code loads data into the 'u37_1DataSet1.Zritels' table. You can move, or remove it, as needed.
            this.zritelsTableAdapter.Fill(this.u37_1DataSet1.Zritels);

            BsZritel.AddNew();
            BsBegun.AddNew();
            BsSponsor.AddNew();
        }