using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace ImpulseVision { public partial class FormEditUser : Form { public FormEditUser() { InitializeComponent(); } private void TbxPassportSeria_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; if (e.KeyChar == (char)Keys.Back) { e.Handled = false; } if(char.IsDigit(e.KeyChar)) { e.Handled = false; } } private void TbxPassportNumber_TextChanged(object sender, EventArgs e) { if(TbxPassportNumber.Text.Trim().Length > 6) { string txt = TbxPassportNumber.Text.Trim().Substring(0, 6); TbxPassportNumber.Text = txt; } } private void TbxPassportSeria_TextChanged(object sender, EventArgs e) { if (TbxPassportSeria.Text.Trim().Length > 4) { string txt = TbxPassportSeria.Text.Trim().Substring(0, 4); TbxPassportSeria.Text = txt; } } private void FormEditUser_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'impulseVisionAppDataSet1.Users' table. You can move, or remove it, as needed. this.usersTableAdapter.Fill(this.impulseVisionAppDataSet1.Users); LblSelectUserID.Hide(); BsUserInfo.Filter = $"ID = '{LblSelectUserID.Text.Trim()}'"; } private void BtnSaveEditing_Click(object sender, EventArgs e) { BsUserInfo.EndEdit(); this.usersTableAdapter.Update(this.impulseVisionAppDataSet1.Users); Close(); } } }