1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.SMSManagement.ShortSmsMessage
- {
- public partial class FrmImportNumbers : LYFZ.Software.UI.SMSManagement.ShortSmsMessage.FrmImportNumbers
- {
- public string Telphone;
- public FrmImportNumbers()
- {
- }
- #region 确定
- protected override void btnOk_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(txtProd_SalesPrice.Text))
- {
- MessageBoxCustom.Show("请输入正确手机号码!");
- return;
- }
- string phone = txtProd_SalesPrice.Text.Trim().Replace(",", ",").Replace("\r\n", ",").Replace("\n", ",").Replace("\t", ",").Trim(',').Replace('/', ',').Replace('\\', ',');
- string lawfulPhone = "";
- string retMsg = LYFZ.WinAPI.CustomPublicMethod.ValidationPhones(phone, ref lawfulPhone);
- if (retMsg.Trim().Length > 0)
- {
- MessageBoxCustom.Show("入正手机号有误:" + retMsg);
- }
- else {
- this.Telphone = lawfulPhone;
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
-
- }
- #endregion
- #region 输入框设置
- protected override void txtProd_SalesPrice_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsPunctuation(e.KeyChar) && !Char.IsControl(e.KeyChar))
- {
- e.Handled = true;
- }
- else if (Char.IsPunctuation(e.KeyChar))
- {
- if (e.KeyChar != ',')
- {
- e.Handled = true;
- }
- }
- }
- #endregion
- #region 取消
- protected override void btnCanle_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- #endregion
- }
- }
|