private void ReseTextBox() { this.Abo_Load(abo, usu); MtxtIdentification.ResetText(); TxtName.ResetText(); TxtFirstN.ResetText(); TxtLastN.ResetText(); MtxtPhone.ResetText(); MtxtMovil.ResetText(); TxtEmail.ResetText(); TxtAddress.ResetText(); }
private void MtxtPhone_Validating(object sender, CancelEventArgs e) { if (!RegularExpression.PhoneValidation(MtxtPhone.Text.ToString())) { var message = MessageBox.Show("Please enter a valid Number in Sequence of (00)0000-0000 or 0000 000 000 or 0000000000", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (message == DialogResult.Retry) { MtxtPhone.SelectAll(); e.Cancel = true; } } }
public void Abo_Load(Abonado ab, Usuario user) { abo = new Abonado(); abo = ab; if (radioButton1.Checked == true) { MtxtIdentification.Mask = "00-0000-0000"; } else { MtxtIdentification.Mask = "00-0000-0000-0000-0000"; } if (abo.Identification == null) { btnSaveUpdate.Text = "Guardar"; MtxtIdentification.Enabled = true; // txt modo sin edicion MtxtIdentification.ReadOnly = false; // txt modo solo lectura return; } else { btnSaveUpdate.Text = "Editar"; MtxtIdentification.AppendText(abo.Identification.ToString()); MtxtIdentification.Enabled = false; MtxtIdentification.ReadOnly = true; TxtName.Text = abo.Name.ToString(); TxtFirstN.Text = abo.Firstname.ToString(); TxtLastN.Text = abo.Lastname.ToString(); MtxtMovil.Text = abo.Movil.ToString(); MtxtPhone.AppendText(abo.Phonenum.ToString()); TxtEmail.Text = abo.Email.ToString(); dateTimePicker1.Text = abo.Dateregister.ToString(); TxtAddress.Text = abo.Address.ToString(); } }