using Yw.WinFrmUI;
|
|
namespace HStation.WinFrmUI
|
{
|
public partial class AddPhoneNumberDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public AddPhoneNumberDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
|
this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; ;
|
}
|
|
public event Action<string> ReloadDataEvent;
|
|
//手机号验证
|
private bool IsValidMobileNumber(string mobile)
|
{
|
var regex = new System.Text.RegularExpressions.Regex(@"^1\d{10}$");
|
return regex.IsMatch(mobile);
|
}
|
|
/// <summary>
|
/// 确定
|
/// </summary>
|
private void GeneralOkAndCancelCtrl1_OkEvent()
|
{
|
if (!IsValidMobileNumber(this.txtEditPhoneNumber.Text.Trim()))
|
{
|
TipFormHelper.ShowError("手机号有误!");
|
return;
|
}
|
ReloadDataEvent.Invoke(this.txtEditPhoneNumber.Text.Trim());
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|